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"
51 class Player : public Thread_TYPE, public Callback
54 Player(MessageQueue* messageQueue, void* messageReceiver, OSDReceiver* osdReceiver);
59 void setStartFrame(ULONG frameNum);
60 void setLengthBytes(ULLONG length);
61 void setLengthFrames(ULONG length);
62 void setAudioChannel(int newChannel, int type);
63 bool toggleSubtitles();
70 void jumpToPercent(double percent);
71 void skipForward(int seconds);
72 void skipBackward(int seconds);
73 void jumpToMark(int mark);
74 void jumpToFrameP(int newFrame);
76 UCHAR getState() { return state; }
77 ULONG getCurrentFrameNum();
78 ULONG getLengthFrames();
79 UCHAR getIScanRate() { return ifactor; }
80 bool* getDemuxerMpegAudioChannels();
81 bool* getDemuxerAc3AudioChannels();
82 int getCurrentAudioChannel();
84 void call(void*); // for callback interface
86 const static UCHAR S_PLAY = 1;
87 const static UCHAR S_PAUSE_P = 2;
88 const static UCHAR S_PAUSE_I = 3;
89 const static UCHAR S_FFWD = 4;
90 const static UCHAR S_FBWD = 5;
91 const static UCHAR S_STOP = 6;
92 const static UCHAR S_JUMP = 7;
93 const static UCHAR S_JUMP_PI = 8; // Jump to Pause_I mode
97 // FIXME so far this just duplicates the old system + the wss
99 const static UCHAR CONNECTION_LOST = 1;
100 const static UCHAR STOP_PLAYBACK = 2;
101 const static UCHAR STREAM_END = 3;
102 const static UCHAR ASPECT43 = 4;
103 const static UCHAR ASPECT169 = 5;
112 void threadPostStopCleanup();
115 void switchState(UCHAR newState, ULONG jumpFrame=0);
117 void threadFeedPlay();
118 void threadFeedScan();
120 void doConnectionLost();
121 void restartAtFrame(ULONG newFrame);
122 void restartAtFramePI(ULONG newFrame);
124 bool subtitlesShowing;
125 MessageQueue* messageQueue;
126 void* messageReceiver;
127 OSDReceiver* osdReceiver;
132 DVBSubtitles* subtitles;
142 pthread_mutex_t mutex;
151 ULONG currentFrameNumber;
153 UINT startupBlockSize;
166 Play, Pause, FFwd, FBwd, (Stop), [Jump]