source: smplayer/trunk/src/mplayerprocess.h@ 175

Last change on this file since 175 was 165, checked in by Silvan Scherrer, 11 years ago

SMPlayer: update trunk to latest 0.8.7

  • Property svn:eol-style set to LF
File size: 3.6 KB
Line 
1/* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2014 Ricardo Villalba <rvm@users.sourceforge.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17*/
18
19#ifndef _MPLAYERPROCESS_H_
20#define _MPLAYERPROCESS_H_
21
22#include <QString>
23#include "myprocess.h"
24#include "mediadata.h"
25#include "config.h"
26
27#ifdef Q_OS_OS2
28#include <QThread>
29#include <qt_os2.h>
30#endif
31
32#define NOTIFY_SUB_CHANGES 1
33#define NOTIFY_AUDIO_CHANGES 1
34
35#ifdef Q_OS_OS2
36class PipeThread : public QThread
37{
38public:
39 PipeThread(const QByteArray t, const HPIPE pipe);
40 ~PipeThread();
41 void run();
42
43private:
44 HPIPE hpipe;
45 QByteArray text;
46};
47#endif
48
49
50class QStringList;
51
52class MplayerProcess : public MyProcess
53{
54 Q_OBJECT
55
56public:
57 MplayerProcess(QObject * parent = 0);
58 ~MplayerProcess();
59
60 bool start();
61 void writeToStdin(QString text);
62
63 MediaData mediaData() { return md; };
64
65signals:
66 void processExited();
67 void lineAvailable(QString line);
68
69 void receivedCurrentSec(double sec);
70 void receivedCurrentFrame(int frame);
71 void receivedPause();
72 void receivedWindowResolution(int,int);
73 void receivedNoVideo();
74 void receivedVO(QString);
75 void receivedAO(QString);
76 void receivedEndOfFile();
77 void mplayerFullyLoaded();
78 void receivedStartingTime(double sec);
79
80 void receivedCacheMessage(QString);
81 void receivedCacheEmptyMessage(QString);
82 void receivedCreatingIndex(QString);
83 void receivedConnectingToMessage(QString);
84 void receivedResolvingMessage(QString);
85 void receivedScreenshot(QString);
86 void receivedUpdatingFontCache();
87 void receivedScanningFont(QString);
88 void receivedForbiddenText();
89
90 void receivedStreamTitle(QString);
91 void receivedStreamTitleAndUrl(QString,QString);
92
93 void failedToParseMplayerVersion(QString line_with_mplayer_version);
94
95#if NOTIFY_SUB_CHANGES
96 //! Emitted if a new subtitle has been added or an old one changed
97 void subtitleInfoChanged(const SubTracks &);
98
99 //! Emitted when subtitle info has been received but there wasn't anything new
100 void subtitleInfoReceivedAgain(const SubTracks &);
101#endif
102#if NOTIFY_AUDIO_CHANGES
103 //! Emitted if a new audio track been added or an old one changed
104 void audioInfoChanged(const Tracks &);
105#endif
106
107#if DVDNAV_SUPPORT
108 void receivedDVDTitle(int);
109 void receivedDuration(double);
110 void receivedTitleIsMenu();
111 void receivedTitleIsMovie();
112#endif
113
114protected slots:
115 void parseLine(QByteArray ba);
116 void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
117 void gotError(QProcess::ProcessError);
118
119#if defined(Q_OS_OS2)
120 void MPpipeOpen();
121 void MPpipeClose();
122 void MPpipeWrite(const QByteArray text);
123#endif
124
125private:
126 bool notified_mplayer_is_running;
127 bool received_end_of_file;
128
129 MediaData md;
130
131 int last_sub_id;
132
133#if defined(Q_OS_OS2)
134 PipeThread *pipeThread;
135 HPIPE hpipe;
136 PID pidMP;
137#endif
138
139 int mplayer_svn;
140
141#if NOTIFY_SUB_CHANGES
142 SubTracks subs;
143
144 bool subtitle_info_received;
145 bool subtitle_info_changed;
146#endif
147
148#if NOTIFY_AUDIO_CHANGES
149 Tracks audios;
150 bool audio_info_changed;
151#endif
152
153 int dvd_current_title;
154 int br_current_title;
155};
156
157
158#endif
Note: See TracBrowser for help on using the repository browser.