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 "vradiolive.h"
23 VRadioLive::VRadioLive(List* tchanList)
25 player = new PlayerRadio();
27 vdr = VDR::getInstance();
31 setDimensions(100, 100);
32 setBackgroundColour(Colour::VIEWBACKGROUND);
35 VRadioLive::~VRadioLive()
40 void VRadioLive::draw()
45 int VRadioLive::handleCommand(int command)
62 vdr->streamChannel(currentChannel);
71 vdr->streamChannel(currentChannel);
80 void VRadioLive::setChannel(int number)
82 currentChannel = number;
83 vdr->streamChannel(currentChannel);
87 void VRadioLive::upChannel()
90 for(chanList->reset(); (channel = (Channel*)chanList->getCurrent()); chanList->next())
92 if (channel->number == currentChannel)
95 channel = (Channel*)chanList->getCurrent();
97 currentChannel = channel->number;
102 void VRadioLive::downChannel()
105 Channel* prevChannel = NULL;
106 for(chanList->reset(); (channel = (Channel*)chanList->getCurrent()); chanList->next())
108 if (channel->number == currentChannel)
110 if (!prevChannel) return;
111 currentChannel = prevChannel->number;
113 prevChannel = channel;