2 Copyright 2004-2005 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 #include "threadwin.h"
49 class Player : public Thread_TYPE, public Callback
52 Player(MessageQueue* messageQueue, void* messageReceiver, bool isRecording);
57 void setStartFrame(ULONG frameNum);
58 void setLengthBytes(ULLONG length);
59 void setLengthFrames(ULONG length);
60 void setAudioChannel(int newChannel);
62 void play(); // Recording
63 void play(ULONG vpid, ULONG apid); // Live TV
68 void jumpToPercent(double percent);
69 void skipForward(int seconds);
70 void skipBackward(int seconds);
71 void jumpToMark(int mark);
72 void jumpToFrameP(int newFrame);
74 UCHAR getState() { return state; }
75 ULONG getCurrentFrameNum();
76 ULONG getLengthFrames();
77 UCHAR getIScanRate() { return ifactor; }
78 bool* getDemuxerMpegAudioChannels();
79 bool* getDemuxerAc3AudioChannels();
80 int getCurrentAudioChannel();
82 void call(void*); // for callback interface
84 const static UCHAR S_PLAY = 1;
85 const static UCHAR S_PAUSE_P = 2;
86 const static UCHAR S_PAUSE_I = 3;
87 const static UCHAR S_FFWD = 4;
88 const static UCHAR S_FBWD = 5;
89 const static UCHAR S_STOP = 6;
90 const static UCHAR S_JUMP = 7;
91 const static UCHAR S_JUMP_PI = 8; // Jump to Pause_I mode
95 // FIXME so far this just duplicates the old system + the wss
97 const static UCHAR CONNECTION_LOST = 1;
98 const static UCHAR STOP_PLAYBACK = 2;
99 const static UCHAR STREAM_END = 3;
100 const static UCHAR ASPECT43 = 4;
101 const static UCHAR ASPECT169 = 5;
110 void threadPostStopCleanup();
113 void switchState(UCHAR newState, ULONG jumpFrame=0);
115 void threadFeedLive();
116 void threadFeedPlay();
117 void threadFeedScan();
119 void doConnectionLost();
120 void restartAtFrame(ULONG newFrame);
121 void restartAtFramePI(ULONG newFrame);
123 MessageQueue* messageQueue;
124 void* messageReceiver;
140 pthread_mutex_t mutex;
149 ULONG currentFrameNumber;
151 UINT startupBlockSize;
165 Play, Pause, FFwd, FBwd, (Stop), [Jump]