2 Copyright 2004-2020 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, see <https://www.gnu.org/licenses/>.
20 // FIXME rename to Control and move stuff from main to here
23 #include <unistd.h> // for reboot
24 #include <linux/reboot.h>
25 #include <sys/reboot.h>
35 #include "inputandroid.h"
43 #include "vserverselect.h"
59 #include "vsleeptimer.h"
61 #include "osdvector.h"
64 #ifdef VOMP_PLATFORM_RASPBERRY
65 #include "ledraspberry.h"
66 #include "osdopenvg.h"
72 #include "windowsosd.h"
74 #include "osdwinpixel.h"
76 #include "osdwinvector.h"
86 Control* Control::instance = NULL;
100 Control* Control::getInstance()
105 bool Control::init(bool tcrashed)
107 if (initted) return false;
109 logger = Log::getInstance();
111 SkinFactory::InitSkin(0);
115 led = new Led_TYPE(); if (!led) throw 10;
116 if (!led->init(-1)) throw 11; // FIXME init(0) on Win32
118 timers = new Timers(); if (!timers) throw 20;
119 if (!timers->init()) throw 21;
121 video = new Video_TYPE(); if (!video) throw 30;
122 if (!video->init(Video::PAL)) throw 31;
124 audio = new Audio_TYPE(); if (!audio) throw 40;
125 if (!audio->init(Audio::MPEG2_PES)) throw 41;
127 osd = new Osd_TYPE(); if (!osd) throw 50;
128 if (!osd->init()) throw 51;
130 vdr = new VDR(); if (!vdr) throw 60;
131 if (!vdr->init()) throw 61;
133 boxstack = new BoxStack(); if (!boxstack) throw 70;
134 if (!boxstack->init()) throw 71;
136 sleeptimer = new Sleeptimer(); if (!sleeptimer) throw 80;
138 wol = new Wol(); if (!wol) throw 90;
140 inputMan = new InputMan(); if (!inputMan) throw 100;
141 if (!inputMan->init()) throw 101;
146 if (e == 10) logger->log("Control", Log::EMERG, "LED module failed to create");
147 else if (e == 11) logger->log("Control", Log::EMERG, "LED module failed to initialise");
148 else if (e == 20) logger->log("Control", Log::EMERG, "Timers module failed to create");
149 else if (e == 21) logger->log("Control", Log::EMERG, "Timers module failed to initialise");
150 else if (e == 30) logger->log("Control", Log::EMERG, "Video module failed to create");
151 else if (e == 31) logger->log("Control", Log::EMERG, "Video module failed to initialise");
152 else if (e == 40) logger->log("Control", Log::EMERG, "Audio module failed to create");
153 else if (e == 41) logger->log("Control", Log::EMERG, "Audio module failed to initialise");
154 else if (e == 50) logger->log("Control", Log::EMERG, "OSD module failed to create");
155 else if (e == 51) logger->log("Control", Log::EMERG, "OSD module failed to initialise");
156 else if (e == 60) logger->log("Control", Log::EMERG, "VDR module failed to create");
157 else if (e == 61) logger->log("Control", Log::EMERG, "VDR module failed to initialise");
158 else if (e == 70) logger->log("Control", Log::EMERG, "BoxStack module failed to create");
159 else if (e == 71) logger->log("Control", Log::EMERG, "BoxStack module failed to initialise");
160 else if (e == 80) logger->log("Control", Log::EMERG, "SleepTimer module failed to create");
161 else if (e == 90) logger->log("Control", Log::EMERG, "WOL module failed to create");
162 else if (e == 100) logger->log("Control", Log::EMERG, "InputMan module failed to create");
163 else if (e == 101) logger->log("Control", Log::EMERG, "InputMan module failed to initialise");
180 boxstack->shutdown();
240 void Control::shutdown()
242 if (!initted) return;
247 inputMan->shutdown();
250 logger->log("Control", Log::NOTICE, "InputMan module shut down");
256 logger->log("Control", Log::NOTICE, "WOL module shut down");
263 logger->log("Control", Log::NOTICE, "Sleeptimer module shut down");
268 boxstack->shutdown();
271 logger->log("Control", Log::NOTICE, "BoxStack module shut down");
279 logger->log("Control", Log::NOTICE, "VDR module shut down");
287 logger->log("Control", Log::NOTICE, "OSD module shut down");
295 logger->log("Control", Log::NOTICE, "Audio module shut down");
303 logger->log("Control", Log::NOTICE, "Video module shut down");
311 logger->log("Control", Log::NOTICE, "Timers module shut down");
319 logger->log("Control", Log::NOTICE, "LED module shut down");
325 logger->log("Control", Log::NOTICE, "Request stop");
327 Message* m = new Message(); // break master loop
328 m->message = Message::SHUTDOWN;
329 m->p_to = Message::CONTROL;
333 void Control::doWallpaper()
336 Boxx* bbg = new Boxx();
337 bbg->setSize(video->getScreenWidth(), video->getScreenHeight());
339 bbg->fillColour(DrawStyle::WALLPAPER);
341 boxstack->update(bbg);
342 boxstack->remove(bbg);
345 wallpaper = new Boxx();
346 wallpaper->setSize(video->getScreenWidth(), video->getScreenHeight());
347 wallpaper->createBuffer();
348 wallpaper->setBackgroundColour(DrawStyle::WALLPAPER);
350 wallpaper_pict = new WJpegTYPE();
351 wallpaper_pict->setSize(video->getScreenWidth(), video->getScreenHeight());
353 if (video->getFormat() == Video::PAL)
355 logger->log("Control", Log::DEBUG, "PAL wallpaper selected");
357 wallpaper_pict->init("/wallpaperPAL.jpg");
359 wallpaper_pict->init("wallpaperPAL.jpg");
364 logger->log("Control", Log::DEBUG, "NTSC wallpaper selected");
365 wallpaper_pict->init("/wallpaperNTSC.jpg");
368 if (DrawStyle::WALLPAPER.alpha)
369 wallpaper_pict->setVisible(true);
371 wallpaper_pict->setVisible(false);
373 wallpaper->add(wallpaper_pict);
376 boxstack->add(wallpaper);
377 boxstack->update(wallpaper);
379 OsdVector* osdv = dynamic_cast<OsdVector*>(Osd::getInstance());
380 if (osdv) osdv->updateBackgroundColor(DrawStyle::WALLPAPER);
385 if (!initted) return;
389 Video::getInstance()->signalOn();
390 Led::getInstance()->on();
400 VConnect* vconnect = new VConnect();
401 boxstack->add(vconnect);
406 // FIXME Input::NA_SIGNAL is possibly obsolete now
408 std::unique_lock<std::mutex> lockWrapper(messageQueueMutex); // locks. unlocks on out-of-scope
414 messageQueueCond.wait(lockWrapper, [&] { return !irun || !messages.empty(); });
415 logger->log("Control", Log::DEBUG, "woke");
419 while(!messages.empty())
421 Message* m = messages.front();
422 messages.pop_front();
424 lockWrapper.unlock();
435 boxstack->removeAllExceptWallpaper();
436 boxstack->remove(wallpaper);
437 delete wallpaper_pict; wallpaper_pict = NULL; wallpaper = NULL;
440 void Control::processMessage(Message* m)
442 // FIXME - a slight modification - how if messagereceivers were to register
443 // themselves as receivers to avoid the calling-a-deleted-object problem
444 // then only deliver/register/unregister would have to be protected
446 logger->log("Control", Log::DEBUG, "processing message %i", m->message);
449 if ((m->p_to == Message::CONTROL) || (m->to == this)) // Maybe don't check m->to here? Always use predefined?
453 case Message::SHUTDOWN:
459 case Message::STOP_PLAYBACK:
461 handleCommand(Input::STOP); // an odd way of doing it, but so simple
464 // Also connection_lost comes from player - anywhere else?
468 case Message::VDR_CONNECTED:
470 doJustConnected(static_cast<VConnect*>(m->from));
473 case Message::SCREENSHOT:
475 logger->log("Osd", Log::NOTICE, "Screenshot Message arrived");
476 Osd::getInstance()->screenShot("out.jpg");
479 case Message::CONNECTION_LOST:
484 case Message::INPUT_EVENT:
486 logger->log("Control", Log::NOTICE, "INPUT_EVENT %i", m->parameter);
488 handleCommand(m->parameter);
491 case Message::CHANGE_LANGUAGE:
493 boxstack->removeAllExceptWallpaper();
494 boxstack->update(wallpaper);
496 if (!VDR::getInstance()->isConnected()) { connectionLost(); break; }
497 VWelcome* vw = new VWelcome();
500 boxstack->update(vw);
503 case Message::LAST_VIEW_CLOSE:
505 // Shouldn't be done like this. Some generic message pass back from vinfo perhaps
512 // VWelcome* vw = new VWelcome();
514 // boxstack->add(vw);
515 // boxstack->update(vw);
519 case Message::NEW_PICTURE:
521 //Log::getInstance()->log("Control", Log::DEBUG, "TVMedia NEW_PICTURE");
522 OsdVector* osdv = dynamic_cast<OsdVector*>(Osd::getInstance());
523 if (osdv) osdv->informPicture(m->tag, reinterpret_cast<ImageIndex>(m->data));
526 case Message::NEW_PICTURE_STATIC:
528 //Log::getInstance()->log("Control", Log::DEBUG, "TVMedia NEW_PICTURE %x %x",m->tag,m->parameter);
529 OsdVector* osdv = dynamic_cast<OsdVector*>(Osd::getInstance());
530 if (osdv) osdv->informPicture(static_cast<unsigned long long>(m->tag) << 32LL, reinterpret_cast<ImageIndex>(m->data));
539 Instead of sending through the boxstack, implement a more generic MessageReceiver interface
540 and have potential receivers register with something
541 When a message needs to be delivered, check if the receiver is still registered, if so, deliver the message
542 This could all be done using the existing big control mutex to keep it simple
545 logger->log("Control", Log::DEBUG, "Sending message to boxstack");
546 boxstack->processMessage(m);
550 void Control::handleCommand(int button)
552 if (isStandby && (button != Input::POWER)
553 && (button != Input::POWERON)
554 && (button != Input::POWEROFF)) return;
556 if (!connLost && boxstack->handleCommand(button)) return; // don't send to boxstack if connLost
558 // command was not handled
562 case Input::VOLUMEUP:
563 case Input::VOLUMEDOWN:
565 if (inputMan->handlesVolume()) // CEC volume handler?
567 if (button == Input::VOLUMEDOWN)
568 inputMan->volumeDown();
570 inputMan->volumeUp();
574 VVolume* v = new VVolume();
576 v->handleCommand(button); // this will draw+show
582 if (inputMan->handlesVolume())
584 inputMan->volumeMute();
588 VMute* v = new VMute();
605 case Input::POWEROFF:
613 if (!connLost) return; // if connLost, handle Input::OK
619 VSleeptimer* sleep = new VSleeptimer();
620 boxstack->add(sleep);
621 sleep->handleCommand(button); // this will draw+show
631 Message* m = new Message(); // break into master mutex
632 m->message = Message::SCREENSHOT;
639 void Control::doStandby()
652 void Control::doPowerOn()
656 Video::getInstance()->signalOn();
657 Led::getInstance()->on();
658 InputMan::getInstance()->changePowerState(true);
661 VConnect* vconnect = new VConnect();
662 boxstack->add(vconnect);
667 void Control::doPowerOff()
671 VDR::getInstance()->shutdownVDR();
672 boxstack->removeAllExceptWallpaper();
673 Video::getInstance()->signalOff();
674 boxstack->update(wallpaper);
676 VDR::getInstance()->configSave("General", "Last Power State", "Off");
677 logger->unsetExternLogger();
678 VDR::getInstance()->disconnect();
679 Led::getInstance()->off();
680 InputMan::getInstance()->changePowerState(false);
682 Sleeptimer::getInstance()->shutdown();
686 void Control::doFromTheTop(bool which)
688 if (isStandby) return;
693 logger->log("Control", Log::NOTICE, "Connection lost dialog already present");
697 logger->log("Control", Log::NOTICE, "Doing connection lost dialog");
698 connLost = new VInfo();
699 connLost->setSize(360, 200);
700 connLost->createBuffer();
701 if (Video::getInstance()->getFormat() == Video::PAL)
702 connLost->setPosition(190, 170);
704 connLost->setPosition(180, 120);
705 connLost->setOneLiner(tr("Connection lost"));
706 connLost->setDropThrough();
707 connLost->setBorderOn(1);
708 connLost->setTitleBarColour(DrawStyle::DANGER);
709 connLost->okButton();
711 boxstack->add(connLost);
712 boxstack->update(connLost);
714 clearMQInputEvents();
718 logger->unsetExternLogger();
719 VDR::getInstance()->disconnect();
720 boxstack->removeAllExceptWallpaper();
721 boxstack->update(wallpaper);
726 // at this point, everything should be reset to first-go
728 VConnect* vconnect = new VConnect();
729 boxstack->add(vconnect);
734 void Control::clearMQInputEvents()
736 std::lock_guard<std::mutex> lg(messageQueueMutex); // Get the lock
738 MQueueI i = messages.begin();
739 while(i != messages.end())
742 if (m->message == Message::INPUT_EVENT)
745 i = messages.erase(i);
754 void Control::doReboot()
757 logger->unsetExternLogger();
758 VDR::getInstance()->disconnect();
760 logger->log("Control", Log::NOTICE, "Reboot");
762 #ifndef VOMP_HAS_EXIT
763 // some plattforms, want a proper deinitialisation of their hardware before reboot
764 Osd::getInstance()->shutdown();
765 Audio::getInstance()->shutdown();
766 Video::getInstance()->shutdown();
767 InputMan::getInstance()->shutdown();
769 reboot(LINUX_REBOOT_CMD_RESTART);
770 // if reboot is not allowed -> stop
782 #endif //Would we support this on windows?
785 void Control::connectionLost()
787 logger->unsetExternLogger();
788 Message* m = new Message(); // break into master mutex
789 m->message = Message::CONNECTION_LOST;
790 m->p_to = Message::CONTROL;
794 void Control::buildCrashedBox()
796 VInfo* crash = new VInfo();
797 crash->setSize(360, 250);
798 crash->createBuffer();
799 if (Video::getInstance()->getFormat() == Video::PAL)
800 crash->setPosition(190, 146);
802 crash->setPosition(180, 96);
803 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.");
804 crash->setBorderOn(1);
805 crash->setTitleBarColour(DrawStyle::DANGER);
807 crash->setExitable();
809 boxstack->add(crash);
810 boxstack->update(crash);
813 int Control::getLangPref(bool subtitle, const char* langcode)
815 std::vector<struct ASLPref>::iterator itty=langcodes.begin();
816 char templangcode[4];
817 templangcode[0] = langcode[0];
818 templangcode[1] = langcode[1];
819 templangcode[2] = langcode[2];
820 templangcode[3] = '\0';
822 while (itty != langcodes.end())
824 size_t pos = (*itty).langcode.find(templangcode);
825 if (pos != std::string::npos)
827 //vector<struct ASLPref>::iterator itty2=langcodes.begin();
828 for (unsigned int i = 0; i < langcodes.size(); i++)
832 pref = langcodes[i].subtitlepref;
834 pref = langcodes[i].audiopref;
839 if (langcodes[i].subtitlepref==langpos) return i;
843 if (langcodes[i].audiopref==langpos) return i;
851 return langcodes.size(); //neutral
854 void Control::doJustConnected(VConnect* vconnect)
857 if (!VDR::getInstance()->isConnected()) { connectionLost(); return; }
858 logger->log("Control", Log::INFO, "Entering doJustConnected");
860 boxstack->remove(vconnect);
862 VInfo* vi = new VInfo();
863 vi->setSize(400, 200);
865 if (video->getFormat() == Video::PAL)
866 vi->setPosition(170, 200);
868 vi->setPosition(160, 150);
869 vi->setOneLiner(tr("Connected, loading config"));
872 boxstack->update(vi);
874 // FIXME make config system
878 // See if we're supposed to do network logging
879 config = vdr->configLoad("Advanced", "Network logging");
880 if (config && !STRCASECMP(config, "On"))
882 logger->log("Control", Log::INFO, "Turning on network logging");
883 logger->setExternLogger(vdr);
887 logger->unsetExternLogger();
888 logger->log("Control", Log::INFO, "Turned off network logging");
890 if (config) delete[] config;
892 config = vdr->configLoad("Advanced", "Skin Name");
895 const char **skinnames=SkinFactory::getSkinNames();
896 for (int i=0;i<SkinFactory::getNumberofSkins();i++)
898 if (!STRCASECMP(config, skinnames[i]))
900 SkinFactory::InitSkin(i);
906 if (wallpaper && wallpaper_pict)
908 if (DrawStyle::WALLPAPER.alpha)
909 wallpaper_pict->setVisible(true);
911 wallpaper_pict->setVisible(false);
914 boxstack->update(wallpaper);
919 SkinFactory::InitSkin(0);
922 // See if config says to override video format (PAL/NTSC)
923 config = vdr->configLoad("General", "Override Video Format");
926 logger->log("Control", Log::DEBUG, "Override Video Format is present");
928 if ( (!strcmp(config, "PAL") && (video->getFormat() != Video::PAL))
929 || (!strcmp(config, "NTSC") && (video->getFormat() != Video::NTSC))
930 || (!strcmp(config, "PAL_M") && (video->getFormat() != Video::PAL_M))
931 || (!strcmp(config, "NTSC_J") && (video->getFormat() != Video::NTSC_J))
934 // Oh sheesh, need to switch format. Bye bye TV...
936 // Take everything down
937 boxstack->removeAllExceptWallpaper();
938 boxstack->remove(wallpaper);
939 delete wallpaper_pict; wallpaper_pict = NULL; wallpaper = NULL;
946 inputMan->shutdown(); // need on raspberry shut not do any harm, hopefully
947 inputMan->init(); // FIXME this breaks badly now
949 // Get video and osd back up with the new mode
950 if (!strcmp(config, "PAL"))
952 logger->log("Control", Log::DEBUG, "Switching to PAL");
953 video->init(Video::PAL);
955 else if (!strcmp(config, "NTSC"))
957 logger->log("Control", Log::DEBUG, "Switching to NTSC");
958 video->init(Video::NTSC);
959 } else if (!strcmp(config, "PAL_M"))
961 logger->log("Control", Log::DEBUG, "Switching to PAL_M");
962 video->init(Video::PAL_M);
963 } else if (!strcmp(config, "NTSC_J"))
965 logger->log("Control", Log::DEBUG, "Switching to NTSC_J");
966 video->init(Video::NTSC_J);
971 //we do not init twice
975 // Put the wallpaper back
980 vi->setSize(400, 200);
982 if (video->getFormat() == Video::PAL)
983 vi->setPosition(170, 200);
985 vi->setPosition(160, 150);
987 vi->setOneLiner(tr("Connected, loading config"));
990 boxstack->update(vi);
994 logger->log("Control", Log::DEBUG, "Already in requested mode, or request was not 'PAL' or 'NTSC'");
999 logger->log("Control", Log::DEBUG, "Phew, no dangerous on-the-fly mode switching to do!");
1002 // Power off if first boot and config says so
1007 logger->log("Control", Log::DEBUG, "Load power after boot");
1009 config = vdr->configLoad("General", "Power After Boot");
1013 if (!STRCASECMP(config, "On"))
1015 logger->log("Control", Log::INFO, "Config says Power After Boot = On");
1017 else if (!STRCASECMP(config, "Off"))
1019 logger->log("Control", Log::INFO, "Config says Power After Boot = Off");
1022 return; // quit here
1024 else if (!STRCASECMP(config, "Last state"))
1026 char* lastPowerState = vdr->configLoad("General", "Last Power State");
1029 if (!STRCASECMP(lastPowerState, "On"))
1031 logger->log("Control", Log::INFO, "Config says Last Power State = On");
1033 else if (!STRCASECMP(lastPowerState, "Off"))
1035 logger->log("Control", Log::INFO, "Config says Last Power State = Off");
1038 return; // quit here
1042 logger->log("Control", Log::INFO, "Config General/Last Power State not understood");
1047 logger->log("Control", Log::INFO, "Config General/Last Power State not found");
1052 logger->log("Control", Log::INFO, "Config/Power After Boot not understood");
1058 logger->log("Control", Log::INFO, "Config General/Power After Boot not found");
1063 // Go S-Video if config says so
1065 config = vdr->configLoad("TV", "Connection");
1069 if (!STRCASECMP(config, "S-Video"))
1071 logger->log("Control", Log::INFO, "Switching to S-Video as Connection=%s", config);
1072 video->setConnection(Video::SVIDEO);
1073 } else if (!STRCASECMP(config, "HDMI"))
1075 logger->log("Control", Log::INFO, "Switching to HDMI as Connection=%s", config);
1076 video->setConnection(Video::HDMI);
1077 } else if (!STRCASECMP(config, "HDMI3D"))
1079 logger->log("Control", Log::INFO, "Switching to HDMI3D as Connection=%s", config);
1080 video->setConnection(Video::HDMI3D);
1084 logger->log("Control", Log::INFO, "Switching to RGB/Composite as Connection=%s", config);
1085 video->setConnection(Video::COMPOSITERGB);
1091 logger->log("Control", Log::INFO, "Config TV/S-Video not found");
1094 // Set to shutdown VDR if config says
1096 config = vdr->configLoad("General", "VDR shutdown");
1099 if (!STRCASECMP(config, "On"))
1101 logger->log("Control", Log::INFO, "Shutdown VDR when shutting down vomp");
1102 vdr->setVDRShutdown(true);
1104 else if (!STRCASECMP(config, "Off"))
1106 logger->log("Control", Log::INFO, "Shutdown only vomp");
1107 vdr->setVDRShutdown(false);
1112 logger->log("Control", Log::INFO, "Default shutdown only vomp");
1113 vdr->setVDRShutdown(false); // Default
1116 // Get TV aspect ratio
1118 config = vdr->configLoad("TV", "Aspect");
1121 if (!STRCASECMP(config, "16:9"))
1123 logger->log("Control", Log::INFO, "/// Switching to TV aspect 16:9");
1124 video->setTVsize(Video::ASPECT16X9);
1128 logger->log("Control", Log::INFO, "/// Switching to TV aspect 4:3");
1129 video->setTVsize(Video::ASPECT4X3);
1135 logger->log("Control", Log::INFO, "Config TV/Aspect type not found, going 4:3");
1136 video->setTVsize(Video::ASPECT4X3);
1139 config = vdr->configLoad("TV", "Widemode");
1142 if (!STRCASECMP(config, "Letterbox"))
1144 logger->log("Control", Log::INFO, "Setting letterbox mode");
1145 video->setMode(Video::LETTERBOX);
1149 logger->log("Control", Log::INFO, "Setting chop-sides mode");
1150 video->setMode(Video::NORMAL);
1157 logger->log("Control", Log::INFO, "Config TV/Widemode not found, Setting letterbox mode");
1158 video->setMode(Video::LETTERBOX);
1160 logger->log("Control", Log::INFO, "Config TV/Widemode not found, Setting chop-sides mode");
1161 video->setMode(Video::NORMAL);
1165 config = vdr->configLoad("Advanced", "TCP receive window");
1168 size_t newTCPsize = atoi(config);
1171 logger->log("Control", Log::INFO, "Setting TCP window size %i", newTCPsize);
1172 vdr->setReceiveWindow(newTCPsize);
1176 logger->log("Control", Log::INFO, "TCP window size not found, setting 2048");
1177 if (DEFAULT_TCP_WINDOWSIZE) vdr->setReceiveWindow(2048); // Default
1180 config = vdr->configLoad("Advanced", "Font Name");
1183 Osd::getInstance()->setFont(config);
1184 logger->log("Control", Log::INFO, "Setting Font to %s", config);
1190 // Set recording list type
1192 #ifdef ADVANCED_MENUES
1193 config = vdr->configLoad("Advanced", "Menu type");
1197 if (!STRCASECMP(config, "Advanced"))
1199 logger->log("Control", Log::INFO, "Switching to Advanced menu");
1204 logger->log("Control", Log::INFO, "Switching to Classic menu");
1211 logger->log("Control", Log::INFO, "Config General/menu type not found");
1216 config = vdr->configLoad("Advanced", "Disable WOL");
1219 if (!STRCASECMP(config, "Yes"))
1221 logger->log("Control", Log::INFO, "Config says disable WOL");
1222 Wol::getInstance()->setEnabled(false);
1226 logger->log("Control", Log::INFO, "Config says enable WOL");
1227 Wol::getInstance()->setEnabled(true);
1234 logger->log("Control", Log::INFO, "By default, enable WOL");
1235 Wol::getInstance()->setEnabled(true);
1237 /* device dependend config */
1238 audio->loadOptionsFromServer(vdr);
1239 video->loadOptionsFromServer(vdr);
1240 inputMan->loadOptionsFromServer(vdr);
1242 video->executePendingModeChanges();
1245 // Save power state = on
1247 vdr->configSave("General", "Last Power State", "On");
1249 // Make sure connection didn't die
1250 if (!vdr->isConnected())
1252 Control::getInstance()->connectionLost();
1256 boxstack->remove(vi);
1258 VWelcome* vw = new VWelcome();
1261 boxstack->update(vw);
1263 // Enter pre-keys here
1264 // handleCommand(Input::OK);
1265 // handleCommand(Input::THREE);
1266 // handleCommand(Input::SIX);
1267 // handleCommand(Input::OK);
1268 // handleCommand(Input::UP);
1269 // handleCommand(Input::PLAY);
1270 // handleCommand(Input::DOWN);
1271 // handleCommand(Input::DOWN);
1272 // handleCommand(Input::DOWN);
1273 // handleCommand(Input::RIGHT);
1274 // handleCommand(Input::RED);