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(200, 460);
27 if (Video::getInstance()->getFormat() == Video::PAL)
29 setScreenPos(140, 170);
33 setScreenPos(130, 140);
36 setBackgroundColour(Colour::VIEWBACKGROUND);
38 setTitleBarColour(Colour::TITLEBARBACKGROUND);
39 setTitleText("Welcome");
41 sl.setScreenPos(screenX + 20, screenY + 40);
42 sl.setDimensions(140, 170);
44 sl.addOption("1. Live TV", 1);
45 sl.addOption("2. Radio", 0);
46 sl.addOption("3. Recordings", 0);
47 sl.addOption("4. Options", 0);
48 sl.addOption("5. Stand by", 0);
49 sl.addOption("6. Reboot", 0);
51 jpeg.setScreenPos(screenX + 240, screenY + 60);
67 struct tm* tm = localtime(&t);
68 strftime(timeString, 19, "%H:%M", tm);
70 drawTextRJ(timeString, 450, 5, Colour::LIGHTTEXT);
72 jpeg.init("/vdr.jpg");
76 int VWelcome::handleCommand(int command)
118 Message* m = new Message();
119 m->message = Message::STANDBY;
120 Command::getInstance()->postMessage(m);
125 Command::getInstance()->doReboot();
129 int option = sl.getCurrentOption();
135 else if (option == 1)
140 else if (option == 2)
145 else if (option == 3)
150 else if (option == 4)
152 Message* m = new Message();
153 m->message = Message::STANDBY;
154 Command::getInstance()->postMessage(m);
157 else if (option == 5)
159 Command::getInstance()->doReboot();
162 return 2; // never gets here
170 void VWelcome::doChannelsList()
172 List* chanList = VDR::getInstance()->getChannelsList(VDR::VIDEO);
176 VChannelList* vchan = new VChannelList(VDR::VIDEO);
177 vchan->setList(chanList);
179 ViewMan::getInstance()->addNoLock(vchan);
183 // Message* m = new Message();
185 // m->to = ViewMan::getInstance();
186 // m->message = Message::SWAP_ME_FOR;
187 // m->parameter = (ULONG)vchan;
188 // ViewMan::getInstance()->postMessage(m);
192 void VWelcome::doRadioList()
194 List* chanList = VDR::getInstance()->getChannelsList(VDR::RADIO);
198 VChannelList* vchan = new VChannelList(VDR::RADIO);
199 vchan->setList(chanList);
201 ViewMan::getInstance()->addNoLock(vchan);
207 void VWelcome::doRecordingsList()
209 ViewMan* viewman = ViewMan::getInstance();
211 VInfo* viewWait = new VInfo();
212 viewWait->setDimensions(190, 460);
213 if (Video::getInstance()->getFormat() == Video::PAL)
215 viewWait->setScreenPos(140, 170);
219 viewWait->setScreenPos(130, 140);
221 viewWait->setMainText("\n Downloading recordings list");
224 viewman->addNoLock(viewWait);
227 VDR* vdr = VDR::getInstance();
228 Directory* recDir = vdr->getRecordingsList();
232 VRecordingList* vrec = new VRecordingList(NULL);
233 vrec->setDir(recDir);
235 ViewMan::getInstance()->addNoLock(vrec);
241 Log::getInstance()->log("VWelcome", Log::DEBUG, "possible delay start");
242 viewman->removeView(viewWait, 1, 1);
243 Log::getInstance()->log("VWelcome", Log::DEBUG, "possible delay end");
246 void VWelcome::doOptions()
248 VOptions* voptions = new VOptions();
249 ViewMan::getInstance()->addNoLock(voptions);