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 Osd::getInstance()->screenShot("/out.jpg");
423 case Message::CONNECTION_LOST:
428 case Message::UDP_BUTTON:
430 handleCommand(m->parameter);
433 case Message::CHANGE_LANGUAGE:
435 boxstack->removeAll();
436 boxstack->update(wallpaper);
438 if (!VDR::getInstance()->isConnected()) { connectionLost(); break; }
439 VWelcome* vw = new VWelcome();
442 boxstack->update(vw);
445 case Message::LAST_VIEW_CLOSE:
447 // Shouldn't be done like this. Some generic message pass back from vinfo perhaps
454 // VWelcome* vw = new VWelcome();
456 // boxstack->add(vw);
457 // boxstack->update(vw);
461 case Message::NEW_PICTURE:
463 Log::getInstance()->log("Command", Log::DEBUG, "TVMedia NEW_PICTURE");
464 OsdVector *osdv=dynamic_cast<OsdVector*>(Osd::getInstance());
466 osdv->informPicture(m->tag,m->parameter);
470 case Message::NEW_PICTURE_STATIC:
472 OsdVector *osdv=dynamic_cast<OsdVector*>(Osd::getInstance());
474 osdv->informPicture(((long long)m->tag)<<32LL,m->parameter);
484 Instead of sending through the boxstack, implement a more generic MessageReceiver interface
485 and have potential receivers register with something
486 When a message needs to be delivered, check if the receiver is still registered, if so, deliver the message
487 This could all be done using the existing big command mutex to keep it simple
490 logger->log("Command", Log::DEBUG, "Sending message to boxstack");
491 boxstack->processMessage(m);
495 void Command::handleCommand(int button)
497 if (isStandby && (button != Remote::POWER)
498 && (button != Remote::POWERON) && (button != Remote::POWEROFF)) return;
499 if (!connLost && boxstack->handleCommand(button)) return; // don't send to boxstack if connLost
501 // command was not handled
505 case Remote::DF_LEFT:
506 case Remote::DF_RIGHT:
507 case Remote::VOLUMEUP:
508 case Remote::VOLUMEDOWN:
510 if (remote->handlesVolume()) {
511 if (button==Remote::DF_LEFT || button==Remote::VOLUMEDOWN)
512 remote->volumeDown();
513 else remote->volumeUp();
515 VVolume* v = new VVolume();
517 v->handleCommand(button); // this will draw+show
523 if (remote->handlesVolume()) {
524 remote->volumeMute();
526 VMute* v = new VMute();
538 case Remote::POWERON:
543 case Remote::POWEROFF:
551 if (!connLost) return; // if connLost, handle Remote::OK
557 VSleeptimer* sleep = new VSleeptimer();
558 boxstack->add(sleep);
559 sleep->handleCommand(button); // this will draw+show
568 Message* m = new Message(); // break into master mutex
569 m->message = Message::SCREENSHOT;
575 void Command::doStandby()
588 void Command::doPowerOn()
592 Video::getInstance()->signalOn();
593 Led::getInstance()->on();
594 Remote::getInstance()->changePowerState(true);
598 VConnect* vconnect = new VConnect(server);
599 boxstack->add(vconnect);
604 void Command::doPowerOff()
608 VDR::getInstance()->shutdownVDR();
609 boxstack->removeAll();
610 Video::getInstance()->signalOff();
611 boxstack->update(wallpaper);
613 VDR::getInstance()->configSave("General", "Last Power State", "Off");
614 logger->unsetExternLogger();
615 VDR::getInstance()->disconnect();
616 Led::getInstance()->off();
617 Remote::getInstance()->changePowerState(false);
619 Sleeptimer::getInstance()->shutdown();
621 stop(); //different behavoiur on windows, we exit
626 void Command::doFromTheTop(bool which)
628 if (isStandby) return;
633 logger->log("Command", Log::NOTICE, "Connection lost dialog already present");
637 logger->log("Command", Log::NOTICE, "Doing connection lost dialog");
638 connLost = new VInfo();
639 connLost->setSize(360, 200);
640 connLost->createBuffer();
641 if (Video::getInstance()->getFormat() == Video::PAL)
642 connLost->setPosition(190, 170);
644 connLost->setPosition(180, 120);
645 connLost->setOneLiner(tr("Connection lost"));
646 connLost->setDropThrough();
647 connLost->setBorderOn(1);
648 connLost->setTitleBarColour(DrawStyle::DANGER);
649 connLost->okButton();
651 boxstack->add(connLost);
652 boxstack->update(connLost);
653 remote->clearBuffer();
657 logger->unsetExternLogger();
658 VDR::getInstance()->disconnect();
659 boxstack->removeAll();
660 boxstack->update(wallpaper);
664 remote->clearBuffer();
666 // at this point, everything should be reset to first-go
668 VConnect* vconnect = new VConnect(server);
669 boxstack->add(vconnect);
674 void Command::doReboot()
677 logger->unsetExternLogger();
678 VDR::getInstance()->disconnect();
680 logger->log("Command", Log::NOTICE, "Reboot");
682 #ifndef VOMP_HAS_EXIT
683 // some plattforms, want a proper deinitialisation of their hardware before reboot
684 Osd::getInstance()->shutdown();
685 Audio::getInstance()->shutdown();
686 Video::getInstance()->shutdown();
687 Remote::getInstance()->shutdown();
689 reboot(LINUX_REBOOT_CMD_RESTART);
690 // if reboot is not allowed -> stop
702 #endif //Would we support this on windows?
705 void Command::connectionLost()
707 logger->unsetExternLogger();
708 Message* m = new Message(); // break into master mutex
709 m->message = Message::CONNECTION_LOST;
711 postMessageFromOuterSpace(m);
714 void Command::buildCrashedBox()
716 VInfo* crash = new VInfo();
717 crash->setSize(360, 250);
718 crash->createBuffer();
719 if (Video::getInstance()->getFormat() == Video::PAL)
720 crash->setPosition(190, 146);
722 crash->setPosition(180, 96);
723 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.");
724 crash->setBorderOn(1);
725 crash->setTitleBarColour(DrawStyle::DANGER);
727 crash->setExitable();
729 boxstack->add(crash);
730 boxstack->update(crash);
733 void Command::doJustConnected(VConnect* vconnect)
736 if (!VDR::getInstance()->isConnected()) { connectionLost(); return; }
737 logger->log("Command", Log::INFO, "Entering doJustConnected");
739 Video* video = Video::getInstance();
740 Audio* audio = Audio::getInstance();
741 boxstack->remove(vconnect);
743 VInfo* vi = new VInfo();
744 vi->setSize(400, 200);
746 if (video->getFormat() == Video::PAL)
747 vi->setPosition(170, 200);
749 vi->setPosition(160, 150);
750 vi->setOneLiner(tr("Connected, loading config"));
753 boxstack->update(vi);
755 VDR* vdr = VDR::getInstance();
758 // See if we're supposed to do network logging
759 config = vdr->configLoad("Advanced", "Network logging");
760 if (config && !STRCASECMP(config, "On"))
762 logger->log("Command", Log::INFO, "Turning on network logging");
763 logger->setExternLogger(vdr);
767 logger->unsetExternLogger();
768 logger->log("Command", Log::INFO, "Turned off network logging");
770 if (config) delete[] config;
772 config = vdr->configLoad("Advanced", "Skin Name");
774 const char **skinnames=SkinFactory::getSkinNames();
775 for (int i=0;i<SkinFactory::getNumberofSkins();i++) {
776 if (!STRCASECMP(config, skinnames[i])) {
777 SkinFactory::InitSkin(i);
782 if (wallpaper && wallpaper_pict) {
783 if (DrawStyle::WALLPAPER.alpha) {
784 wallpaper_pict->setVisible(true);
786 wallpaper_pict->setVisible(false);
789 boxstack->update(wallpaper);
793 SkinFactory::InitSkin(0);
796 // See if config says to override video format (PAL/NTSC)
797 config = vdr->configLoad("General", "Override Video Format");
800 logger->log("Command", Log::DEBUG, "Override Video Format is present");
802 if ( (!strcmp(config, "PAL") && (video->getFormat() != Video::PAL))
803 || (!strcmp(config, "NTSC") && (video->getFormat() != Video::NTSC))
804 || (!strcmp(config, "PAL_M") && (video->getFormat() != Video::PAL_M))
805 || (!strcmp(config, "NTSC_J") && (video->getFormat() != Video::NTSC_J))
808 // Oh sheesh, need to switch format. Bye bye TV...
810 // Take everything down
811 boxstack->removeAll();
812 boxstack->remove(wallpaper);
813 Osd* osd = Osd::getInstance();
819 remote->shutdown(); // need on raspberry shut not do any harm, hopefully
820 remote->init(RemoteStartDev);
822 // Get video and osd back up with the new mode
823 if (!strcmp(config, "PAL"))
825 logger->log("Command", Log::DEBUG, "Switching to PAL");
826 video->init(Video::PAL);
828 else if (!strcmp(config, "NTSC"))
830 logger->log("Command", Log::DEBUG, "Switching to NTSC");
831 video->init(Video::NTSC);
832 } else if (!strcmp(config, "PAL_M"))
834 logger->log("Command", Log::DEBUG, "Switching to PAL_M");
835 video->init(Video::PAL_M);
836 } else if (!strcmp(config, "NTSC_J"))
838 logger->log("Command", Log::DEBUG, "Switching to NTSC_J");
839 video->init(Video::NTSC_J);
844 //we do not init twice
845 osd->init((char*)("/dev/stbgfx"));
848 // Put the wallpaper back
853 vi->setSize(400, 200);
855 if (video->getFormat() == Video::PAL)
856 vi->setPosition(170, 200);
858 vi->setPosition(160, 150);
860 vi->setOneLiner(tr("Connected, loading config"));
863 boxstack->update(vi);
867 logger->log("Command", Log::DEBUG, "Already in requested mode, or request was not 'PAL' or 'NTSC'");
872 logger->log("Command", Log::DEBUG, "Phew, no dangerous on-the-fly mode switching to do!");
875 // Power off if first boot and config says so
880 logger->log("Command", Log::DEBUG, "Load power after boot");
882 config = vdr->configLoad("General", "Power After Boot");
886 if (!STRCASECMP(config, "On"))
888 logger->log("Command", Log::INFO, "Config says Power After Boot = On");
890 else if (!STRCASECMP(config, "Off"))
892 logger->log("Command", Log::INFO, "Config says Power After Boot = Off");
897 else if (!STRCASECMP(config, "Last state"))
899 char* lastPowerState = vdr->configLoad("General", "Last Power State");
902 if (!STRCASECMP(lastPowerState, "On"))
904 logger->log("Command", Log::INFO, "Config says Last Power State = On");
906 else if (!STRCASECMP(lastPowerState, "Off"))
908 logger->log("Command", Log::INFO, "Config says Last Power State = Off");
915 logger->log("Command", Log::INFO, "Config General/Last Power State not understood");
920 logger->log("Command", Log::INFO, "Config General/Last Power State not found");
925 logger->log("Command", Log::INFO, "Config/Power After Boot not understood");
931 logger->log("Command", Log::INFO, "Config General/Power After Boot not found");
936 // Go S-Video if config says so
938 config = vdr->configLoad("TV", "Connection");
942 if (!STRCASECMP(config, "S-Video"))
944 logger->log("Command", Log::INFO, "Switching to S-Video as Connection=%s", config);
945 video->setConnection(Video::SVIDEO);
946 } else if (!STRCASECMP(config, "HDMI"))
948 logger->log("Command", Log::INFO, "Switching to HDMI as Connection=%s", config);
949 video->setConnection(Video::HDMI);
950 } else if (!STRCASECMP(config, "HDMI3D"))
952 logger->log("Command", Log::INFO, "Switching to HDMI3D as Connection=%s", config);
953 video->setConnection(Video::HDMI3D);
957 logger->log("Command", Log::INFO, "Switching to RGB/Composite as Connection=%s", config);
958 video->setConnection(Video::COMPOSITERGB);
964 logger->log("Command", Log::INFO, "Config TV/S-Video not found");
967 // Set to shutdown VDR if config says
969 config = vdr->configLoad("General", "VDR shutdown");
972 if (!STRCASECMP(config, "On"))
974 logger->log("Command", Log::INFO, "Shutdown VDR when shutting down vomp");
975 vdr->setVDRShutdown(true);
977 else if (!STRCASECMP(config, "Off"))
979 logger->log("Command", Log::INFO, "Shutdown only vomp");
980 vdr->setVDRShutdown(false);
985 logger->log("Command", Log::INFO, "Default shutdown only vomp");
986 vdr->setVDRShutdown(false); // Default
991 config = vdr->configLoad("General", "Remote type");
995 if (!STRCASECMP(config, "New"))
997 logger->log("Command", Log::INFO, "Switching to New remote type");
998 remote->setRemoteType(Remote::NEWREMOTE);
1002 logger->log("Command", Log::INFO, "Switching to Old remote type");
1003 remote->setRemoteType(Remote::OLDREMOTE);
1009 logger->log("Command", Log::INFO, "Config General/Remote type not found");
1010 remote->setRemoteType(Remote::OLDREMOTE);
1015 // Get TV aspect ratio
1017 config = vdr->configLoad("TV", "Aspect");
1020 if (!STRCASECMP(config, "16:9"))
1022 logger->log("Command", Log::INFO, "/// Switching to TV aspect 16:9");
1023 video->setTVsize(Video::ASPECT16X9);
1027 logger->log("Command", Log::INFO, "/// Switching to TV aspect 4:3");
1028 video->setTVsize(Video::ASPECT4X3);
1034 logger->log("Command", Log::INFO, "Config TV/Aspect type not found, going 4:3");
1035 video->setTVsize(Video::ASPECT4X3);
1038 config = vdr->configLoad("TV", "Widemode");
1041 if (!STRCASECMP(config, "Letterbox"))
1043 logger->log("Command", Log::INFO, "Setting letterbox mode");
1044 video->setMode(Video::LETTERBOX);
1048 logger->log("Command", Log::INFO, "Setting chop-sides mode");
1049 video->setMode(Video::NORMAL);
1056 logger->log("Command", Log::INFO, "Config TV/Widemode not found, Setting letterbox mode");
1057 video->setMode(Video::LETTERBOX);
1059 logger->log("Command", Log::INFO, "Config TV/Widemode not found, Setting chop-sides mode");
1060 video->setMode(Video::NORMAL);
1064 config = vdr->configLoad("Advanced", "TCP receive window");
1067 size_t newTCPsize = atoi(config);
1070 logger->log("Command", Log::INFO, "Setting TCP window size %i", newTCPsize);
1071 vdr->setReceiveWindow(newTCPsize);
1075 logger->log("Command", Log::INFO, "TCP window size not found, setting 2048");
1076 if (DEFAULT_TCP_WINDOWSIZE) vdr->setReceiveWindow(2048); // Default
1079 config = vdr->configLoad("Advanced", "Font Name");
1082 Osd::getInstance()->setFont(config);
1083 logger->log("Command", Log::INFO, "Setting Font to %s", config);
1089 // Set recording list type
1092 #ifdef ADVANCED_MENUES
1093 config = vdr->configLoad("Advanced", "Menu type");
1097 if (!STRCASECMP(config, "Advanced"))
1099 logger->log("Command", Log::INFO, "Switching to Advanced menu");
1105 logger->log("Command", Log::INFO, "Switching to Classic menu");
1112 logger->log("Command", Log::INFO, "Config General/menu type not found");
1117 config = vdr->configLoad("Advanced", "Disable WOL");
1120 if (!STRCASECMP(config, "Yes"))
1122 logger->log("Command", Log::INFO, "Config says disable WOL");
1123 Wol::getInstance()->setEnabled(false);
1127 logger->log("Command", Log::INFO, "Config says enable WOL");
1128 Wol::getInstance()->setEnabled(true);
1135 logger->log("Command", Log::INFO, "By default, enable WOL");
1136 Wol::getInstance()->setEnabled(true);
1138 /* device dependend config */
1139 audio->loadOptionsfromServer(vdr);
1140 video->loadOptionsfromServer(vdr);
1141 remote->loadOptionsfromServer(vdr);
1143 video->executePendingModeChanges();
1146 // Save power state = on
1148 vdr->configSave("General", "Last Power State", "On");
1150 // Make sure connection didn't die
1151 if (!vdr->isConnected())
1153 Command::getInstance()->connectionLost();
1157 boxstack->remove(vi);
1159 VWelcome* vw = new VWelcome();
1162 boxstack->update(vw);
1164 // Enter pre-keys here
1165 // handleCommand(Remote::OK);
1166 // handleCommand(Remote::THREE);
1167 // handleCommand(Remote::SIX);
1168 // handleCommand(Remote::OK);
1169 // handleCommand(Remote::UP);
1170 // handleCommand(Remote::PLAY);
1171 // handleCommand(Remote::DOWN);
1172 // handleCommand(Remote::DOWN);
1173 // handleCommand(Remote::DOWN);
1174 // handleCommand(Remote::OK);
1175 // handleCommand(Remote::RED);