source: smplayer/vendor/current/src/playerprocess.h@ 179

Last change on this file since 179 was 179, checked in by Silvan Scherrer, 9 years ago

smplayer: update vendor to version 16.8.0

File size: 7.1 KB
Line 
1/* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2016 Ricardo Villalba <[email protected]>
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 PLAYERPROCESS_H
20#define PLAYERPROCESS_H
21
22#include "myprocess.h"
23#include "mediadata.h"
24#include "playerid.h"
25#include "config.h"
26#include "assstyles.h"
27#include <QVariant>
28
29class PlayerProcess : public MyProcess
30{
31 Q_OBJECT
32
33public:
34 enum ScreenshotType { Single = 0, Multiple = 1 };
35
36 PlayerProcess(QObject * parent = 0);
37
38 PlayerID::Player player() { return player_id; }
39 bool isMPlayer() { return (player_id == PlayerID::MPLAYER); }
40 bool isMPV() { return (player_id == PlayerID::MPV); }
41
42 virtual bool start() = 0;
43
44 void writeToStdin(QString text);
45 MediaData mediaData() { return md; };
46
47 // Command line options
48 virtual void setMedia(const QString & media, bool is_playlist = false) = 0;
49 virtual void setFixedOptions() = 0;
50 virtual void disableInput() = 0;
51 virtual void setOption(const QString & option_name, const QVariant & value = QVariant()) = 0;
52 virtual void addUserOption(const QString & option) = 0;
53 virtual void addVF(const QString & filter_name, const QVariant & value = QVariant()) = 0;
54 virtual void addAF(const QString & filter_name, const QVariant & value = QVariant()) = 0;
55 virtual void addStereo3DFilter(const QString & in, const QString & out) = 0;
56 virtual void setSubStyles(const AssStyles & styles, const QString & assStylesFile = QString::null) = 0;
57
58 // Slave commands
59 virtual void quit() = 0;
60 virtual void setVolume(int v) = 0;
61 virtual void setOSD(int o) = 0;
62 virtual void setAudio(int ID) = 0;
63 virtual void setVideo(int ID) = 0;
64 virtual void setSubtitle(int type, int ID) = 0;
65 virtual void disableSubtitles() = 0;
66 virtual void setSecondarySubtitle(int ID) = 0;
67 virtual void disableSecondarySubtitles() = 0;
68 virtual void setSubtitlesVisibility(bool b) = 0;
69 virtual void seek(double secs, int mode, bool precise) = 0;
70 virtual void mute(bool b) = 0;
71 virtual void setPause(bool b) = 0;
72 virtual void frameStep() = 0;
73 virtual void frameBackStep() = 0;
74 virtual void showOSDText(const QString & text, int duration, int level) = 0;
75 virtual void showFilenameOnOSD() = 0;
76 virtual void showTimeOnOSD() = 0;
77 virtual void setContrast(int value) = 0;
78 virtual void setBrightness(int value) = 0;
79 virtual void setHue(int value) = 0;
80 virtual void setSaturation(int value) = 0;
81 virtual void setGamma(int value) = 0;
82 virtual void setChapter(int ID) = 0;
83 virtual void nextChapter() = 0;
84 virtual void previousChapter() = 0;
85 virtual void setExternalSubtitleFile(const QString & filename) = 0;
86 virtual void setSubPos(int pos) = 0;
87 virtual void setSubScale(double value) = 0;
88 virtual void setSubStep(int value) = 0;
89#ifdef MPV_SUPPORT
90 virtual void seekSub(int value) = 0;
91#endif
92 virtual void setSubForcedOnly(bool b) = 0;
93 virtual void setSpeed(double value) = 0;
94#ifdef MPLAYER_SUPPORT
95 virtual void enableKaraoke(bool b) = 0;
96#endif
97 virtual void enableExtrastereo(bool b) = 0;
98 virtual void enableVolnorm(bool b, const QString & option) = 0;
99 virtual void setAudioEqualizer(const QString & values) = 0;
100 virtual void setAudioDelay(double delay) = 0;
101 virtual void setSubDelay(double delay) = 0;
102 virtual void setLoop(int v) = 0;
103 virtual void setAMarker(int sec) = 0;
104 virtual void setBMarker(int sec) = 0;
105 virtual void clearABMarkers() = 0;
106 virtual void takeScreenshot(ScreenshotType t, bool include_subtitles = false) = 0;
107#ifdef CAPTURE_STREAM
108 virtual void switchCapturing() = 0;
109#endif
110 virtual void setTitle(int ID) = 0;
111 virtual void changeVF(const QString & filter, bool enable, const QVariant & option = QVariant()) = 0;
112 virtual void changeStereo3DFilter(bool enable, const QString & in, const QString & out) = 0;
113#if DVDNAV_SUPPORT
114 virtual void discSetMousePos(int x, int y) = 0;
115 virtual void discButtonPressed(const QString & button_name) = 0;
116#endif
117 virtual void setAspect(double aspect) = 0;
118 virtual void setFullscreen(bool b) = 0;
119#if PROGRAM_SWITCH
120 virtual void setTSProgram(int ID) = 0;
121#endif
122 virtual void toggleDeinterlace() = 0;
123 virtual void askForLength() = 0;
124 virtual void setOSDScale(double value) = 0;
125 virtual void setChannelsFile(const QString &) = 0;
126
127 virtual void enableScreenshots(const QString & dir, const QString & templ = QString::null, const QString & format = QString::null) = 0;
128
129 void setPausingPrefix(const QString & prefix) { pausing_prefix = prefix; };
130
131#ifdef CAPTURE_STREAM
132 virtual void setCaptureDirectory(const QString & dir);
133#endif
134
135 static PlayerProcess * createPlayerProcess(const QString & player_bin, QObject * parent = 0);
136
137// Signals
138signals:
139 void processExited();
140 void lineAvailable(QString line);
141
142 void receivedCurrentSec(double sec);
143 void receivedCurrentFrame(int frame);
144 void receivedPause();
145 void receivedWindowResolution(int,int);
146 void receivedNoVideo();
147 void receivedVO(QString);
148 void receivedAO(QString);
149 void receivedEndOfFile();
150 void mplayerFullyLoaded();
151 void receivedStartingTime(double sec);
152
153 void receivedCacheMessage(QString);
154 void receivedCacheEmptyMessage(QString);
155 void receivedCreatingIndex(QString);
156 void receivedConnectingToMessage(QString);
157 void receivedResolvingMessage(QString);
158 void receivedBuffering();
159 void receivedPlaying();
160 void receivedScreenshot(QString);
161 void receivedUpdatingFontCache();
162 void receivedScanningFont(QString);
163 void receivedForbiddenText();
164
165 void receivedStreamTitle(QString);
166 void receivedStreamTitleAndUrl(QString,QString);
167
168 void failedToParseMplayerVersion(QString line_with_mplayer_version);
169
170#if NOTIFY_SUB_CHANGES
171 //! Emitted if a new subtitle has been added or an old one changed
172 void subtitleInfoChanged(const SubTracks &);
173
174 //! Emitted when subtitle info has been received but there wasn't anything new
175 void subtitleInfoReceivedAgain(const SubTracks &);
176#endif
177#if NOTIFY_AUDIO_CHANGES
178 //! Emitted if a new audio track been added or an old one changed
179 void audioInfoChanged(const Tracks &);
180#endif
181#if NOTIFY_VIDEO_CHANGES
182 //! Emitted if a new video track been added or an old one changed
183 void videoInfoChanged(const Tracks &);
184#endif
185#if NOTIFY_CHAPTER_CHANGES
186 void chaptersChanged(const Chapters &);
187#endif
188
189#if DVDNAV_SUPPORT
190 void receivedDVDTitle(int);
191 void receivedDuration(double);
192 void receivedTitleIsMenu();
193 void receivedTitleIsMovie();
194#endif
195
196 void receivedVideoBitrate(int);
197 void receivedAudioBitrate(int);
198
199protected:
200 MediaData md;
201 QString pausing_prefix;
202
203#ifdef CAPTURE_STREAM
204 QString capture_filename;
205#endif
206
207 PlayerID::Player player_id;
208};
209
210#endif
Note: See TracBrowser for help on using the repository browser.