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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33 #include "demuxervdr.h"
34 #include "demuxerts.h"
40 #include "messagequeue.h"
43 #include "threadwin.h"
48 class PlayerRadio : public Thread_TYPE, public Callback
51 PlayerRadio(MessageQueue* messageQueue, void* messageReceiver, bool isRecording);
52 virtual ~PlayerRadio();
54 int init(ULLONG lengthBytes, ULONG lengthPackets);
56 void setStartBytes(ULLONG startBytes);
59 void play(ULONG apid); // Live radio
62 void jumpToPercent(int percent);
63 void skipForward(int seconds);
64 void skipBackward(int seconds);
66 UCHAR getState() { return state; }
67 ULONG getCurrentSeconds();
68 ULONG getLengthSeconds();
70 void call(void*); // for callback interface
72 const static UCHAR S_PLAY = 1;
73 const static UCHAR S_PAUSE_P = 2;
74 const static UCHAR S_STOP = 6;
75 const static UCHAR S_JUMP = 7;
79 const static UCHAR CONNECTION_LOST = 1;
80 const static UCHAR STOP_PLAYBACK = 2;
81 const static UCHAR STREAM_END = 3;
85 void threadPostStopCleanup();
88 void switchState(UCHAR newState, ULONG jumpPacket=0);
90 void threadFeedLive();
91 void threadFeedPlay();
92 void threadFeedScan();
94 void doConnectionLost();
95 void restartAtPacket(ULONG newPacket);
96 bool setLengthSeconds();
98 MessageQueue* messageQueue;
99 void* messageReceiver;
115 pthread_mutex_t mutex;
125 ULONG currentPacketNumber;
127 UINT startupBlockSize;
140 Play, Pause, FFwd, FBwd, (Stop), [Jump]