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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #include <linux/errno.h>
28 #include "remotewin.h"
32 #include "remoteandroid.h"
41 #include "vserverselect.h"
47 #include "timerreceiver.h"
57 #include "vsleeptimer.h"
60 Command* Command::instance = NULL;
72 wallpaper = wallpaper_pict = NULL;
80 Command* Command::getInstance()
85 int Command::init(bool tcrashed, char* tServer)
87 if (initted) return 0;
92 logger = Log::getInstance();
93 boxstack = BoxStack::getInstance();
94 remote = Remote::getInstance();
96 remote->InitHWCListwithDefaults();
98 if (!logger || !boxstack || !remote)
104 SkinFactory::InitSkin(0);
107 pthread_mutex_init(&masterLock, NULL);
109 masterLock=CreateMutex(NULL,FALSE,NULL);
115 int Command::shutdown()
117 if (!initted) return 0;
124 // VDR::getInstance()->cancelFindingServer();
125 logger->log("Command", Log::NOTICE, "Command stop1...");
128 logger->log("Command", Log::NOTICE, "Command stop2...");
132 void Command::doWallpaper()
134 Video* video = Video::getInstance();
137 Boxx* bbg = new Boxx();
138 bbg->setSize(video->getScreenWidth(), video->getScreenHeight());
140 bbg->fillColour(DrawStyle::WALLPAPER);
142 boxstack->update(bbg);
143 boxstack->remove(bbg);
146 wallpaper = new Boxx();
147 wallpaper->setSize(video->getScreenWidth(), video->getScreenHeight());
148 wallpaper->createBuffer();
149 wallpaper ->setBackgroundColour(DrawStyle::WALLPAPER);
154 wallpaper_pict = new WJpegTYPE();
155 wallpaper_pict->setSize(video->getScreenWidth(), video->getScreenHeight());
158 if (video->getFormat() == Video::PAL)
160 logger->log("Command", Log::DEBUG, "PAL wallpaper selected");
162 wallpaper_pict->init("/wallpaperPAL.jpg");
164 wallpaper_pict->init("wallpaperPAL.jpg");
169 logger->log("Command", Log::DEBUG, "NTSC wallpaper selected");
170 wallpaper_pict->init("/wallpaperNTSC.jpg");
172 if (DrawStyle::WALLPAPER.alpha) {
173 wallpaper_pict->setVisible(true);
175 wallpaper_pict->setVisible(false);
177 wallpaper->add(wallpaper_pict);
180 boxstack->add(wallpaper);
181 boxstack->update(wallpaper);
189 if (!initted) return;
196 Video::getInstance()->signalOn();
197 Led::getInstance()->on();
201 // End of startup. Lock the mutex and put the first view up
202 // logger->log("Command", Log::DEBUG, "WANT LOCK");
204 pthread_mutex_lock(&masterLock);
206 WaitForSingleObject(masterLock, INFINITE );
208 //logger->log("Command", Log::DEBUG, "LOCKED");
216 VConnect* vconnect = new VConnect(server);
217 boxstack->add(vconnect);
221 // Start method 2 of getting commands in...
228 //logger->log("Command", Log::DEBUG, "UNLOCK");
230 pthread_mutex_unlock(&masterLock);
232 ReleaseMutex(masterLock);
235 button = remote->getButtonPress(2); // FIXME why is this set to 2 and not 0? so it can quit
236 // something happened, lock and process
238 // logger->log("Command", Log::DEBUG, "WANT LOCK");
240 pthread_mutex_lock(&masterLock);
242 WaitForSingleObject(masterLock, INFINITE );
244 // logger->log("Command", Log::DEBUG, "LOCK");
246 if ((button == Remote::NA_NONE) /*|| (button == Remote::NA_UNKNOWN)*/) continue;
248 if (button != Remote::NA_SIGNAL) handleCommand(button);
249 processMessageQueue();
253 //logger->log("Command", Log::DEBUG, "UNLOCK");
255 pthread_mutex_unlock(&masterLock);
257 ReleaseMutex(masterLock);
263 void Command::postMessage(Message* m)
265 // This is locked here in case the main loop is not waiting for an event, but is processing one
266 // it could be killed but then not react to it because the signal wouldn't cause
267 // remote->getButtonPress to break
268 // locking the mutex ensures that the master thread is waiting on getButtonPress
271 //logger->log("Command", Log::DEBUG, "WANT LOCK");
273 pthread_mutex_lock(&masterLock);
275 WaitForSingleObject(masterLock, INFINITE );
277 //logger->log("Command", Log::DEBUG, "LOCK");
278 MessageQueue::postMessage(m);
282 kill(mainPid, SIGURG);
284 ((RemoteAndroid*)Remote::getInstance())->Signal();
286 pthread_mutex_unlock(&masterLock);
288 ((RemoteWin*)Remote::getInstance())->Signal();
289 ReleaseMutex(masterLock);
291 //logger->log("Command", Log::DEBUG, "UNLOCK");
294 void Command::postMessageNoLock(Message* m)
296 // As above but use this one if this message is being posted because of a button press
297 // the mutex is already locked, locking around postMessage is not needed as the
298 // queue is guaranteed to be run when the button has been processed
299 MessageQueue::postMessage(m);
302 bool Command::postMessageIfNotBusy(Message* m)
304 // Used for Windows mouse events
306 //logger->log("Command", Log::DEBUG, "TRY LOCK");
308 if (pthread_mutex_trylock(&masterLock) != EBUSY)
310 //logger->log("Command", Log::DEBUG, "LOCK");
311 MessageQueue::postMessage(m);
313 kill(mainPid, SIGURG);
315 ((RemoteAndroid*)Remote::getInstance())->Signal();
317 pthread_mutex_unlock(&masterLock);
318 //logger->log("Command", Log::DEBUG, "UNLOCK");
326 switch (WaitForSingleObject(masterLock, 0 ))
327 { //FIXME this is not "if not busy" check
328 case WAIT_OBJECT_0: //but with proper argument 0 this did not work
329 // case WAIT_ABANDONED:
330 MessageQueue::postMessage(m);
331 ((RemoteWin*)Remote::getInstance())->Signal();
332 ReleaseMutex(masterLock);
335 case WAIT_ABANDONED: return false;
336 case WAIT_TIMEOUT: return false;
342 void Command::postMessageFromOuterSpace(Message* m)
345 Yet another way of getting messages into Command. This one is for events that
346 are not standard button presses (or UDP generated buttons). It is also not for
347 events that are generated as a result of other events (events that can safely
348 call postMessageNoLock and be guaranteed that the message will be processed
349 because it is known that the queue is currently being processed).
350 This is for events that come from outer space and can occur when the master
351 mutex is locked or not, they need to be queued and executed but it doesn't
353 Actually so far it is for events caused by the video stream - aspect ratio
354 changes. These can occur when the master mutex is locked and so postMessage
355 doesn't work. postMessageNoLock doesn't work because if the mutex *isn't*
356 locked at the time then the message could be sat around a while before
358 The whole message system was at first supposed to prevent the problem of
359 calling a function on an object that had just been deleted, by ordering
360 messages such that all calls are done before object deletion. However,
361 because of the new centralised messaging system and the fact that BoxStack
362 locates the destination object before calling it, the messaging system now
363 allows the kind of sloppy calls it was supposed to stop. Weird huh. This
364 is mentioned here because the video stream might generate an event just as
365 the user hits stop. The mutex is locked, and by the time the message
366 is examined the vvideorec/live has been deleted. This doesn't matter because
367 boxstack will drop the message if it can't find the matching object to
369 Finally, all this is fine and dandy, except that I'm not 100% sure that
370 this sloppy postMessage and hope a queued signal will force it to be processed
371 thingy will actually work. Hmmm.
372 Lastly <g>, I will consider making the naming system a little more sane
376 logger->log("Command", Log::DEBUG, "PMFOS called");
377 MessageQueue::postMessage(m);
381 kill(mainPid, SIGURG);
383 ((RemoteAndroid*)Remote::getInstance())->Signal();
386 ((RemoteWin*)Remote::getInstance())->Signal();
390 void Command::processMessage(Message* m)
392 // FIXME - a slight modification - how if messagereceivers were to register
393 // themselves as receivers to avoid the calling-a-deleted-object problem
394 // then only deliver/register/unregister would have to be protected
396 logger->log("Command", Log::DEBUG, "processing message %i", m->message);
404 case Message::STOP_PLAYBACK:
406 handleCommand(Remote::STOP); // an odd way of doing it, but so simple
409 // Also connection_lost comes from player - anywhere else?
413 case Message::VDR_CONNECTED:
415 doJustConnected((VConnect*)m->from);
418 case Message::SCREENSHOT:
420 #ifdef VOMP_PLATTFORM_MVP
421 Osd::getInstance()->screenShot("/out.jpg");
423 logger->log("Osd", Log::NOTICE, "Screenshot Message arrived");
424 Osd::getInstance()->screenShot("out.jpg");
428 case Message::CONNECTION_LOST:
433 case Message::UDP_BUTTON:
435 handleCommand(m->parameter);
438 case Message::CHANGE_LANGUAGE:
440 boxstack->removeAll();
441 boxstack->update(wallpaper);
443 if (!VDR::getInstance()->isConnected()) { connectionLost(); break; }
444 VWelcome* vw = new VWelcome();
447 boxstack->update(vw);
450 case Message::LAST_VIEW_CLOSE:
452 // Shouldn't be done like this. Some generic message pass back from vinfo perhaps
459 // VWelcome* vw = new VWelcome();
461 // boxstack->add(vw);
462 // boxstack->update(vw);
466 case Message::NEW_PICTURE:
468 Log::getInstance()->log("Command", Log::DEBUG, "TVMedia NEW_PICTURE");
469 OsdVector *osdv=dynamic_cast<OsdVector*>(Osd::getInstance());
471 osdv->informPicture(m->tag,m->parameter);
475 case Message::NEW_PICTURE_STATIC:
477 OsdVector *osdv=dynamic_cast<OsdVector*>(Osd::getInstance());
479 osdv->informPicture(((long long)m->tag)<<32LL,m->parameter);
489 Instead of sending through the boxstack, implement a more generic MessageReceiver interface
490 and have potential receivers register with something
491 When a message needs to be delivered, check if the receiver is still registered, if so, deliver the message
492 This could all be done using the existing big command mutex to keep it simple
495 logger->log("Command", Log::DEBUG, "Sending message to boxstack");
496 boxstack->processMessage(m);
500 void Command::handleCommand(int button)
502 if (isStandby && (button != Remote::POWER)
503 && (button != Remote::POWERON) && (button != Remote::POWEROFF)) return;
504 if (!connLost && boxstack->handleCommand(button)) return; // don't send to boxstack if connLost
506 // command was not handled
510 case Remote::DF_LEFT:
511 case Remote::DF_RIGHT:
512 case Remote::VOLUMEUP:
513 case Remote::VOLUMEDOWN:
515 if (remote->handlesVolume()) {
516 if (button==Remote::DF_LEFT || button==Remote::VOLUMEDOWN)
517 remote->volumeDown();
518 else remote->volumeUp();
520 VVolume* v = new VVolume();
522 v->handleCommand(button); // this will draw+show
528 if (remote->handlesVolume()) {
529 remote->volumeMute();
531 VMute* v = new VMute();
543 case Remote::POWERON:
548 case Remote::POWEROFF:
556 if (!connLost) return; // if connLost, handle Remote::OK
562 VSleeptimer* sleep = new VSleeptimer();
563 boxstack->add(sleep);
564 sleep->handleCommand(button); // this will draw+show
573 Message* m = new Message(); // break into master mutex
574 m->message = Message::SCREENSHOT;
580 void Command::doStandby()
593 void Command::doPowerOn()
597 Video::getInstance()->signalOn();
598 Led::getInstance()->on();
599 Remote::getInstance()->changePowerState(true);
603 VConnect* vconnect = new VConnect(server);
604 boxstack->add(vconnect);
609 void Command::doPowerOff()
613 VDR::getInstance()->shutdownVDR();
614 boxstack->removeAll();
615 Video::getInstance()->signalOff();
616 boxstack->update(wallpaper);
618 VDR::getInstance()->configSave("General", "Last Power State", "Off");
619 logger->unsetExternLogger();
620 VDR::getInstance()->disconnect();
621 Led::getInstance()->off();
622 Remote::getInstance()->changePowerState(false);
624 Sleeptimer::getInstance()->shutdown();
626 stop(); //different behavoiur on windows, we exit
631 void Command::doFromTheTop(bool which)
633 if (isStandby) return;
638 logger->log("Command", Log::NOTICE, "Connection lost dialog already present");
642 logger->log("Command", Log::NOTICE, "Doing connection lost dialog");
643 connLost = new VInfo();
644 connLost->setSize(360, 200);
645 connLost->createBuffer();
646 if (Video::getInstance()->getFormat() == Video::PAL)
647 connLost->setPosition(190, 170);
649 connLost->setPosition(180, 120);
650 connLost->setOneLiner(tr("Connection lost"));
651 connLost->setDropThrough();
652 connLost->setBorderOn(1);
653 connLost->setTitleBarColour(DrawStyle::DANGER);
654 connLost->okButton();
656 boxstack->add(connLost);
657 boxstack->update(connLost);
658 remote->clearBuffer();
662 logger->unsetExternLogger();
663 VDR::getInstance()->disconnect();
664 boxstack->removeAll();
665 boxstack->update(wallpaper);
669 remote->clearBuffer();
671 // at this point, everything should be reset to first-go
673 VConnect* vconnect = new VConnect(server);
674 boxstack->add(vconnect);
679 void Command::doReboot()
682 logger->unsetExternLogger();
683 VDR::getInstance()->disconnect();
685 logger->log("Command", Log::NOTICE, "Reboot");
687 #ifndef VOMP_HAS_EXIT
688 // some plattforms, want a proper deinitialisation of their hardware before reboot
689 Osd::getInstance()->shutdown();
690 Audio::getInstance()->shutdown();
691 Video::getInstance()->shutdown();
692 Remote::getInstance()->shutdown();
694 reboot(LINUX_REBOOT_CMD_RESTART);
695 // if reboot is not allowed -> stop
707 #endif //Would we support this on windows?
710 void Command::connectionLost()
712 logger->unsetExternLogger();
713 Message* m = new Message(); // break into master mutex
714 m->message = Message::CONNECTION_LOST;
716 postMessageFromOuterSpace(m);
719 void Command::buildCrashedBox()
721 VInfo* crash = new VInfo();
722 crash->setSize(360, 250);
723 crash->createBuffer();
724 if (Video::getInstance()->getFormat() == Video::PAL)
725 crash->setPosition(190, 146);
727 crash->setPosition(180, 96);
728 crash->setMainText("Oops, vomp crashed.. :(\nPlease report this crash to the author, with as much detail as possible about what you were doing at the time that might have caused the crash.");
729 crash->setBorderOn(1);
730 crash->setTitleBarColour(DrawStyle::DANGER);
732 crash->setExitable();
734 boxstack->add(crash);
735 boxstack->update(crash);
738 void Command::doJustConnected(VConnect* vconnect)
741 if (!VDR::getInstance()->isConnected()) { connectionLost(); return; }
742 logger->log("Command", Log::INFO, "Entering doJustConnected");
744 Video* video = Video::getInstance();
745 Audio* audio = Audio::getInstance();
746 boxstack->remove(vconnect);
748 VInfo* vi = new VInfo();
749 vi->setSize(400, 200);
751 if (video->getFormat() == Video::PAL)
752 vi->setPosition(170, 200);
754 vi->setPosition(160, 150);
755 vi->setOneLiner(tr("Connected, loading config"));
758 boxstack->update(vi);
760 VDR* vdr = VDR::getInstance();
763 // See if we're supposed to do network logging
764 config = vdr->configLoad("Advanced", "Network logging");
765 if (config && !STRCASECMP(config, "On"))
767 logger->log("Command", Log::INFO, "Turning on network logging");
768 logger->setExternLogger(vdr);
772 logger->unsetExternLogger();
773 logger->log("Command", Log::INFO, "Turned off network logging");
775 if (config) delete[] config;
777 config = vdr->configLoad("Advanced", "Skin Name");
779 const char **skinnames=SkinFactory::getSkinNames();
780 for (int i=0;i<SkinFactory::getNumberofSkins();i++) {
781 if (!STRCASECMP(config, skinnames[i])) {
782 SkinFactory::InitSkin(i);
787 if (wallpaper && wallpaper_pict) {
788 if (DrawStyle::WALLPAPER.alpha) {
789 wallpaper_pict->setVisible(true);
791 wallpaper_pict->setVisible(false);
794 boxstack->update(wallpaper);
798 SkinFactory::InitSkin(0);
801 // See if config says to override video format (PAL/NTSC)
802 config = vdr->configLoad("General", "Override Video Format");
805 logger->log("Command", Log::DEBUG, "Override Video Format is present");
807 if ( (!strcmp(config, "PAL") && (video->getFormat() != Video::PAL))
808 || (!strcmp(config, "NTSC") && (video->getFormat() != Video::NTSC))
809 || (!strcmp(config, "PAL_M") && (video->getFormat() != Video::PAL_M))
810 || (!strcmp(config, "NTSC_J") && (video->getFormat() != Video::NTSC_J))
813 // Oh sheesh, need to switch format. Bye bye TV...
815 // Take everything down
816 boxstack->removeAll();
817 boxstack->remove(wallpaper);
818 Osd* osd = Osd::getInstance();
824 remote->shutdown(); // need on raspberry shut not do any harm, hopefully
825 remote->init(RemoteStartDev);
827 // Get video and osd back up with the new mode
828 if (!strcmp(config, "PAL"))
830 logger->log("Command", Log::DEBUG, "Switching to PAL");
831 video->init(Video::PAL);
833 else if (!strcmp(config, "NTSC"))
835 logger->log("Command", Log::DEBUG, "Switching to NTSC");
836 video->init(Video::NTSC);
837 } else if (!strcmp(config, "PAL_M"))
839 logger->log("Command", Log::DEBUG, "Switching to PAL_M");
840 video->init(Video::PAL_M);
841 } else if (!strcmp(config, "NTSC_J"))
843 logger->log("Command", Log::DEBUG, "Switching to NTSC_J");
844 video->init(Video::NTSC_J);
849 //we do not init twice
850 osd->init((char*)("/dev/stbgfx"));
853 // Put the wallpaper back
858 vi->setSize(400, 200);
860 if (video->getFormat() == Video::PAL)
861 vi->setPosition(170, 200);
863 vi->setPosition(160, 150);
865 vi->setOneLiner(tr("Connected, loading config"));
868 boxstack->update(vi);
872 logger->log("Command", Log::DEBUG, "Already in requested mode, or request was not 'PAL' or 'NTSC'");
877 logger->log("Command", Log::DEBUG, "Phew, no dangerous on-the-fly mode switching to do!");
880 // Power off if first boot and config says so
885 logger->log("Command", Log::DEBUG, "Load power after boot");
887 config = vdr->configLoad("General", "Power After Boot");
891 if (!STRCASECMP(config, "On"))
893 logger->log("Command", Log::INFO, "Config says Power After Boot = On");
895 else if (!STRCASECMP(config, "Off"))
897 logger->log("Command", Log::INFO, "Config says Power After Boot = Off");
902 else if (!STRCASECMP(config, "Last state"))
904 char* lastPowerState = vdr->configLoad("General", "Last Power State");
907 if (!STRCASECMP(lastPowerState, "On"))
909 logger->log("Command", Log::INFO, "Config says Last Power State = On");
911 else if (!STRCASECMP(lastPowerState, "Off"))
913 logger->log("Command", Log::INFO, "Config says Last Power State = Off");
920 logger->log("Command", Log::INFO, "Config General/Last Power State not understood");
925 logger->log("Command", Log::INFO, "Config General/Last Power State not found");
930 logger->log("Command", Log::INFO, "Config/Power After Boot not understood");
936 logger->log("Command", Log::INFO, "Config General/Power After Boot not found");
941 // Go S-Video if config says so
943 config = vdr->configLoad("TV", "Connection");
947 if (!STRCASECMP(config, "S-Video"))
949 logger->log("Command", Log::INFO, "Switching to S-Video as Connection=%s", config);
950 video->setConnection(Video::SVIDEO);
951 } else if (!STRCASECMP(config, "HDMI"))
953 logger->log("Command", Log::INFO, "Switching to HDMI as Connection=%s", config);
954 video->setConnection(Video::HDMI);
955 } else if (!STRCASECMP(config, "HDMI3D"))
957 logger->log("Command", Log::INFO, "Switching to HDMI3D as Connection=%s", config);
958 video->setConnection(Video::HDMI3D);
962 logger->log("Command", Log::INFO, "Switching to RGB/Composite as Connection=%s", config);
963 video->setConnection(Video::COMPOSITERGB);
969 logger->log("Command", Log::INFO, "Config TV/S-Video not found");
972 // Set to shutdown VDR if config says
974 config = vdr->configLoad("General", "VDR shutdown");
977 if (!STRCASECMP(config, "On"))
979 logger->log("Command", Log::INFO, "Shutdown VDR when shutting down vomp");
980 vdr->setVDRShutdown(true);
982 else if (!STRCASECMP(config, "Off"))
984 logger->log("Command", Log::INFO, "Shutdown only vomp");
985 vdr->setVDRShutdown(false);
990 logger->log("Command", Log::INFO, "Default shutdown only vomp");
991 vdr->setVDRShutdown(false); // Default
996 config = vdr->configLoad("General", "Remote type");
1000 if (!STRCASECMP(config, "New"))
1002 logger->log("Command", Log::INFO, "Switching to New remote type");
1003 remote->setRemoteType(Remote::NEWREMOTE);
1007 logger->log("Command", Log::INFO, "Switching to Old remote type");
1008 remote->setRemoteType(Remote::OLDREMOTE);
1014 logger->log("Command", Log::INFO, "Config General/Remote type not found");
1015 remote->setRemoteType(Remote::OLDREMOTE);
1020 // Get TV aspect ratio
1022 config = vdr->configLoad("TV", "Aspect");
1025 if (!STRCASECMP(config, "16:9"))
1027 logger->log("Command", Log::INFO, "/// Switching to TV aspect 16:9");
1028 video->setTVsize(Video::ASPECT16X9);
1032 logger->log("Command", Log::INFO, "/// Switching to TV aspect 4:3");
1033 video->setTVsize(Video::ASPECT4X3);
1039 logger->log("Command", Log::INFO, "Config TV/Aspect type not found, going 4:3");
1040 video->setTVsize(Video::ASPECT4X3);
1043 config = vdr->configLoad("TV", "Widemode");
1046 if (!STRCASECMP(config, "Letterbox"))
1048 logger->log("Command", Log::INFO, "Setting letterbox mode");
1049 video->setMode(Video::LETTERBOX);
1053 logger->log("Command", Log::INFO, "Setting chop-sides mode");
1054 video->setMode(Video::NORMAL);
1061 logger->log("Command", Log::INFO, "Config TV/Widemode not found, Setting letterbox mode");
1062 video->setMode(Video::LETTERBOX);
1064 logger->log("Command", Log::INFO, "Config TV/Widemode not found, Setting chop-sides mode");
1065 video->setMode(Video::NORMAL);
1069 config = vdr->configLoad("Advanced", "TCP receive window");
1072 size_t newTCPsize = atoi(config);
1075 logger->log("Command", Log::INFO, "Setting TCP window size %i", newTCPsize);
1076 vdr->setReceiveWindow(newTCPsize);
1080 logger->log("Command", Log::INFO, "TCP window size not found, setting 2048");
1081 if (DEFAULT_TCP_WINDOWSIZE) vdr->setReceiveWindow(2048); // Default
1084 config = vdr->configLoad("Advanced", "Font Name");
1087 Osd::getInstance()->setFont(config);
1088 logger->log("Command", Log::INFO, "Setting Font to %s", config);
1094 // Set recording list type
1097 #ifdef ADVANCED_MENUES
1098 config = vdr->configLoad("Advanced", "Menu type");
1102 if (!STRCASECMP(config, "Advanced"))
1104 logger->log("Command", Log::INFO, "Switching to Advanced menu");
1110 logger->log("Command", Log::INFO, "Switching to Classic menu");
1117 logger->log("Command", Log::INFO, "Config General/menu type not found");
1122 config = vdr->configLoad("Advanced", "Disable WOL");
1125 if (!STRCASECMP(config, "Yes"))
1127 logger->log("Command", Log::INFO, "Config says disable WOL");
1128 Wol::getInstance()->setEnabled(false);
1132 logger->log("Command", Log::INFO, "Config says enable WOL");
1133 Wol::getInstance()->setEnabled(true);
1140 logger->log("Command", Log::INFO, "By default, enable WOL");
1141 Wol::getInstance()->setEnabled(true);
1143 /* device dependend config */
1144 audio->loadOptionsfromServer(vdr);
1145 video->loadOptionsfromServer(vdr);
1146 remote->loadOptionsfromServer(vdr);
1148 video->executePendingModeChanges();
1151 // Save power state = on
1153 vdr->configSave("General", "Last Power State", "On");
1155 // Make sure connection didn't die
1156 if (!vdr->isConnected())
1158 Command::getInstance()->connectionLost();
1162 boxstack->remove(vi);
1164 VWelcome* vw = new VWelcome();
1167 boxstack->update(vw);
1169 // Enter pre-keys here
1170 // handleCommand(Remote::OK);
1171 // handleCommand(Remote::THREE);
1172 // handleCommand(Remote::SIX);
1173 // handleCommand(Remote::OK);
1174 // handleCommand(Remote::UP);
1175 // handleCommand(Remote::PLAY);
1176 // handleCommand(Remote::DOWN);
1177 // handleCommand(Remote::DOWN);
1178 // handleCommand(Remote::DOWN);
1179 // handleCommand(Remote::OK);
1180 // handleCommand(Remote::RED);