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"
49 class Player : public Thread_TYPE, public Callback
52 Player(MessageQueue* messageQueue, void* messageReceiver);
57 void setStartFrame(ULONG frameNum);
58 void setLengthBytes(ULLONG length);
59 void setLengthFrames(ULONG length);
60 void setAudioChannel(int newChannel, int type);
67 void jumpToPercent(double percent);
68 void skipForward(int seconds);
69 void skipBackward(int seconds);
70 void jumpToMark(int mark);
71 void jumpToFrameP(int newFrame);
73 UCHAR getState() { return state; }
74 ULONG getCurrentFrameNum();
75 ULONG getLengthFrames();
76 UCHAR getIScanRate() { return ifactor; }
77 bool* getDemuxerMpegAudioChannels();
78 bool* getDemuxerAc3AudioChannels();
79 int getCurrentAudioChannel();
81 void call(void*); // for callback interface
83 const static UCHAR S_PLAY = 1;
84 const static UCHAR S_PAUSE_P = 2;
85 const static UCHAR S_PAUSE_I = 3;
86 const static UCHAR S_FFWD = 4;
87 const static UCHAR S_FBWD = 5;
88 const static UCHAR S_STOP = 6;
89 const static UCHAR S_JUMP = 7;
90 const static UCHAR S_JUMP_PI = 8; // Jump to Pause_I mode
94 // FIXME so far this just duplicates the old system + the wss
96 const static UCHAR CONNECTION_LOST = 1;
97 const static UCHAR STOP_PLAYBACK = 2;
98 const static UCHAR STREAM_END = 3;
99 const static UCHAR ASPECT43 = 4;
100 const static UCHAR ASPECT169 = 5;
109 void threadPostStopCleanup();
112 void switchState(UCHAR newState, ULONG jumpFrame=0);
114 void threadFeedPlay();
115 void threadFeedScan();
117 void doConnectionLost();
118 void restartAtFrame(ULONG newFrame);
119 void restartAtFramePI(ULONG newFrame);
121 MessageQueue* messageQueue;
122 void* messageReceiver;
136 pthread_mutex_t mutex;
145 ULONG currentFrameNumber;
147 UINT startupBlockSize;
160 Play, Pause, FFwd, FBwd, (Stop), [Jump]