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
25 setDimensions(190, 460);
26 setScreenPos(140, 170);
28 setBackgroundColour(0, 0, 100, 255);
30 setTitleBarColour(0, 0, 200, 255);
31 setTitleText("Welcome");
33 sl.setScreenPos(screenX + 20, screenY + 40);
34 sl.setDimensions(130, 170);
36 sl.addOption("1. Live TV", 1);
37 sl.addOption("2. Radio", 0);
38 sl.addOption("3. Recordings", 0);
39 sl.addOption("4. Stand by", 0);
40 sl.addOption("5. Reboot", 0);
42 jpeg.setScreenPos(screenX + 240, screenY + 50);
58 struct tm* tm = localtime(&t);
59 strftime(timeString, 19, "%H:%M", tm);
61 drawTextRJ(timeString, 450, 5, 255, 255, 255);
63 jpeg.init("/vdr.jpg");
67 int VWelcome::handleCommand(int command)
69 if (command == Remote::UP)
76 else if (command == Remote::DOWN)
83 else if (command == Remote::ONE)
88 else if (command == Remote::TWO)
93 else if (command == Remote::THREE)
98 else if (command == Remote::FOUR)
100 Message* m = new Message();
101 m->message = Message::STANDBY;
102 Command::getInstance()->postMessage(m);
105 else if (command == Remote::FIVE)
107 Command::getInstance()->doReboot();
109 else if (command == Remote::OK)
111 int option = sl.getCurrentOption();
117 else if (option == 1)
122 else if (option == 2)
127 else if (option == 3)
129 Message* m = new Message();
130 m->message = Message::STANDBY;
131 Command::getInstance()->postMessage(m);
134 else if (option == 4)
136 Command::getInstance()->doReboot();
145 void VWelcome::doChannelsList()
147 List* chanList = VDR::getInstance()->getChannelsList(VDR::VIDEO);
151 VChannelList* vchan = new VChannelList(VDR::VIDEO);
152 vchan->setList(chanList);
154 ViewMan::getInstance()->addNoLock(vchan);
158 // Message* m = new Message();
160 // m->to = ViewMan::getInstance();
161 // m->message = Message::SWAP_ME_FOR;
162 // m->parameter = (ULONG)vchan;
163 // ViewMan::getInstance()->postMessage(m);
167 void VWelcome::doRadioList()
169 List* chanList = VDR::getInstance()->getChannelsList(VDR::RADIO);
173 VChannelList* vchan = new VChannelList(VDR::RADIO);
174 vchan->setList(chanList);
176 ViewMan::getInstance()->addNoLock(vchan);
182 void VWelcome::doRecordingsList()
184 ViewMan* viewman = ViewMan::getInstance();
186 VInfo* viewWait = new VInfo();
187 viewWait->setDimensions(190, 460);
188 viewWait->setScreenPos(140, 170);
189 viewWait->setMainText("\n Downloading recordings list");
192 viewman->addNoLock(viewWait);
195 VDR* vdr = VDR::getInstance();
196 Directory* recDir = vdr->getRecordingsList();
200 VRecordingList* vrec = new VRecordingList();
201 vrec->setDir(recDir);
203 ViewMan::getInstance()->addNoLock(vrec);
209 Log::getInstance()->log("VWelcome", Log::DEBUG, "possible delay start");
210 viewman->removeView(viewWait, 1, 1);
211 Log::getInstance()->log("VWelcome", Log::DEBUG, "possible delay end");