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 "sleeptimer.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 logger->log("Control", Log::DEBUG, "Handling sleeptimer go");
630 Message* m = new Message(); // break into master mutex
631 m->message = Message::SCREENSHOT;
638 void Control::doStandby()
651 void Control::doPowerOn()
655 Video::getInstance()->signalOn();
656 Led::getInstance()->on();
657 InputMan::getInstance()->changePowerState(true);
660 VConnect* vconnect = new VConnect();
661 boxstack->add(vconnect);
666 void Control::doPowerOff()
670 VDR::getInstance()->shutdownVDR();
671 boxstack->removeAllExceptWallpaper();
672 Video::getInstance()->signalOff();
673 boxstack->update(wallpaper);
675 VDR::getInstance()->configSave("General", "Last Power State", "Off");
676 logger->unsetExternLogger();
677 VDR::getInstance()->disconnect();
678 Led::getInstance()->off();
679 InputMan::getInstance()->changePowerState(false);
681 sleepTimer->shutdown();
685 void Control::doFromTheTop(bool which)
687 if (isStandby) return;
692 logger->log("Control", Log::NOTICE, "Connection lost dialog already present");
696 logger->log("Control", Log::NOTICE, "Doing connection lost dialog");
697 connLost = new VInfo();
698 connLost->setSize(360, 200);
699 connLost->createBuffer();
700 if (Video::getInstance()->getFormat() == Video::PAL)
701 connLost->setPosition(190, 170);
703 connLost->setPosition(180, 120);
704 connLost->setOneLiner(tr("Connection lost"));
705 connLost->setDropThrough();
706 connLost->setBorderOn(1);
707 connLost->setTitleBarColour(DrawStyle::DANGER);
708 connLost->okButton();
710 boxstack->add(connLost);
711 boxstack->update(connLost);
713 clearMQInputEvents();
717 logger->unsetExternLogger();
718 VDR::getInstance()->disconnect();
719 boxstack->removeAllExceptWallpaper();
720 boxstack->update(wallpaper);
725 // at this point, everything should be reset to first-go
727 VConnect* vconnect = new VConnect();
728 boxstack->add(vconnect);
733 void Control::clearMQInputEvents()
735 std::lock_guard<std::mutex> lg(messageQueueMutex); // Get the lock
737 MQueueI i = messages.begin();
738 while(i != messages.end())
741 if (m->message == Message::INPUT_EVENT)
744 i = messages.erase(i);
753 void Control::doReboot()
756 logger->unsetExternLogger();
757 VDR::getInstance()->disconnect();
759 logger->log("Control", Log::NOTICE, "Reboot");
761 #ifndef VOMP_HAS_EXIT
762 // some plattforms, want a proper deinitialisation of their hardware before reboot
763 Osd::getInstance()->shutdown();
764 Audio::getInstance()->shutdown();
765 Video::getInstance()->shutdown();
766 InputMan::getInstance()->shutdown();
768 reboot(LINUX_REBOOT_CMD_RESTART);
769 // if reboot is not allowed -> stop
781 #endif //Would we support this on windows?
784 void Control::connectionLost()
786 logger->unsetExternLogger();
787 Message* m = new Message(); // break into master mutex
788 m->message = Message::CONNECTION_LOST;
789 m->p_to = Message::CONTROL;
793 void Control::buildCrashedBox()
795 VInfo* crash = new VInfo();
796 crash->setSize(360, 250);
797 crash->createBuffer();
798 if (Video::getInstance()->getFormat() == Video::PAL)
799 crash->setPosition(190, 146);
801 crash->setPosition(180, 96);
802 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.");
803 crash->setBorderOn(1);
804 crash->setTitleBarColour(DrawStyle::DANGER);
806 crash->setExitable();
808 boxstack->add(crash);
809 boxstack->update(crash);
812 int Control::getLangPref(bool subtitle, const char* langcode)
814 std::vector<struct ASLPref>::iterator itty=langcodes.begin();
815 char templangcode[4];
816 templangcode[0] = langcode[0];
817 templangcode[1] = langcode[1];
818 templangcode[2] = langcode[2];
819 templangcode[3] = '\0';
821 while (itty != langcodes.end())
823 size_t pos = (*itty).langcode.find(templangcode);
824 if (pos != std::string::npos)
826 //vector<struct ASLPref>::iterator itty2=langcodes.begin();
827 for (unsigned int i = 0; i < langcodes.size(); i++)
831 pref = langcodes[i].subtitlepref;
833 pref = langcodes[i].audiopref;
838 if (langcodes[i].subtitlepref==langpos) return i;
842 if (langcodes[i].audiopref==langpos) return i;
850 return langcodes.size(); //neutral
853 void Control::doJustConnected(VConnect* vconnect)
856 if (!VDR::getInstance()->isConnected()) { connectionLost(); return; }
857 logger->log("Control", Log::INFO, "Entering doJustConnected");
859 boxstack->remove(vconnect);
861 VInfo* vi = new VInfo();
862 vi->setSize(400, 200);
864 if (video->getFormat() == Video::PAL)
865 vi->setPosition(170, 200);
867 vi->setPosition(160, 150);
868 vi->setOneLiner(tr("Connected, loading config"));
871 boxstack->update(vi);
873 // FIXME make config system
877 // See if we're supposed to do network logging
878 config = vdr->configLoad("Advanced", "Network logging");
879 if (config && !STRCASECMP(config, "On"))
881 logger->log("Control", Log::INFO, "Turning on network logging");
882 logger->setExternLogger(vdr);
886 logger->unsetExternLogger();
887 logger->log("Control", Log::INFO, "Turned off network logging");
889 if (config) delete[] config;
891 config = vdr->configLoad("Advanced", "Skin Name");
894 const char **skinnames=SkinFactory::getSkinNames();
895 for (int i=0;i<SkinFactory::getNumberofSkins();i++)
897 if (!STRCASECMP(config, skinnames[i]))
899 SkinFactory::InitSkin(i);
905 if (wallpaper && wallpaper_pict)
907 if (DrawStyle::WALLPAPER.alpha)
908 wallpaper_pict->setVisible(true);
910 wallpaper_pict->setVisible(false);
913 boxstack->update(wallpaper);
918 SkinFactory::InitSkin(0);
921 // See if config says to override video format (PAL/NTSC)
922 config = vdr->configLoad("General", "Override Video Format");
925 logger->log("Control", Log::DEBUG, "Override Video Format is present");
927 if ( (!strcmp(config, "PAL") && (video->getFormat() != Video::PAL))
928 || (!strcmp(config, "NTSC") && (video->getFormat() != Video::NTSC))
929 || (!strcmp(config, "PAL_M") && (video->getFormat() != Video::PAL_M))
930 || (!strcmp(config, "NTSC_J") && (video->getFormat() != Video::NTSC_J))
933 // Oh sheesh, need to switch format. Bye bye TV...
935 // Take everything down
936 boxstack->removeAllExceptWallpaper();
937 boxstack->remove(wallpaper);
938 delete wallpaper_pict; wallpaper_pict = NULL; wallpaper = NULL;
945 inputMan->shutdown(); // need on raspberry shut not do any harm, hopefully
946 inputMan->init(); // FIXME this breaks badly now
948 // Get video and osd back up with the new mode
949 if (!strcmp(config, "PAL"))
951 logger->log("Control", Log::DEBUG, "Switching to PAL");
952 video->init(Video::PAL);
954 else if (!strcmp(config, "NTSC"))
956 logger->log("Control", Log::DEBUG, "Switching to NTSC");
957 video->init(Video::NTSC);
958 } else if (!strcmp(config, "PAL_M"))
960 logger->log("Control", Log::DEBUG, "Switching to PAL_M");
961 video->init(Video::PAL_M);
962 } else if (!strcmp(config, "NTSC_J"))
964 logger->log("Control", Log::DEBUG, "Switching to NTSC_J");
965 video->init(Video::NTSC_J);
970 //we do not init twice
974 // Put the wallpaper back
979 vi->setSize(400, 200);
981 if (video->getFormat() == Video::PAL)
982 vi->setPosition(170, 200);
984 vi->setPosition(160, 150);
986 vi->setOneLiner(tr("Connected, loading config"));
989 boxstack->update(vi);
993 logger->log("Control", Log::DEBUG, "Already in requested mode, or request was not 'PAL' or 'NTSC'");
998 logger->log("Control", Log::DEBUG, "Phew, no dangerous on-the-fly mode switching to do!");
1001 // Power off if first boot and config says so
1006 logger->log("Control", Log::DEBUG, "Load power after boot");
1008 config = vdr->configLoad("General", "Power After Boot");
1012 if (!STRCASECMP(config, "On"))
1014 logger->log("Control", Log::INFO, "Config says Power After Boot = On");
1016 else if (!STRCASECMP(config, "Off"))
1018 logger->log("Control", Log::INFO, "Config says Power After Boot = Off");
1021 return; // quit here
1023 else if (!STRCASECMP(config, "Last state"))
1025 char* lastPowerState = vdr->configLoad("General", "Last Power State");
1028 if (!STRCASECMP(lastPowerState, "On"))
1030 logger->log("Control", Log::INFO, "Config says Last Power State = On");
1032 else if (!STRCASECMP(lastPowerState, "Off"))
1034 logger->log("Control", Log::INFO, "Config says Last Power State = Off");
1037 return; // quit here
1041 logger->log("Control", Log::INFO, "Config General/Last Power State not understood");
1046 logger->log("Control", Log::INFO, "Config General/Last Power State not found");
1051 logger->log("Control", Log::INFO, "Config/Power After Boot not understood");
1057 logger->log("Control", Log::INFO, "Config General/Power After Boot not found");
1062 // Go S-Video if config says so
1064 config = vdr->configLoad("TV", "Connection");
1068 if (!STRCASECMP(config, "S-Video"))
1070 logger->log("Control", Log::INFO, "Switching to S-Video as Connection=%s", config);
1071 video->setConnection(Video::SVIDEO);
1072 } else if (!STRCASECMP(config, "HDMI"))
1074 logger->log("Control", Log::INFO, "Switching to HDMI as Connection=%s", config);
1075 video->setConnection(Video::HDMI);
1076 } else if (!STRCASECMP(config, "HDMI3D"))
1078 logger->log("Control", Log::INFO, "Switching to HDMI3D as Connection=%s", config);
1079 video->setConnection(Video::HDMI3D);
1083 logger->log("Control", Log::INFO, "Switching to RGB/Composite as Connection=%s", config);
1084 video->setConnection(Video::COMPOSITERGB);
1090 logger->log("Control", Log::INFO, "Config TV/S-Video not found");
1093 // Set to shutdown VDR if config says
1095 config = vdr->configLoad("General", "VDR shutdown");
1098 if (!STRCASECMP(config, "On"))
1100 logger->log("Control", Log::INFO, "Shutdown VDR when shutting down vomp");
1101 vdr->setVDRShutdown(true);
1103 else if (!STRCASECMP(config, "Off"))
1105 logger->log("Control", Log::INFO, "Shutdown only vomp");
1106 vdr->setVDRShutdown(false);
1111 logger->log("Control", Log::INFO, "Default shutdown only vomp");
1112 vdr->setVDRShutdown(false); // Default
1115 // Get TV aspect ratio
1117 config = vdr->configLoad("TV", "Aspect");
1120 if (!STRCASECMP(config, "16:9"))
1122 logger->log("Control", Log::INFO, "/// Switching to TV aspect 16:9");
1123 video->setTVsize(Video::ASPECT16X9);
1127 logger->log("Control", Log::INFO, "/// Switching to TV aspect 4:3");
1128 video->setTVsize(Video::ASPECT4X3);
1134 logger->log("Control", Log::INFO, "Config TV/Aspect type not found, going 4:3");
1135 video->setTVsize(Video::ASPECT4X3);
1138 config = vdr->configLoad("TV", "Widemode");
1141 if (!STRCASECMP(config, "Letterbox"))
1143 logger->log("Control", Log::INFO, "Setting letterbox mode");
1144 video->setMode(Video::LETTERBOX);
1148 logger->log("Control", Log::INFO, "Setting chop-sides mode");
1149 video->setMode(Video::NORMAL);
1156 logger->log("Control", Log::INFO, "Config TV/Widemode not found, Setting letterbox mode");
1157 video->setMode(Video::LETTERBOX);
1159 logger->log("Control", Log::INFO, "Config TV/Widemode not found, Setting chop-sides mode");
1160 video->setMode(Video::NORMAL);
1164 config = vdr->configLoad("Advanced", "TCP receive window");
1167 size_t newTCPsize = atoi(config);
1170 logger->log("Control", Log::INFO, "Setting TCP window size %i", newTCPsize);
1171 vdr->setReceiveWindow(newTCPsize);
1175 logger->log("Control", Log::INFO, "TCP window size not found, setting 2048");
1176 if (DEFAULT_TCP_WINDOWSIZE) vdr->setReceiveWindow(2048); // Default
1179 config = vdr->configLoad("Advanced", "Font Name");
1182 Osd::getInstance()->setFont(config);
1183 logger->log("Control", Log::INFO, "Setting Font to %s", config);
1189 // Set recording list type
1191 #ifdef ADVANCED_MENUES
1192 config = vdr->configLoad("Advanced", "Menu type");
1196 if (!STRCASECMP(config, "Advanced"))
1198 logger->log("Control", Log::INFO, "Switching to Advanced menu");
1203 logger->log("Control", Log::INFO, "Switching to Classic menu");
1210 logger->log("Control", Log::INFO, "Config General/menu type not found");
1215 config = vdr->configLoad("Advanced", "Disable WOL");
1218 if (!STRCASECMP(config, "Yes"))
1220 logger->log("Control", Log::INFO, "Config says disable WOL");
1221 Wol::getInstance()->setEnabled(false);
1225 logger->log("Control", Log::INFO, "Config says enable WOL");
1226 Wol::getInstance()->setEnabled(true);
1233 logger->log("Control", Log::INFO, "By default, enable WOL");
1234 Wol::getInstance()->setEnabled(true);
1236 /* device dependend config */
1237 audio->loadOptionsFromServer(vdr);
1238 video->loadOptionsFromServer(vdr);
1239 inputMan->loadOptionsFromServer(vdr);
1241 video->executePendingModeChanges();
1244 // Save power state = on
1246 vdr->configSave("General", "Last Power State", "On");
1248 // Make sure connection didn't die
1249 if (!vdr->isConnected())
1251 Control::getInstance()->connectionLost();
1255 boxstack->remove(vi);
1257 VWelcome* vw = new VWelcome();
1260 boxstack->update(vw);
1262 // Enter pre-keys here
1263 // handleCommand(Input::OK);
1264 // handleCommand(Input::THREE);
1265 // handleCommand(Input::SIX);
1266 // handleCommand(Input::OK);
1267 // handleCommand(Input::UP);
1268 // handleCommand(Input::PLAY);
1269 // handleCommand(Input::DOWN);
1270 // handleCommand(Input::DOWN);
1271 // handleCommand(Input::DOWN);
1272 // handleCommand(Input::RIGHT);
1273 // handleCommand(Input::RED);