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
31 #include "demuxervdr.h"
38 #include "messagequeue.h"
41 #include "threadwin.h"
46 class Player : public Thread_TYPE, public Callback
49 Player(MessageQueue* messageQueue, bool isRecording, bool isRadio);
54 void setStartFrame(ULONG frameNum);
55 void setLengthBytes(ULLONG length);
56 void setLengthFrames(ULONG length);
61 void toggleFastForward();
62 void toggleFastBackward();
63 void jumpToPercent(int percent);
64 void skipForward(int seconds);
65 void skipBackward(int seconds);
67 UCHAR getState() { return state; }
68 ULONG getCurrentFrameNum();
69 ULONG getLengthFrames();
71 void call(void*); // for callback interface
73 const static UCHAR S_PLAY = 1;
74 const static UCHAR S_PAUSE_P = 2;
75 const static UCHAR S_PAUSE_I = 3;
76 const static UCHAR S_FFWD = 4;
77 const static UCHAR S_FBWD = 5;
78 const static UCHAR S_STOP = 6;
79 const static UCHAR S_JUMP = 7;
88 void threadPostStopCleanup();
91 void switchState(UCHAR newState, ULONG jumpFrame=0);
93 void threadFeedLive();
94 void threadFeedPlay();
95 void threadFeedScan();
98 void doConnectionLost();
99 void restartAtFrame(ULONG newFrame);
101 MessageQueue* commandMessageQueue;
118 pthread_mutex_t mutex;
127 ULONG currentFrameNumber;
129 UINT startupBlockSize;
133 const static UINT ifactor = 5;
143 Play, Pause, FFwd, FBwd, (Stop), [Jump]