2 Copyright 2008 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.
21 #ifndef PLAYERLIVERADIO_H
22 #define PLAYERLIVERADIO_H
33 #include "playerlive.h"
36 #include "threadwin.h"
51 class PlayerLiveRadio : public PlayerLive, public Thread_TYPE, public Callback, public StreamReceiver
54 PlayerLiveRadio(MessageQueue* messageQueue, void* messageReceiver, ChannelList* chanList);
55 virtual ~PlayerLiveRadio();
58 virtual int shutdown();
60 virtual void go(ULONG index);
61 virtual void setChannel(ULONG index);
63 virtual void setAudioChannel(int newChannel, int type);
65 virtual bool* getDemuxerMpegAudioChannels();
66 virtual bool* getDemuxerAc3AudioChannels();
67 virtual int getCurrentAudioChannel();
69 void call(void*); // for callback interface
71 virtual void streamReceive(void*, ULONG); // stream receiver interface
75 // FIXME so far this just duplicates the old system + the wss
77 const static UCHAR CONNECTION_LOST = 1;
78 const static UCHAR STOP_PLAYBACK = 2;
79 const static UCHAR STREAM_END = 3;
80 const static UCHAR ASPECT43 = 4;
81 const static UCHAR ASPECT169 = 5;
85 void threadPostStopCleanup() {};
88 MessageQueue* messageQueue;
89 void* messageReceiver;
95 ChannelList* chanList;
97 queue<PLInstruction> instructions;
98 const static UCHAR I_SETCHANNEL = 1;
99 const static UCHAR I_STOP = 2;
101 queue<StreamChunk> streamChunks;
106 const static UCHAR S_STOP = 1;
107 const static UCHAR S_PREBUFFERING = 2;
108 const static UCHAR S_PLAY = 3;
109 void switchState(UCHAR newState);
113 const static int preBufferAmount = 3;
115 void clearStreamChunks();
116 void chunkToDemuxer();
117 void optimizeInstructionQueue();