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

Last change on this file since 148 was 142, checked in by Silvan Scherrer, 12 years ago

SMPlayer: update trunk to 0.8.5

  • Property svn:eol-style set to LF
File size: 3.6 KB
Line 
1/* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2013 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
89 void receivedStreamTitle(QString);
90 void receivedStreamTitleAndUrl(QString,QString);
91
92 void failedToParseMplayerVersion(QString line_with_mplayer_version);
93
94#if NOTIFY_SUB_CHANGES
95 //! Emitted if a new subtitle has been added or an old one changed
96 void subtitleInfoChanged(const SubTracks &);
97
98 //! Emitted when subtitle info has been received but there wasn't anything new
99 void subtitleInfoReceivedAgain(const SubTracks &);
100#endif
101#if NOTIFY_AUDIO_CHANGES
102 //! Emitted if a new audio track been added or an old one changed
103 void audioInfoChanged(const Tracks &);
104#endif
105
106#if DVDNAV_SUPPORT
107 void receivedDVDTitle(int);
108 void receivedDuration(double);
109 void receivedTitleIsMenu();
110 void receivedTitleIsMovie();
111#endif
112
113protected slots:
114 void parseLine(QByteArray ba);
115 void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
116 void gotError(QProcess::ProcessError);
117
118#if defined(Q_OS_OS2)
119 void MPpipeOpen();
120 void MPpipeClose();
121 void MPpipeWrite(const QByteArray text);
122#endif
123
124private:
125 bool notified_mplayer_is_running;
126 bool received_end_of_file;
127
128 MediaData md;
129
130 int last_sub_id;
131
132#if defined(Q_OS_OS2)
133 PipeThread *pipeThread;
134 HPIPE hpipe;
135 PID pidMP;
136#endif
137
138 int mplayer_svn;
139
140#if NOTIFY_SUB_CHANGES
141 SubTracks subs;
142
143 bool subtitle_info_received;
144 bool subtitle_info_changed;
145#endif
146
147#if NOTIFY_AUDIO_CHANGES
148 Tracks audios;
149 bool audio_info_changed;
150#endif
151
152 int dvd_current_title;
153};
154
155
156#endif
Note: See TracBrowser for help on using the repository browser.