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.
32 #include "threadwin.h"
47 class PlayerRadio : public Thread_TYPE, public Callback
50 PlayerRadio(MessageQueue* messageQueue, void* messageReceiver);
51 virtual ~PlayerRadio();
53 int init(ULLONG lengthBytes, ULONG lengthPackets, bool IsPesRecording);
55 void setStartBytes(ULLONG startBytes);
60 void jumpToPercent(double percent);
61 void skipForward(UINT seconds);
62 void skipBackward(UINT seconds);
64 UCHAR getState() { return state; }
65 ULONG getCurrentSeconds();
66 ULONG getLengthSeconds();
68 void call(void*); // for callback interface
70 const static UCHAR S_PLAY = 1;
71 const static UCHAR S_PAUSE_P = 2;
72 const static UCHAR S_STOP = 6;
73 const static UCHAR S_JUMP = 7;
77 const static UCHAR CONNECTION_LOST = 1;
78 const static UCHAR STOP_PLAYBACK = 2;
79 const static UCHAR STREAM_END = 3;
83 void threadPostStopCleanup();
86 void switchState(UCHAR newState, ULONG jumpPacket=0);
88 void threadFeedPlay();
89 void threadFeedScan();
91 void doConnectionLost();
92 void restartAtPacket(ULONG newPacket);
93 bool setLengthSeconds();
95 MessageQueue* messageQueue;
96 void* messageReceiver;
110 pthread_mutex_t mutex;
120 ULONG currentPacketNumber;
122 UINT startupBlockSize;
134 Play, Pause, FFwd, FBwd, (Stop), [Jump]