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 "vchannelselect.h"
23 // this class only works as it does because the remote command
24 // values for the numbers are the numbers themselves !
26 VChannelSelect::VChannelSelect(VVideoLive* v, int command)
28 setDimensions(53, 30);
31 setBackgroundColour(Colour::VIEWBACKGROUND);
41 void VChannelSelect::draw()
53 sprintf(text, "%i", first);
54 drawText(text, 7, 5, Colour::LIGHTTEXT);
59 drawText("_", 7, 5, Colour::LIGHTTEXT);
68 sprintf(text, "%i", second);
69 drawText(text, 20, 5, Colour::LIGHTTEXT);
74 drawText("_", 20, 5, Colour::LIGHTTEXT);
83 sprintf(text, "%i", third);
84 drawText(text, 33, 5, Colour::LIGHTTEXT);
89 drawText("_", 33, 5, Colour::LIGHTTEXT);
95 int VChannelSelect::handleCommand(int command)
99 case Remote::ZERO ... Remote::NINE:
101 if (pos == 1) first = second;
108 Message* m = new Message();
110 m->to = ViewMan::getInstance();
111 m->message = Message::CLOSE_ME;
112 ViewMan::getInstance()->postMessage(m);
117 m->message = Message::CHANNEL_CHANGE;
118 m->parameter = (first * 100) + (second * 10) + third;
119 ViewMan::getInstance()->postMessage(m);
127 // allow command to drop through to other views