2 Copyright 2004-2005 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 PLAYERLIVETV_H
22 #define PLAYERLIVETV_H
33 #include "playerlive.h"
36 #include "threadwin.h"
48 #include "teletextdecodervbiebu.h"
58 class PlayerLiveTV : public PlayerLive, public Thread_TYPE, public Callback, public StreamReceiver
61 PlayerLiveTV(MessageQueue* messageQueue, void* messageReceiver, OSDReceiver* tosdReceiver, ChannelList* chanList);
62 virtual ~PlayerLiveTV();
65 virtual int shutdown();
67 virtual void go(ULONG index);
68 virtual void setChannel(ULONG index);
70 virtual void setAudioChannel(int newChannel,int type);
71 virtual void setSubtitleChannel(int newChannel);
72 virtual bool toggleSubtitles();
73 virtual void turnSubtitlesOn(bool ison);
74 virtual bool isSubtitlesOn() {return subtitlesShowing;};
76 virtual bool* getDemuxerMpegAudioChannels();
77 virtual bool* getDemuxerAc3AudioChannels();
78 virtual int getCurrentAudioChannel();
79 virtual int getCurrentSubtitleChannel();
80 virtual int *getTeletxtSubtitlePages();
82 TeletextDecoderVBIEBU * getTeletextDecoder(){return teletext;};
84 void call(void*); // for callback interface
86 virtual void streamReceive(ULONG, void*, ULONG); // stream receiver interface
90 // FIXME so far this just duplicates the old system + the wss
92 const static UCHAR CONNECTION_LOST = 1;
93 const static UCHAR STOP_PLAYBACK = 2;
94 const static UCHAR STREAM_END = 3;
95 const static UCHAR ASPECT43 = 4;
96 const static UCHAR ASPECT169 = 5;
97 const static UCHAR PREBUFFERING = 6;
101 void threadPostStopCleanup() {};
104 bool subtitlesShowing;
105 MessageQueue* messageQueue;
106 void* messageReceiver;
107 OSDReceiver* osdReceiver;
112 DVBSubtitles* subtitles;
113 TeletextDecoderVBIEBU *teletext;
118 ChannelList* chanList;
120 queue<PLInstruction> instructions;
121 const static UCHAR I_SETCHANNEL = 1;
122 const static UCHAR I_STOP = 2;
124 queue<StreamChunk> streamChunks;
129 const static UCHAR S_STOP = 1;
130 const static UCHAR S_VIDEOSTARTUP = 2;
131 const static UCHAR S_PREBUFFERING = 3;
132 const static UCHAR S_PLAY = 4;
133 void switchState(UCHAR newState);
137 bool pendingAudioPlay;
141 const static int preBufferAmount = 3;
143 void clearStreamChunks();
144 void chunkToDemuxer();
145 void optimizeInstructionQueue();