2 Copyright 2004-2006 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.
31 #include "threadsystem.h"
44 class PlayerRadio : public Thread_TYPE, public Callback
47 PlayerRadio(MessageQueue* messageQueue, void* messageReceiver);
48 virtual ~PlayerRadio();
50 int init(ULLONG lengthBytes, ULONG lengthPackets, bool IsPesRecording);
52 void setStartBytes(ULLONG startBytes);
58 void jumpToPercent(double percent);
59 void skipForward(UINT seconds);
60 void skipBackward(UINT seconds);
62 UCHAR getState() { return state; }
63 ULONG getCurrentSeconds();
64 ULONG getLengthSeconds();
66 void call(void*); // for callback interface
68 const static UCHAR S_PLAY = 1;
69 const static UCHAR S_PAUSE_P = 2;
70 const static UCHAR S_STOP = 6;
71 const static UCHAR S_JUMP = 7;
75 const static UCHAR CONNECTION_LOST = 1;
76 const static UCHAR STOP_PLAYBACK = 2;
77 const static UCHAR STREAM_END = 3;
81 void threadPostStopCleanup();
84 void switchState(UCHAR newState, ULONG jumpPacket=0);
86 void threadFeedPlay();
87 void threadFeedScan();
89 void doConnectionLost();
90 void restartAtPacket(ULONG newPacket);
91 bool setLengthSeconds();
93 MessageQueue* messageQueue;
94 void* messageReceiver;
108 pthread_mutex_t mutex;
118 ULONG currentPacketNumber;
120 UINT startupBlockSize;
132 Play, Pause, FFwd, FBwd, (Stop), [Jump]