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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include "vvideolive.h"
23 VVideoLive::VVideoLive(List* tchanList)
25 player = new Player(NULL);
27 vdr = VDR::getInstance();
31 setDimensions(SCREENHEIGHT, SCREENWIDTH);
32 Colour transparent(0, 0, 0, 0);
33 setBackgroundColour(transparent);
36 VVideoLive::~VVideoLive()
41 void VVideoLive::draw()
46 int VVideoLive::handleCommand(int command)
52 player->play(); // do resync
70 vdr->streamChannel(currentChannel);
80 vdr->streamChannel(currentChannel);
90 case Remote::ZERO ... Remote::NINE:
92 VChannelSelect* v = new VChannelSelect(this, command);
93 ViewMan::getInstance()->addNoLock(v);
94 // ViewMan::getInstance()->timedDelete(v, 4, 0);
103 void VVideoLive::processMessage(Message* m)
105 if (m->message == Message::CHANNEL_CHANGE)
107 // check channel number is valid
109 for(chanList->reset(); (channel = (Channel*)chanList->getCurrent()); chanList->next())
111 if (channel->number == m->parameter)
114 vdr->stopStreaming();
115 setChannel(channel->number);
121 void VVideoLive::doBanner()
123 VLiveBanner* v = new VLiveBanner();
124 ViewMan::getInstance()->addNoLock(v);
125 ViewMan::getInstance()->timedDelete(v, 4, 0);
130 void VVideoLive::setChannel(int number)
132 currentChannel = number;
134 vdr->streamChannel(currentChannel);
138 void VVideoLive::upChannel()
141 for(chanList->reset(); (channel = (Channel*)chanList->getCurrent()); chanList->next())
143 if (channel->number == currentChannel)
146 channel = (Channel*)chanList->getCurrent();
147 if (!channel) return;
148 currentChannel = channel->number;
153 void VVideoLive::downChannel()
156 Channel* prevChannel = NULL;
157 for(chanList->reset(); (channel = (Channel*)chanList->getCurrent()); chanList->next())
159 if (channel->number == currentChannel)
161 if (!prevChannel) return;
162 currentChannel = prevChannel->number;
164 prevChannel = channel;