2 Copyright 2004-2008 Chris Tallon
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
32 #include "threadwin.h"
43 #include "teletextdecodervbiebu.h"
54 class Player : public Thread_TYPE, public Callback
57 Player(MessageQueue* messageQueue, void* messageReceiver, OSDReceiver* osdReceiver);
62 void setStartFrame(ULONG frameNum);
63 void setLengthBytes(ULLONG length);
64 void setLengthFrames(ULONG length);
65 void setAudioChannel(int newChannel, int type);
66 void setSubtitleChannel(int newChannel);
67 bool toggleSubtitles();
68 void turnSubtitlesOn(bool ison);
69 bool isSubtitlesOn() {return subtitlesShowing;};
76 void jumpToPercent(double percent);
77 void skipForward(int seconds);
78 void skipBackward(int seconds);
79 void jumpToMark(int mark);
80 void jumpToFrameP(int newFrame);
82 UCHAR getState() { return state; }
83 ULONG getCurrentFrameNum();
84 ULONG getLengthFrames();
85 UCHAR getIScanRate() { return ifactor; }
86 bool* getDemuxerMpegAudioChannels();
87 bool* getDemuxerAc3AudioChannels();
88 bool* getDemuxerSubtitleChannels();
89 int *getTeletxtSubtitlePages();
90 int getCurrentAudioChannel();
91 int getCurrentSubtitleChannel();
93 TeletextDecoderVBIEBU * getTeletextDecoder(){return teletext;};
95 void call(void*); // for callback interface
97 const static UCHAR S_PLAY = 1;
98 const static UCHAR S_PAUSE_P = 2;
99 const static UCHAR S_PAUSE_I = 3;
100 const static UCHAR S_FFWD = 4;
101 const static UCHAR S_FBWD = 5;
102 const static UCHAR S_STOP = 6;
103 const static UCHAR S_JUMP = 7;
104 const static UCHAR S_JUMP_PI = 8; // Jump to Pause_I mode
108 // FIXME so far this just duplicates the old system + the wss
110 const static UCHAR CONNECTION_LOST = 1;
111 const static UCHAR STOP_PLAYBACK = 2;
112 const static UCHAR STREAM_END = 3;
113 const static UCHAR ASPECT43 = 4;
114 const static UCHAR ASPECT169 = 5;
123 void threadPostStopCleanup();
126 void switchState(UCHAR newState, ULONG jumpFrame=0);
128 void threadFeedPlay();
129 void threadFeedScan();
131 void doConnectionLost();
132 void restartAtFrame(ULONG newFrame);
133 void restartAtFramePI(ULONG newFrame);
135 bool subtitlesShowing;
136 MessageQueue* messageQueue;
137 void* messageReceiver;
138 OSDReceiver* osdReceiver;
143 DVBSubtitles* subtitles;
148 TeletextDecoderVBIEBU *teletext;
157 pthread_mutex_t mutex;
166 ULONG currentFrameNumber;
168 UINT startupBlockSize;
181 Play, Pause, FFwd, FBwd, (Stop), [Jump]