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"
47 * VDR tells me there are around 8.3 "frames" per second in radio recordings.
48 * I don't know where this comes from but things seem to work.
51 class PlayerRadio : public Thread_TYPE, public Callback
54 PlayerRadio(MessageQueue* messageQueue, void* messageReceiver);
55 virtual ~PlayerRadio();
57 int init(ULLONG lengthBytes, ULONG lengthFrames, bool IsPesRecording);
59 void setCurrentFrameNumber(ULONG num);
65 void jumpToPercent(double percent);
66 void skipForward(UINT seconds);
67 void skipBackward(UINT seconds);
69 UCHAR getState() { return state; }
70 ULONG getCurrentSeconds();
71 ULONG getLengthSeconds();
73 void call(void*); // for callback interface
75 const static UCHAR S_PLAY = 1;
76 const static UCHAR S_PAUSE_P = 2;
77 const static UCHAR S_STOP = 6;
78 const static UCHAR S_JUMP = 7;
82 const static UCHAR CONNECTION_LOST = 1;
83 const static UCHAR STOP_PLAYBACK = 2;
84 const static UCHAR STREAM_END = 3;
88 void threadPostStopCleanup();
91 void switchState(UCHAR newState, ULONG jumpToFrame=0);
93 void threadFeedPlay();
94 void threadFeedScan();
96 void doConnectionLost();
97 void restartAtFrame(ULONG newFrame);
98 bool setLengthSeconds();
100 MessageQueue* messageQueue;
101 void* messageReceiver;
115 pthread_mutex_t mutex;
124 ULONG currentFrameNumber;
126 UINT startupBlockSize;
138 Play, Pause, FFwd, FBwd, (Stop), [Jump]