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);
27 if (Osd::getInstance()->getScreenSize() == Osd::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(130, 170);
44 sl.addOption("1. Live TV", 1);
45 sl.addOption("2. Radio", 0);
46 sl.addOption("3. Recordings", 0);
47 sl.addOption("4. Stand by", 0);
48 sl.addOption("5. Reboot", 0);
50 jpeg.setScreenPos(screenX + 240, screenY + 50);
66 struct tm* tm = localtime(&t);
67 strftime(timeString, 19, "%H:%M", tm);
69 drawTextRJ(timeString, 450, 5, Colour::LIGHTTEXT);
71 jpeg.init("/vdr.jpg");
75 int VWelcome::handleCommand(int command)
77 if (command == Remote::UP)
84 else if (command == Remote::DOWN)
91 else if (command == Remote::ONE)
96 else if (command == Remote::TWO)
101 else if (command == Remote::THREE)
106 else if (command == Remote::FOUR)
108 Message* m = new Message();
109 m->message = Message::STANDBY;
110 Command::getInstance()->postMessage(m);
113 else if (command == Remote::FIVE)
115 Command::getInstance()->doReboot();
117 else if (command == Remote::OK)
119 int option = sl.getCurrentOption();
125 else if (option == 1)
130 else if (option == 2)
135 else if (option == 3)
137 Message* m = new Message();
138 m->message = Message::STANDBY;
139 Command::getInstance()->postMessage(m);
142 else if (option == 4)
144 Command::getInstance()->doReboot();
153 void VWelcome::doChannelsList()
155 List* chanList = VDR::getInstance()->getChannelsList(VDR::VIDEO);
159 VChannelList* vchan = new VChannelList(VDR::VIDEO);
160 vchan->setList(chanList);
162 ViewMan::getInstance()->addNoLock(vchan);
166 // Message* m = new Message();
168 // m->to = ViewMan::getInstance();
169 // m->message = Message::SWAP_ME_FOR;
170 // m->parameter = (ULONG)vchan;
171 // ViewMan::getInstance()->postMessage(m);
175 void VWelcome::doRadioList()
177 List* chanList = VDR::getInstance()->getChannelsList(VDR::RADIO);
181 VChannelList* vchan = new VChannelList(VDR::RADIO);
182 vchan->setList(chanList);
184 ViewMan::getInstance()->addNoLock(vchan);
190 void VWelcome::doRecordingsList()
192 ViewMan* viewman = ViewMan::getInstance();
194 VInfo* viewWait = new VInfo();
195 viewWait->setDimensions(190, 460);
196 if (Osd::getInstance()->getScreenSize() == Osd::PAL)
198 viewWait->setScreenPos(140, 170);
202 viewWait->setScreenPos(130, 140);
204 viewWait->setMainText("\n Downloading recordings list");
207 viewman->addNoLock(viewWait);
210 VDR* vdr = VDR::getInstance();
211 Directory* recDir = vdr->getRecordingsList();
215 VRecordingList* vrec = new VRecordingList();
216 vrec->setDir(recDir);
218 ViewMan::getInstance()->addNoLock(vrec);
224 Log::getInstance()->log("VWelcome", Log::DEBUG, "possible delay start");
225 viewman->removeView(viewWait, 1, 1);
226 Log::getInstance()->log("VWelcome", Log::DEBUG, "possible delay end");