From 486cf4e9d43294648bd46929aa7ab2dae4072378 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Wed, 15 Apr 2020 18:16:50 +0100 Subject: [PATCH] Rename Command class to Control --- channel.cc | 4 +- command.cc => control.cc | 160 +++++++++++++++++++------------------- command.h => control.h | 10 +-- demuxerts.cc | 8 +- event.cc | 6 +- language-data.h | 2 +- main.cc | 30 +++---- message.h | 4 - objects.mk | 2 +- osdopengl.cc | 2 +- osdvector.cc | 2 +- osdvector.h | 4 +- osdwinpixel.cc | 2 +- osdwinvector.cc | 2 +- playervideolive.cc | 12 +-- playervideorec.cc | 2 +- recording.cc | 12 +-- vconnect.cc | 6 +- vdr.cc | 16 ++-- vdr.h | 2 +- vepgsettimer.cc | 4 +- vepgsummary.cc | 2 +- vmediaview.cc | 4 +- vopts.cc | 6 +- vradiorec.cc | 10 +-- vrecordinglist.cc | 6 +- vrecordinglistadvanced.cc | 2 +- vrecordinglistclassic.cc | 2 +- vtimerlist.cc | 4 +- vvideolivetv.cc | 10 +-- vvideomedia.cc | 2 +- vvideorec.cc | 10 +-- vwelcome.cc | 16 ++-- winmain.cc | 42 +++++----- wremoteconfig.cc | 4 +- wwinaudiofilter.cc | 2 +- wwinmp3audiofilter.cc | 2 +- wwinvideofilter.cc | 2 +- wwinvideoh264filter.cc | 2 +- 39 files changed, 208 insertions(+), 212 deletions(-) rename command.cc => control.cc (83%) rename command.h => control.h (94%) diff --git a/channel.cc b/channel.cc index 8cd2f90..99941f8 100644 --- a/channel.cc +++ b/channel.cc @@ -21,7 +21,7 @@ #include "vdr.h" #include "log.h" -#include "command.h" +#include "control.h" Channel::Channel() { @@ -51,7 +51,7 @@ void Channel::loadPids() VDR::getInstance()->getChannelPids(this); // FIXME sort out this system if (!VDR::getInstance()->isConnected()) { - Command::getInstance()->connectionLost(); + Control::getInstance()->connectionLost(); return; } diff --git a/command.cc b/control.cc similarity index 83% rename from command.cc rename to control.cc index 54dee97..e4802a4 100644 --- a/command.cc +++ b/control.cc @@ -20,7 +20,7 @@ // FIXME rename to Control and move stuff from main to here -#include "command.h" +#include "control.h" #ifdef WIN32 #include "inputwin.h" @@ -56,26 +56,26 @@ #include "osdvector.h" -Command* Command::instance = NULL; +Control* Control::instance = NULL; -Command::Command() +Control::Control() { if (instance) return; instance = this; } -Command::~Command() +Control::~Control() { flushMessageQueue(); instance = NULL; } -Command* Command::getInstance() +Control* Control::getInstance() { return instance; } -int Command::init(bool tcrashed) +int Control::init(bool tcrashed) { if (initted) return 0; initted = true; @@ -96,16 +96,16 @@ int Command::init(bool tcrashed) return 1; } -int Command::shutdown() +int Control::shutdown() { if (!initted) return 0; initted = false; return 1; } -void Command::stop() +void Control::stop() { - logger->log("Command", Log::NOTICE, "Request stop"); + logger->log("Control", Log::NOTICE, "Request stop"); Message* m = new Message(); // break master loop m->message = Message::SHUTDOWN; @@ -113,7 +113,7 @@ void Command::stop() postMessage(m); } -void Command::doWallpaper() +void Control::doWallpaper() { Video* video = Video::getInstance(); @@ -137,7 +137,7 @@ void Command::doWallpaper() if (video->getFormat() == Video::PAL) { - logger->log("Command", Log::DEBUG, "PAL wallpaper selected"); + logger->log("Control", Log::DEBUG, "PAL wallpaper selected"); #ifndef _MIPS_ARCH wallpaper_pict->init("/wallpaperPAL.jpg"); #else @@ -146,7 +146,7 @@ void Command::doWallpaper() } else { - logger->log("Command", Log::DEBUG, "NTSC wallpaper selected"); + logger->log("Control", Log::DEBUG, "NTSC wallpaper selected"); wallpaper_pict->init("/wallpaperNTSC.jpg"); } @@ -165,7 +165,7 @@ void Command::doWallpaper() if (osdv) osdv->updateBackgroundColor(DrawStyle::WALLPAPER); } -void Command::run() +void Control::run() { if (!initted) return; irun = true; @@ -197,7 +197,7 @@ void Command::run() while(irun) { messageQueueCond.wait(lockWrapper, [&] { return !irun || !messages.empty(); }); - logger->log("Command", Log::DEBUG, "woke"); + logger->log("Control", Log::DEBUG, "woke"); if (!irun) break; @@ -222,13 +222,13 @@ void Command::run() delete wallpaper_pict; wallpaper_pict = NULL; wallpaper = NULL; } -void Command::processMessage(Message* m) +void Control::processMessage(Message* m) { // FIXME - a slight modification - how if messagereceivers were to register // themselves as receivers to avoid the calling-a-deleted-object problem // then only deliver/register/unregister would have to be protected - logger->log("Command", Log::DEBUG, "processing message %i", m->message); + logger->log("Control", Log::DEBUG, "processing message %i", m->message); if ((m->p_to == Message::CONTROL) || (m->to == this)) // Maybe don't check m->to here? Always use predefined? @@ -268,7 +268,7 @@ void Command::processMessage(Message* m) } case Message::INPUT_EVENT: { - logger->log("Command", Log::NOTICE, "INPUT_EVENT %i", m->parameter); + logger->log("Control", Log::NOTICE, "INPUT_EVENT %i", m->parameter); handleCommand(m->parameter); break; @@ -303,14 +303,14 @@ void Command::processMessage(Message* m) } case Message::NEW_PICTURE: { - //Log::getInstance()->log("Command", Log::DEBUG, "TVMedia NEW_PICTURE"); + //Log::getInstance()->log("Control", Log::DEBUG, "TVMedia NEW_PICTURE"); OsdVector* osdv = dynamic_cast(Osd::getInstance()); if (osdv) osdv->informPicture(m->tag, reinterpret_cast(m->data)); break; } case Message::NEW_PICTURE_STATIC: { - //Log::getInstance()->log("Command", Log::DEBUG, "TVMedia NEW_PICTURE %x %x",m->tag,m->parameter); + //Log::getInstance()->log("Control", Log::DEBUG, "TVMedia NEW_PICTURE %x %x",m->tag,m->parameter); OsdVector* osdv = dynamic_cast(Osd::getInstance()); if (osdv) osdv->informPicture(static_cast(m->tag) << 32LL, reinterpret_cast(m->data)); break; @@ -324,15 +324,15 @@ void Command::processMessage(Message* m) Instead of sending through the boxstack, implement a more generic MessageReceiver interface and have potential receivers register with something When a message needs to be delivered, check if the receiver is still registered, if so, deliver the message - This could all be done using the existing big command mutex to keep it simple + This could all be done using the existing big control mutex to keep it simple */ - logger->log("Command", Log::DEBUG, "Sending message to boxstack"); + logger->log("Control", Log::DEBUG, "Sending message to boxstack"); boxstack->processMessage(m); } } -void Command::handleCommand(int button) +void Control::handleCommand(int button) { if (isStandby && (button != Input::POWER) && (button != Input::POWERON) @@ -410,7 +410,7 @@ void Command::handleCommand(int button) } /* -void Command::sig1() +void Control::sig1() { #ifdef DEV Message* m = new Message(); // break into master mutex @@ -421,7 +421,7 @@ void Command::sig1() } */ -void Command::doStandby() +void Control::doStandby() { if (isStandby) { @@ -434,7 +434,7 @@ void Command::doStandby() } -void Command::doPowerOn() +void Control::doPowerOn() { if (isStandby) { @@ -449,7 +449,7 @@ void Command::doPowerOn() } } -void Command::doPowerOff() +void Control::doPowerOff() { if (!isStandby) { @@ -468,18 +468,18 @@ void Command::doPowerOff() } } -void Command::doFromTheTop(bool which) +void Control::doFromTheTop(bool which) { if (isStandby) return; if (which) { if (connLost) { - logger->log("Command", Log::NOTICE, "Connection lost dialog already present"); + logger->log("Control", Log::NOTICE, "Connection lost dialog already present"); return; } - logger->log("Command", Log::NOTICE, "Doing connection lost dialog"); + logger->log("Control", Log::NOTICE, "Doing connection lost dialog"); connLost = new VInfo(); connLost->setSize(360, 200); connLost->createBuffer(); @@ -516,7 +516,7 @@ void Command::doFromTheTop(bool which) } } -void Command::clearMQInputEvents() +void Control::clearMQInputEvents() { std::lock_guard lg(messageQueueMutex); // Get the lock @@ -536,13 +536,13 @@ void Command::clearMQInputEvents() } } -void Command::doReboot() +void Control::doReboot() { logger->unsetExternLogger(); VDR::getInstance()->disconnect(); // just kill it... - logger->log("Command", Log::NOTICE, "Reboot"); + logger->log("Control", Log::NOTICE, "Reboot"); #ifndef WIN32 #ifndef VOMP_HAS_EXIT // some plattforms, want a proper deinitialisation of their hardware before reboot @@ -567,7 +567,7 @@ void Command::doReboot() #endif //Would we support this on windows? } -void Command::connectionLost() +void Control::connectionLost() { logger->unsetExternLogger(); Message* m = new Message(); // break into master mutex @@ -576,7 +576,7 @@ void Command::connectionLost() postMessage(m); } -void Command::buildCrashedBox() +void Control::buildCrashedBox() { VInfo* crash = new VInfo(); crash->setSize(360, 250); @@ -595,7 +595,7 @@ void Command::buildCrashedBox() boxstack->update(crash); } -int Command::getLangPref(bool subtitle, const char* langcode) +int Control::getLangPref(bool subtitle, const char* langcode) { std::vector::iterator itty=langcodes.begin(); char templangcode[4]; @@ -636,11 +636,11 @@ int Command::getLangPref(bool subtitle, const char* langcode) return langcodes.size(); //neutral } -void Command::doJustConnected(VConnect* vconnect) +void Control::doJustConnected(VConnect* vconnect) { I18n::initialize(); if (!VDR::getInstance()->isConnected()) { connectionLost(); return; } - logger->log("Command", Log::INFO, "Entering doJustConnected"); + logger->log("Control", Log::INFO, "Entering doJustConnected"); Video* video = Video::getInstance(); Audio* audio = Audio::getInstance(); @@ -667,13 +667,13 @@ void Command::doJustConnected(VConnect* vconnect) config = vdr->configLoad("Advanced", "Network logging"); if (config && !STRCASECMP(config, "On")) { - logger->log("Command", Log::INFO, "Turning on network logging"); + logger->log("Control", Log::INFO, "Turning on network logging"); logger->setExternLogger(vdr); } else { logger->unsetExternLogger(); - logger->log("Command", Log::INFO, "Turned off network logging"); + logger->log("Control", Log::INFO, "Turned off network logging"); } if (config) delete[] config; @@ -711,7 +711,7 @@ void Command::doJustConnected(VConnect* vconnect) config = vdr->configLoad("General", "Override Video Format"); if (config) { - logger->log("Command", Log::DEBUG, "Override Video Format is present"); + logger->log("Control", Log::DEBUG, "Override Video Format is present"); if ( (!strcmp(config, "PAL") && (video->getFormat() != Video::PAL)) || (!strcmp(config, "NTSC") && (video->getFormat() != Video::NTSC)) @@ -738,20 +738,20 @@ void Command::doJustConnected(VConnect* vconnect) // Get video and osd back up with the new mode if (!strcmp(config, "PAL")) { - logger->log("Command", Log::DEBUG, "Switching to PAL"); + logger->log("Control", Log::DEBUG, "Switching to PAL"); video->init(Video::PAL); } else if (!strcmp(config, "NTSC")) { - logger->log("Command", Log::DEBUG, "Switching to NTSC"); + logger->log("Control", Log::DEBUG, "Switching to NTSC"); video->init(Video::NTSC); } else if (!strcmp(config, "PAL_M")) { - logger->log("Command", Log::DEBUG, "Switching to PAL_M"); + logger->log("Control", Log::DEBUG, "Switching to PAL_M"); video->init(Video::PAL_M); } else if (!strcmp(config, "NTSC_J")) { - logger->log("Command", Log::DEBUG, "Switching to NTSC_J"); + logger->log("Control", Log::DEBUG, "Switching to NTSC_J"); video->init(Video::NTSC_J); } delete[] config; @@ -780,12 +780,12 @@ void Command::doJustConnected(VConnect* vconnect) } else { - logger->log("Command", Log::DEBUG, "Already in requested mode, or request was not 'PAL' or 'NTSC'"); + logger->log("Control", Log::DEBUG, "Already in requested mode, or request was not 'PAL' or 'NTSC'"); } } else { - logger->log("Command", Log::DEBUG, "Phew, no dangerous on-the-fly mode switching to do!"); + logger->log("Control", Log::DEBUG, "Phew, no dangerous on-the-fly mode switching to do!"); } // Power off if first boot and config says so @@ -793,7 +793,7 @@ void Command::doJustConnected(VConnect* vconnect) { firstBoot = false; - logger->log("Command", Log::DEBUG, "Load power after boot"); + logger->log("Control", Log::DEBUG, "Load power after boot"); config = vdr->configLoad("General", "Power After Boot"); @@ -801,11 +801,11 @@ void Command::doJustConnected(VConnect* vconnect) { if (!STRCASECMP(config, "On")) { - logger->log("Command", Log::INFO, "Config says Power After Boot = On"); + logger->log("Control", Log::INFO, "Config says Power After Boot = On"); } else if (!STRCASECMP(config, "Off")) { - logger->log("Command", Log::INFO, "Config says Power After Boot = Off"); + logger->log("Control", Log::INFO, "Config says Power After Boot = Off"); doStandby(); delete[] config; return; // quit here @@ -817,34 +817,34 @@ void Command::doJustConnected(VConnect* vconnect) { if (!STRCASECMP(lastPowerState, "On")) { - logger->log("Command", Log::INFO, "Config says Last Power State = On"); + logger->log("Control", Log::INFO, "Config says Last Power State = On"); } else if (!STRCASECMP(lastPowerState, "Off")) { - logger->log("Command", Log::INFO, "Config says Last Power State = Off"); + logger->log("Control", Log::INFO, "Config says Last Power State = Off"); doStandby(); delete[] config; return; // quit here } else { - logger->log("Command", Log::INFO, "Config General/Last Power State not understood"); + logger->log("Control", Log::INFO, "Config General/Last Power State not understood"); } } else { - logger->log("Command", Log::INFO, "Config General/Last Power State not found"); + logger->log("Control", Log::INFO, "Config General/Last Power State not found"); } } else { - logger->log("Command", Log::INFO, "Config/Power After Boot not understood"); + logger->log("Control", Log::INFO, "Config/Power After Boot not understood"); } delete[] config; } else { - logger->log("Command", Log::INFO, "Config General/Power After Boot not found"); + logger->log("Control", Log::INFO, "Config General/Power After Boot not found"); } } @@ -857,27 +857,27 @@ void Command::doJustConnected(VConnect* vconnect) { if (!STRCASECMP(config, "S-Video")) { - logger->log("Command", Log::INFO, "Switching to S-Video as Connection=%s", config); + logger->log("Control", Log::INFO, "Switching to S-Video as Connection=%s", config); video->setConnection(Video::SVIDEO); } else if (!STRCASECMP(config, "HDMI")) { - logger->log("Command", Log::INFO, "Switching to HDMI as Connection=%s", config); + logger->log("Control", Log::INFO, "Switching to HDMI as Connection=%s", config); video->setConnection(Video::HDMI); } else if (!STRCASECMP(config, "HDMI3D")) { - logger->log("Command", Log::INFO, "Switching to HDMI3D as Connection=%s", config); + logger->log("Control", Log::INFO, "Switching to HDMI3D as Connection=%s", config); video->setConnection(Video::HDMI3D); } else { - logger->log("Command", Log::INFO, "Switching to RGB/Composite as Connection=%s", config); + logger->log("Control", Log::INFO, "Switching to RGB/Composite as Connection=%s", config); video->setConnection(Video::COMPOSITERGB); } delete[] config; } else { - logger->log("Command", Log::INFO, "Config TV/S-Video not found"); + logger->log("Control", Log::INFO, "Config TV/S-Video not found"); } // Set to shutdown VDR if config says @@ -887,18 +887,18 @@ void Command::doJustConnected(VConnect* vconnect) { if (!STRCASECMP(config, "On")) { - logger->log("Command", Log::INFO, "Shutdown VDR when shutting down vomp"); + logger->log("Control", Log::INFO, "Shutdown VDR when shutting down vomp"); vdr->setVDRShutdown(true); } else if (!STRCASECMP(config, "Off")) { - logger->log("Command", Log::INFO, "Shutdown only vomp"); + logger->log("Control", Log::INFO, "Shutdown only vomp"); vdr->setVDRShutdown(false); } } else { - logger->log("Command", Log::INFO, "Default shutdown only vomp"); + logger->log("Control", Log::INFO, "Default shutdown only vomp"); vdr->setVDRShutdown(false); // Default } @@ -909,19 +909,19 @@ void Command::doJustConnected(VConnect* vconnect) { if (!STRCASECMP(config, "16:9")) { - logger->log("Command", Log::INFO, "/// Switching to TV aspect 16:9"); + logger->log("Control", Log::INFO, "/// Switching to TV aspect 16:9"); video->setTVsize(Video::ASPECT16X9); } else { - logger->log("Command", Log::INFO, "/// Switching to TV aspect 4:3"); + logger->log("Control", Log::INFO, "/// Switching to TV aspect 4:3"); video->setTVsize(Video::ASPECT4X3); } delete[] config; } else { - logger->log("Command", Log::INFO, "Config TV/Aspect type not found, going 4:3"); + logger->log("Control", Log::INFO, "Config TV/Aspect type not found, going 4:3"); video->setTVsize(Video::ASPECT4X3); } @@ -930,12 +930,12 @@ void Command::doJustConnected(VConnect* vconnect) { if (!STRCASECMP(config, "Letterbox")) { - logger->log("Command", Log::INFO, "Setting letterbox mode"); + logger->log("Control", Log::INFO, "Setting letterbox mode"); video->setMode(Video::LETTERBOX); } else { - logger->log("Command", Log::INFO, "Setting chop-sides mode"); + logger->log("Control", Log::INFO, "Setting chop-sides mode"); video->setMode(Video::NORMAL); } delete[] config; @@ -943,10 +943,10 @@ void Command::doJustConnected(VConnect* vconnect) else { #ifdef __ANDROID__ - logger->log("Command", Log::INFO, "Config TV/Widemode not found, Setting letterbox mode"); + logger->log("Control", Log::INFO, "Config TV/Widemode not found, Setting letterbox mode"); video->setMode(Video::LETTERBOX); #else - logger->log("Command", Log::INFO, "Config TV/Widemode not found, Setting chop-sides mode"); + logger->log("Control", Log::INFO, "Config TV/Widemode not found, Setting chop-sides mode"); video->setMode(Video::NORMAL); #endif } @@ -957,12 +957,12 @@ void Command::doJustConnected(VConnect* vconnect) size_t newTCPsize = atoi(config); delete[] config; - logger->log("Command", Log::INFO, "Setting TCP window size %i", newTCPsize); + logger->log("Control", Log::INFO, "Setting TCP window size %i", newTCPsize); vdr->setReceiveWindow(newTCPsize); } else { - logger->log("Command", Log::INFO, "TCP window size not found, setting 2048"); + logger->log("Control", Log::INFO, "TCP window size not found, setting 2048"); if (DEFAULT_TCP_WINDOWSIZE) vdr->setReceiveWindow(2048); // Default } @@ -970,7 +970,7 @@ void Command::doJustConnected(VConnect* vconnect) if (config) { Osd::getInstance()->setFont(config); - logger->log("Command", Log::INFO, "Setting Font to %s", config); + logger->log("Control", Log::INFO, "Setting Font to %s", config); delete[] config; } @@ -985,19 +985,19 @@ void Command::doJustConnected(VConnect* vconnect) { if (!STRCASECMP(config, "Advanced")) { - logger->log("Command", Log::INFO, "Switching to Advanced menu"); + logger->log("Control", Log::INFO, "Switching to Advanced menu"); advMenus = true; } else { - logger->log("Command", Log::INFO, "Switching to Classic menu"); + logger->log("Control", Log::INFO, "Switching to Classic menu"); advMenus = false; } delete[] config; } else { - logger->log("Command", Log::INFO, "Config General/menu type not found"); + logger->log("Control", Log::INFO, "Config General/menu type not found"); advMenus = true; } #endif @@ -1007,12 +1007,12 @@ void Command::doJustConnected(VConnect* vconnect) { if (!STRCASECMP(config, "Yes")) { - logger->log("Command", Log::INFO, "Config says disable WOL"); + logger->log("Control", Log::INFO, "Config says disable WOL"); Wol::getInstance()->setEnabled(false); } else { - logger->log("Command", Log::INFO, "Config says enable WOL"); + logger->log("Control", Log::INFO, "Config says enable WOL"); Wol::getInstance()->setEnabled(true); } @@ -1020,7 +1020,7 @@ void Command::doJustConnected(VConnect* vconnect) } else { - logger->log("Command", Log::INFO, "By default, enable WOL"); + logger->log("Control", Log::INFO, "By default, enable WOL"); Wol::getInstance()->setEnabled(true); } /* device dependend config */ @@ -1038,7 +1038,7 @@ void Command::doJustConnected(VConnect* vconnect) // Make sure connection didn't die if (!vdr->isConnected()) { - Command::getInstance()->connectionLost(); + Control::getInstance()->connectionLost(); } else { diff --git a/command.h b/control.h similarity index 94% rename from command.h rename to control.h index 62fb740..6ed82be 100644 --- a/command.h +++ b/control.h @@ -55,12 +55,12 @@ struct ASLPref typedef std::vector ASLPrefList; -class Command : public MessageQueue +class Control : public MessageQueue { public: - Command(); - ~Command(); - static Command* getInstance(); + Control(); + ~Control(); + static Control* getInstance(); int init(bool crashed = false); int shutdown(); @@ -88,7 +88,7 @@ class Command : public MessageQueue // void sig1(); void clearMQInputEvents(); - static Command* instance; + static Control* instance; Log* logger; BoxStack* boxstack; diff --git a/demuxerts.cc b/demuxerts.cc index 7f2d4c1..b7059c5 100644 --- a/demuxerts.cc +++ b/demuxerts.cc @@ -533,14 +533,14 @@ int DemuxerTS::processTS(UCHAR* buf) bool dolby=false; int selected=-1; int prefered=-1; - Command* command = Command::getInstance(); + Control* control = Control::getInstance(); if (channelinfo.numDPids > 0 && Audio::getInstance()->maysupportAc3()) { ULONG j = 0; while (j < channelinfo.numDPids) { - int newpref = command->getLangPref(false, channelinfo.dpids[j].desc); + int newpref = control->getLangPref(false, channelinfo.dpids[j].desc); if (Audio::getInstance()->streamTypeSupported(channelinfo.dpids[j].type) && (prefered < 0 || newpref < prefered)) { @@ -557,7 +557,7 @@ int DemuxerTS::processTS(UCHAR* buf) ULONG j = 0; while (j < channelinfo.numAPids) { - int newpref = command->getLangPref(false, channelinfo.apids[j].desc); + int newpref = control->getLangPref(false, channelinfo.apids[j].desc); if (Audio::getInstance()->streamTypeSupported(channelinfo.apids[j].type) && (prefered < 0 || newpref < prefered)) { @@ -585,7 +585,7 @@ int DemuxerTS::processTS(UCHAR* buf) ULONG j = 0; while (j < channelinfo.numSPids) { - int newpref = command->getLangPref(true, channelinfo.spids[j].desc); + int newpref = control->getLangPref(true, channelinfo.spids[j].desc); if ( (prefered < 0 || newpref < prefered)) { selected = j; diff --git a/event.cc b/event.cc index 930605c..b11547b 100644 --- a/event.cc +++ b/event.cc @@ -20,7 +20,7 @@ #include "event.h" #include "log.h" -#include "command.h" +#include "control.h" #include "movieinfo.h" #include "seriesinfo.h" #include "vdr.h" @@ -44,7 +44,7 @@ void Event::loadinfos(UINT channelid) id, channelid, movieID, seriesID, episodeID); } - if (!vdr->isConnected()) Command::getInstance()->connectionLost(); + if (!vdr->isConnected()) Control::getInstance()->connectionLost(); if (movieID != 0) { @@ -57,5 +57,5 @@ void Event::loadinfos(UINT channelid) Log::getInstance()->log("Event", Log::DEBUG, "Got Scraper SeriesInfo"); } - if (!vdr->isConnected()) Command::getInstance()->connectionLost(); + if (!vdr->isConnected()) Control::getInstance()->connectionLost(); } diff --git a/language-data.h b/language-data.h index 528f883..e3b1429 100644 --- a/language-data.h +++ b/language-data.h @@ -783,7 +783,7 @@ const I18n::tI18nPhrase I18n::Phrases[] = "Verbinding mislukt", "55", }, - // Command + // Control { "Connected, loading config", "Verbunden, lade Einstellungen", "Ansluten, laddar konfigurering", diff --git a/main.cc b/main.cc index aca7fa1..3453100 100644 --- a/main.cc +++ b/main.cc @@ -43,7 +43,7 @@ #include "timers.h" #include "vdr.h" #include "boxstack.h" -#include "command.h" +#include "control.h" #include "inputman.h" #include "wol.h" #include "vsleeptimer.h" @@ -80,7 +80,7 @@ Led* led; Osd* osd; Timers* timers; BoxStack* boxstack; -Command* command; +Control* control; VDR* vdr; Video* video; Audio* audio; @@ -141,11 +141,11 @@ int main(int argc, char** argv) video = new Video_TYPE(); boxstack = new BoxStack(); - command = new Command(); + control = new Control(); wol = new Wol(); sleeptimer = new Sleeptimer(); - if (!logger || !timers || !inputMan || !led || !osd || !video || !audio || !boxstack || !command || !wol || !sleeptimer) + if (!logger || !timers || !inputMan || !led || !osd || !video || !audio || !boxstack || !control || !wol || !sleeptimer) { printf("Could not create objects. Memory problems?\n"); shutdown(1); @@ -323,14 +323,14 @@ int main(int argc, char** argv) shutdown(1); } - success = command->init(crashed); + success = control->init(crashed); if (success) { - logger->log("Core", Log::INFO, "Command module initialised"); + logger->log("Core", Log::INFO, "Control module initialised"); } else { - logger->log("Core", Log::EMERG, "Command module failed to initialise"); + logger->log("Core", Log::EMERG, "Control module failed to initialise"); shutdown(1); } @@ -341,7 +341,7 @@ int main(int argc, char** argv) // Run main loop --------------------------------------------------------------------------------------------------- // Ok, all major device components and other bits are loaded and ready - command->run(); + control->run(); // When that returns quit ------------------------------------------------------------------------------------------ shutdown(0); @@ -365,7 +365,7 @@ void threadSignalReceiverFunction() logger->log("Core", Log::NOTICE, "Signal received: %i", sig); - if ((sig == SIGINT) || (sig == SIGTERM)) command->stop(); + if ((sig == SIGINT) || (sig == SIGTERM)) control->stop(); } } @@ -382,13 +382,13 @@ void shutdown(int code) logger->log("Core", Log::NOTICE, "BoxStack module shut down"); } - // FIXME, send a del all to boxstack first, then get rid of it after command? - if (command) // shut down command here in case views have posted messages + // FIXME, send a del all to boxstack first, then get rid of it after control? + if (control) // shut down control here in case views have posted messages { - command->shutdown(); - delete command; - command = NULL; - logger->log("Core", Log::NOTICE, "Command module shut down"); + control->shutdown(); + delete control; + control = NULL; + logger->log("Core", Log::NOTICE, "Control module shut down"); } if (vdr) diff --git a/message.h b/message.h index e362ec2..9b442f5 100644 --- a/message.h +++ b/message.h @@ -94,7 +94,3 @@ class Message }; #endif - -// FIXME idea - instead of always having to specify a real pointer in the "to" variable (meaning clients may have to -// run Command::getInstance() for e.g.), how about having some constant values for well known targets. Then -// clients may not need the #include "command.h" diff --git a/objects.mk b/objects.mk index ee66ea4..88aedcf 100644 --- a/objects.mk +++ b/objects.mk @@ -1,4 +1,4 @@ -OBJ_COMMON = command.o thread.o timers.o i18n.o udp4.o udp6.o vdpc.o tcp.o \ +OBJ_COMMON = control.o thread.o timers.o i18n.o udp4.o udp6.o vdpc.o tcp.o \ message.o messagequeue.o wol.o audio.o video.o log.o \ vdr.o recman.o recording.o recinfo.o channel.o rectimer.o event.o \ directory.o mark.o option.o vfeed.o afeed.o \ diff --git a/osdopengl.cc b/osdopengl.cc index 2b18a35..2ad47c5 100644 --- a/osdopengl.cc +++ b/osdopengl.cc @@ -20,7 +20,7 @@ #include "videoomx.h" #include "surfaceopengl.h" #include "message.h" -#include "command.h" +#include "control.h" #include "osdopengl.h" diff --git a/osdvector.cc b/osdvector.cc index b0bd6e1..c09bba4 100644 --- a/osdvector.cc +++ b/osdvector.cc @@ -21,7 +21,7 @@ #include "surfacevector.h" #include "vdr.h" #include "vdrresponsepacket.h" -#include "command.h" +#include "control.h" #include "message.h" // The next section is activated, if the magick++ PictureReader is provided, it should be available for many POSIX platforms diff --git a/osdvector.h b/osdvector.h index a901cda..1cbaae7 100644 --- a/osdvector.h +++ b/osdvector.h @@ -247,7 +247,7 @@ class OsdVector : public Osd virtual void getScreenSize(int &width, int &height)=0; virtual void getRealScreenSize(int &width, int &height)=0; - // should be only called from command thread + // should be only called from control thread void informPicture(LoadIndex index, ImageIndex i_index); @@ -312,7 +312,7 @@ class OsdVector : public Osd bool processReceivedPictures(); - // should be called from command thread + // should be called from control thread void receivePicture(VDR_ResponsePacket *vresp); void addStaticImage(unsigned int id); diff --git a/osdwinpixel.cc b/osdwinpixel.cc index 1698332..2b69778 100644 --- a/osdwinpixel.cc +++ b/osdwinpixel.cc @@ -27,7 +27,7 @@ #include "message.h" -#include "command.h" +#include "control.h" diff --git a/osdwinvector.cc b/osdwinvector.cc index 5e86c4a..dd48b6c 100644 --- a/osdwinvector.cc +++ b/osdwinvector.cc @@ -1246,7 +1246,7 @@ void OsdWinVector::createPicture(struct PictureInfo& pict_inf) m->message = Message::NEW_PICTURE_STATIC; m->tag = pict_inf.lindex >> 32LL; } - MessageQueue::getInstance()->postMessage(m); // inform command about new picture + MessageQueue::getInstance()->postMessage(m); // inform control about new picture } else { pict_inf.decoder->freeReference(pict_inf.reference); diff --git a/playervideolive.cc b/playervideolive.cc index 06d0dfc..b4111c0 100644 --- a/playervideolive.cc +++ b/playervideolive.cc @@ -35,7 +35,7 @@ #include "channel.h" #include "dvbsubtitles.h" #include "osdreceiver.h" -#include "command.h" +#include "control.h" #include "playervideolive.h" @@ -735,14 +735,14 @@ void PlayerVideoLive::threadMethod() int selected = -1; int prefered = -1; - Command* command = Command::getInstance(); + Control* control = Control::getInstance(); if (chan->numDPids > 0 && audio->maysupportAc3()) { ULONG j = 0; while (j < chan->numDPids) { - int newpref = command->getLangPref(false, chan->dpids[j].desc); + int newpref = control->getLangPref(false, chan->dpids[j].desc); if (Audio::getInstance()->streamTypeSupported(chan->dpids[j].type) && (prefered < 0 || newpref < prefered)) { selected = j; @@ -758,7 +758,7 @@ void PlayerVideoLive::threadMethod() ULONG j = 0; while (j < chan->numAPids) { - int newpref = command->getLangPref(false, chan->apids[j].desc); + int newpref = control->getLangPref(false, chan->apids[j].desc); if (Audio::getInstance()->streamTypeSupported(chan->apids[j].type) && (prefered < 0 || newpref < prefered)) { selected = j; @@ -798,7 +798,7 @@ void PlayerVideoLive::threadMethod() ULONG j = 0; while (j < chan->numSPids) { - int newpref = command->getLangPref(true, chan->spids[j].desc); + int newpref = control->getLangPref(true, chan->spids[j].desc); if ((prefered < 0 || newpref < prefered)) { selected = j; @@ -816,7 +816,7 @@ void PlayerVideoLive::threadMethod() { firstStart = false; - if (command->getSubDefault()) + if (control->getSubDefault()) turnSubtitlesOn(true); else turnSubtitlesOn(false); diff --git a/playervideorec.cc b/playervideorec.cc index 74e22f2..96b7d78 100644 --- a/playervideorec.cc +++ b/playervideorec.cc @@ -91,7 +91,7 @@ int PlayerVideoRec::init(bool p_isPesRecording, double framespersecond) video->blank(); audio->stop(); - if (Command::getInstance()->getSubDefault()) + if (Control::getInstance()->getSubDefault()) turnSubtitlesOn(true); else turnSubtitlesOn(false); diff --git a/recording.cc b/recording.cc index 908f4ee..2198568 100644 --- a/recording.cc +++ b/recording.cc @@ -23,7 +23,7 @@ #include "log.h" #include "demuxer.h" #include "demuxerts.h" -#include "command.h" +#include "control.h" #include "seriesinfo.h" #include "movieinfo.h" @@ -109,7 +109,7 @@ void Recording::loadRecInfo() recInfo = vdr->getRecInfo(fileName); Log::getInstance()->log("Recording", Log::DEBUG, "Recording has loaded recInfo %p", recInfo); - if (!vdr->isConnected()) Command::getInstance()->connectionLost(); + if (!vdr->isConnected()) Control::getInstance()->connectionLost(); if (movieInfo) delete movieInfo; if (seriesInfo) delete seriesInfo; @@ -122,7 +122,7 @@ void Recording::loadRecInfo() Log::getInstance()->log("Recording", Log::DEBUG, "Got Scraper EventType %d %d %d", movieID, seriesID, episodeID); - if (!vdr->isConnected()) Command::getInstance()->connectionLost(); + if (!vdr->isConnected()) Control::getInstance()->connectionLost(); if (movieID != 0) { @@ -136,7 +136,7 @@ void Recording::loadRecInfo() } - if (!vdr->isConnected()) Command::getInstance()->connectionLost(); + if (!vdr->isConnected()) Control::getInstance()->connectionLost(); } @@ -155,7 +155,7 @@ void Recording::dropRecInfo() void Recording::loadMarks() { markList = vdr->getMarks(fileName); - if (!VDR::getInstance()->isConnected()) Command::getInstance()->connectionLost(); + if (!VDR::getInstance()->isConnected()) Control::getInstance()->connectionLost(); } bool Recording::isRadio(bool &h264) @@ -186,7 +186,7 @@ bool Recording::isRadio(bool &h264) free(buffer); vdr->stopStreaming(); - if (!VDR::getInstance()->isConnected()) Command::getInstance()->connectionLost(); + if (!VDR::getInstance()->isConnected()) Control::getInstance()->connectionLost(); Log::getInstance()->log("Recording", Log::DEBUG, "Recording has messed about and worked out radio = %u", !hasVideo); diff --git a/vconnect.cc b/vconnect.cc index a13d903..2874e02 100644 --- a/vconnect.cc +++ b/vconnect.cc @@ -20,7 +20,7 @@ #include "defines.h" #include "video.h" #include "colour.h" -#include "command.h" +#include "control.h" #include "i18n.h" #include "boxstack.h" #include "message.h" @@ -163,8 +163,8 @@ void VConnect::threadMethod() logger->log("VConnect", Log::DEBUG, "Connected ok, doing login"); unsigned int version_server_min, version_server_max, version_client; int subtitles; - success = vdr->doLogin(&version_server_min, &version_server_max, &version_client, Command::getInstance()->getASLList(), subtitles); - Command::getInstance()->setSubDefault(subtitles); + success = vdr->doLogin(&version_server_min, &version_server_max, &version_client, Control::getInstance()->getASLList(), subtitles); + Control::getInstance()->setSubDefault(subtitles); if (!success) { diff --git a/vdr.cc b/vdr.cc index d2d1dc0..632a6b8 100644 --- a/vdr.cc +++ b/vdr.cc @@ -26,7 +26,7 @@ #include "wol.h" #include "vdrrequestpacket.h" #include "vdrresponsepacket.h" -#include "command.h" +#include "control.h" #ifdef VOMP_MEDIAPLAYER #include "media.h" #include "mediaprovider.h" @@ -442,10 +442,10 @@ void VDR::connectionDied() } } edMutex.unlock(); - // Ok, all event receviers should be dealt with. just in case there weren't any, inform command + // Ok, all event receviers should be dealt with. just in case there weren't any, inform control logger->log("VDR", Log::DEBUG, "edUnlock at end of connectionDied"); - Command::getInstance()->connectionLost(); + Control::getInstance()->connectionLost(); } bool VDR::ed_cb_find(EDReceiver* edr, void* userTag) @@ -1374,7 +1374,7 @@ MediaList* VDR::getMediaList(const MediaURI * root) SerializeBuffer* vresp = doRequestResponse(vrp,request.command); if (!vresp) { - Command::getInstance()->connectionLost(); + Control::getInstance()->connectionLost(); return NULL; } @@ -1406,7 +1406,7 @@ int VDR::openMedium(ULONG channel,const MediaURI *uri, ULLONG * size, ULONG x, } SerializeBuffer* vresp = doRequestResponse(vrp,request.command); if (!vresp) { - Command::getInstance()->connectionLost(); + Control::getInstance()->connectionLost(); return -1; } ULONG flags=0; @@ -1434,7 +1434,7 @@ int VDR::getMediaBlock(ULONG channel, ULLONG position, ULONG maxAmount, ULONG* a } SerializeBuffer* vresp = doRequestResponse(vrp,request.command); if (!vresp) { - Command::getInstance()->connectionLost(); + Control::getInstance()->connectionLost(); return -1; } @@ -1463,7 +1463,7 @@ int VDR::getMediaInfo(ULONG channel, MediaInfo * result) { } SerializeBuffer* vresp = doRequestResponse(vrp,request.command); if (!vresp) { - Command::getInstance()->connectionLost(); + Control::getInstance()->connectionLost(); return -1; } @@ -1491,7 +1491,7 @@ int VDR::closeMediaChannel(ULONG channel) { } SerializeBuffer* vresp = doRequestResponse(vrp,request.command); if (!vresp) { - Command::getInstance()->connectionLost(); + Control::getInstance()->connectionLost(); return -1; } ULONG flags; diff --git a/vdr.h b/vdr.h index a7bc8d0..ad00955 100644 --- a/vdr.h +++ b/vdr.h @@ -41,7 +41,7 @@ #include "eventdispatcher.h" #include "i18n.h" #include "log.h" -#include "command.h" +#include "control.h" #include "tcp.h" class RecInfo; diff --git a/vepgsettimer.cc b/vepgsettimer.cc index a941293..b6f74b3 100644 --- a/vepgsettimer.cc +++ b/vepgsettimer.cc @@ -26,7 +26,7 @@ #include "log.h" #include "vinfo.h" #include "message.h" -#include "command.h" +#include "control.h" #include "messagequeue.h" #include "video.h" #include "input.h" @@ -251,7 +251,7 @@ void VEpgSetTimer::doit() if (!vdr->isConnected()) { - Command::getInstance()->connectionLost(); + Control::getInstance()->connectionLost(); } if (ret == 0) logger->log("VEPGST", Log::DEBUG, "Success"); diff --git a/vepgsummary.cc b/vepgsummary.cc index d56dae8..4262dc9 100644 --- a/vepgsummary.cc +++ b/vepgsummary.cc @@ -27,7 +27,7 @@ #include "colour.h" #include "video.h" #include "i18n.h" -#include "command.h" +#include "control.h" #include "boxstack.h" #include "event.h" #include "channel.h" diff --git a/vmediaview.cc b/vmediaview.cc index 6aca5b8..f1fff11 100644 --- a/vmediaview.cc +++ b/vmediaview.cc @@ -35,7 +35,7 @@ #include "vinfo.h" #include "i18n.h" #include "message.h" -#include "command.h" +#include "control.h" #include "mediaoptions.h" #include "mediaplayer.h" #include "log.h" @@ -761,7 +761,7 @@ void VMediaView::processMessage(Message* m) player->shutdown(); player=NULL; } - Command::getInstance()->connectionLost(); + Control::getInstance()->connectionLost(); break; } } diff --git a/vopts.cc b/vopts.cc index 20b9be9..95c5fbf 100644 --- a/vopts.cc +++ b/vopts.cc @@ -32,7 +32,7 @@ #include "vdr.h" #include "messagequeue.h" #include "message.h" -#include "command.h" +#include "control.h" #include "staticartwork.h" #ifdef VOMP_PLATTFORM_MVP @@ -464,12 +464,12 @@ void VOpts::doSave() if (options[i]->userSetChoice == 1) { Log::getInstance()->log("Options", Log::DEBUG, "Setting classic menu"); - Command::getInstance()->setAdvMenus(false); + Control::getInstance()->setAdvMenus(false); } else { Log::getInstance()->log("Options", Log::DEBUG, "Setting advanced menu"); - Command::getInstance()->setAdvMenus(true); + Control::getInstance()->setAdvMenus(true); } break; } diff --git a/vradiorec.cc b/vradiorec.cc index deacb62..71d243c 100644 --- a/vradiorec.cc +++ b/vradiorec.cc @@ -17,7 +17,7 @@ along with VOMP. If not, see . */ -#include "command.h" +#include "control.h" #include "osd.h" #include "wsymbol.h" #include "recording.h" @@ -46,7 +46,7 @@ VRadioRec::VRadioRec(Recording* rec) startMargin = 0; endMargin = 0; - player = new PlayerRadioRec(Command::getInstance(), this); + player = new PlayerRadioRec(Control::getInstance(), this); char* cstartMargin = vdr->configLoad("Timers", "Start margin"); char* cendMargin = vdr->configLoad("Timers", "End margin"); @@ -148,7 +148,7 @@ void VRadioRec::go(bool resume) if (!vdr->isConnected()) { - Command::getInstance()->connectionLost(); + Control::getInstance()->connectionLost(); return; } @@ -313,7 +313,7 @@ void VRadioRec::processMessage(Message* m) { case PlayerRadioRec::CONNECTION_LOST: // connection lost detected { - // I can't handle this, send it to command + // I can't handle this, send it to control Message* m2 = new Message(); m2->p_to = Message::CONTROL; m2->message = Message::CONNECTION_LOST; @@ -344,7 +344,7 @@ void VRadioRec::stopPlay() playing = false; - if (!vdr->isConnected()) { Command::getInstance()->connectionLost(); return; } + if (!vdr->isConnected()) { Control::getInstance()->connectionLost(); return; } Log::getInstance()->log("VRadioRec", Log::DEBUG, "Post stopPlay"); } diff --git a/vrecordinglist.cc b/vrecordinglist.cc index 64641b9..cbbfe9b 100644 --- a/vrecordinglist.cc +++ b/vrecordinglist.cc @@ -33,7 +33,7 @@ #include "colour.h" #include "video.h" #include "i18n.h" -#include "command.h" +#include "control.h" #include "vinfo.h" #include "log.h" @@ -109,7 +109,7 @@ void VRecordingList::doDeleteSelected() int success = recman->deleteRecording(toDelete); if (!VDR::getInstance()->isConnected()) { - Command::getInstance()->connectionLost(); + Control::getInstance()->connectionLost(); return; } @@ -149,7 +149,7 @@ void VRecordingList::doMoveRecording(Directory* toDir) int success = recman->moveRecording(toMove, toDir); if (!VDR::getInstance()->isConnected()) { - Command::getInstance()->connectionLost(); + Control::getInstance()->connectionLost(); return; } diff --git a/vrecordinglistadvanced.cc b/vrecordinglistadvanced.cc index 9ed10d8..e557029 100644 --- a/vrecordinglistadvanced.cc +++ b/vrecordinglistadvanced.cc @@ -35,7 +35,7 @@ #include "colour.h" #include "video.h" #include "i18n.h" -#include "command.h" +#include "control.h" #include "vinfo.h" #include "log.h" #include "movieinfo.h" diff --git a/vrecordinglistclassic.cc b/vrecordinglistclassic.cc index b577596..fc1b7fa 100644 --- a/vrecordinglistclassic.cc +++ b/vrecordinglistclassic.cc @@ -31,7 +31,7 @@ #include "colour.h" #include "video.h" #include "i18n.h" -#include "command.h" +#include "control.h" #include "vinfo.h" #include "log.h" diff --git a/vtimerlist.cc b/vtimerlist.cc index 59bdd21..4b35947 100644 --- a/vtimerlist.cc +++ b/vtimerlist.cc @@ -29,7 +29,7 @@ #include "video.h" #include "i18n.h" #include "vtimeredit.h" -#include "command.h" +#include "control.h" #include "boxstack.h" #include "vinfo.h" #include "log.h" @@ -342,7 +342,7 @@ void VTimerList::processMessage(Message* m) ULONG retval = VDR::getInstance()->deleteTimer(recTimer); - if (!VDR::getInstance()->isConnected()) { Command::getInstance()->connectionLost(); return; } + if (!VDR::getInstance()->isConnected()) { Control::getInstance()->connectionLost(); return; } Log::getInstance()->log("VTimerList", Log::DEBUG, "Got return fron delete timer: %lu", retval); if (retval != 10) diff --git a/vvideolivetv.cc b/vvideolivetv.cc index b7bd885..2f3bb74 100644 --- a/vvideolivetv.cc +++ b/vvideolivetv.cc @@ -29,7 +29,7 @@ #include "boxstack.h" #include "colour.h" #include "osd.h" -#include "command.h" +#include "control.h" #include "i18n.h" #include "wtextbox.h" #include "input.h" @@ -88,12 +88,12 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V if ((*chanList)[currentChannelIndex]->type == VDR::VIDEO) { streamType = VDR::VIDEO; - player = new PlayerVideoLive(Command::getInstance(), this, this, chanList); + player = new PlayerVideoLive(Control::getInstance(), this, this, chanList); } else { streamType = VDR::RADIO; - player = new PlayerRadioLive(Command::getInstance(), this, chanList); + player = new PlayerRadioLive(Control::getInstance(), this, chanList); } player->init(); @@ -699,7 +699,7 @@ void VVideoLiveTV::doEPG() { if (osd.getVisible()) clearScreen(); - if (!Command::getInstance()->isAdvMenus()) + if (!Control::getInstance()->isAdvMenus()) { VEpg* vepg = new VEpg(this, currentChannelIndex, chanList); vepg->draw(); @@ -1119,7 +1119,7 @@ void VVideoLiveTV::processMessage(Message* m) case PlayerVideoLive::CONNECTION_LOST: // connection lost detected { Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Received connection lost from player"); - Command::getInstance()->connectionLost(); + Control::getInstance()->connectionLost(); break; } diff --git a/vvideomedia.cc b/vvideomedia.cc index 13ffe3c..03d8558 100644 --- a/vvideomedia.cc +++ b/vvideomedia.cc @@ -368,7 +368,7 @@ void VVideoMedia::processMessage(Message* m) { case PlayerMedia::CONNECTION_LOST: // connection lost detected { - // I can't handle this, send it to command + // I can't handle this, send it to control Message* m2 = new Message(); m2->p_to = Message::CONTROL; m2->message = Message::CONNECTION_LOST; diff --git a/vvideorec.cc b/vvideorec.cc index 792f318..0be40e1 100644 --- a/vvideorec.cc +++ b/vvideorec.cc @@ -19,7 +19,7 @@ #include -#include "command.h" +#include "control.h" #include "osd.h" #include "wsymbol.h" #include "audio.h" @@ -56,7 +56,7 @@ VVideoRec::VVideoRec(Recording* rec, bool ish264) video->seth264mode(ish264); - player = new PlayerVideoRec(Command::getInstance(), this, this); + player = new PlayerVideoRec(Control::getInstance(), this, this); player->init(myRec->IsPesRecording,myRec->recInfo->fps); char* cstartMargin = vdr->configLoad("Timers", "Start margin"); @@ -181,7 +181,7 @@ void VVideoRec::go(bool resume) if (!vdr->isConnected()) { - Command::getInstance()->connectionLost(); + Control::getInstance()->connectionLost(); return; } @@ -520,7 +520,7 @@ void VVideoRec::processMessage(Message* m) { case PlayerVideoRec::CONNECTION_LOST: // connection lost detected { - // I can't handle this, send it to command + // I can't handle this, send it to control Message* m2 = new Message(); m2->p_to = Message::CONTROL; m2->message = Message::CONNECTION_LOST; @@ -611,7 +611,7 @@ void VVideoRec::stopPlay() playing = false; - if (!vdr->isConnected()) { Command::getInstance()->connectionLost(); return; } + if (!vdr->isConnected()) { Control::getInstance()->connectionLost(); return; } Log::getInstance()->log("VVideoRec", Log::DEBUG, "Post stopPlay"); } diff --git a/vwelcome.cc b/vwelcome.cc index 4cfaa24..dc3655b 100644 --- a/vwelcome.cc +++ b/vwelcome.cc @@ -25,7 +25,7 @@ #include "vrecordinglistclassic.h" #include "vrecordinglistadvanced.h" #include "vtimerlist.h" -#include "command.h" +#include "control.h" #include "message.h" #include "colour.h" #include "video.h" @@ -235,7 +235,7 @@ int VWelcome::handleCommand(int command) } case Input::SEVEN: { - Command::getInstance()->doReboot(); + Control::getInstance()->doReboot(); return 2; } case Input::OK: @@ -273,7 +273,7 @@ int VWelcome::handleCommand(int command) } else if (option == 7) { - Command::getInstance()->doReboot(); + Control::getInstance()->doReboot(); return 2; } return 2; // never gets here @@ -315,7 +315,7 @@ void VWelcome::doChannelsList() } else { - Command::getInstance()->connectionLost(); + Control::getInstance()->connectionLost(); } } @@ -334,14 +334,14 @@ void VWelcome::doRadioList() } else { - Command::getInstance()->connectionLost(); + Control::getInstance()->connectionLost(); } } void VWelcome::doRecordingsList() { VRecordingList* vrec; - if (Command::getInstance()->isAdvMenus()) + if (Control::getInstance()->isAdvMenus()) vrec = new VRecordingListAdvanced(); else vrec = new VRecordingListClassic(); @@ -352,7 +352,7 @@ void VWelcome::doRecordingsList() if (!vrec->load()) { - Command::getInstance()->connectionLost(); + Control::getInstance()->connectionLost(); } } @@ -369,7 +369,7 @@ void VWelcome::doTimersList() if (!vtl->load()) { delete vtl; - Command::getInstance()->connectionLost(); + Control::getInstance()->connectionLost(); return; } diff --git a/winmain.cc b/winmain.cc index 631c70c..726eb25 100644 --- a/winmain.cc +++ b/winmain.cc @@ -46,7 +46,7 @@ #include "osdwinvector.h" #endif #include "boxstack.h" -#include "command.h" +#include "control.h" #include "wol.h" #include "vsleeptimer.h" #include "messagequeue.h" @@ -63,7 +63,7 @@ Led* led; Osd* osd; Timers* timers; BoxStack* boxstack; -Command* command; +Control* control; VDR* vdr; Video* video; Audio* audio; @@ -110,9 +110,9 @@ int getClockRealTime(struct timespec *tp){ return 0; } -DWORD WINAPI commandthreadStart(void *arg) +DWORD WINAPI controlthreadStart(void *arg) { - command->run(); + control->run(); return 0; } @@ -170,11 +170,11 @@ INT WINAPI WinMain( HINSTANCE hinst , HINSTANCE previnst, LPSTR cmdline, int cmd video = new VideoWin(); audio = new AudioWin(); boxstack = new BoxStack(); - command = new Command(); + control = new Control(); wol = new Wol(); sleeptimer = new Sleeptimer(); - if (!logger || !remote || !led || !osd || !video || !audio || !boxstack || !command || !sleeptimer) + if (!logger || !remote || !led || !osd || !video || !audio || !boxstack || !control || !sleeptimer) { ERROR_MSG("Could not create objects. Memory problems?\n"); shutdown(1); @@ -182,7 +182,7 @@ INT WINAPI WinMain( HINSTANCE hinst , HINSTANCE previnst, LPSTR cmdline, int cmd return 0; } - messageQueue = command; + messageQueue = control; // Get logging module started -------------------------------------------------------------------------------------- @@ -311,14 +311,14 @@ INT WINAPI WinMain( HINSTANCE hinst , HINSTANCE previnst, LPSTR cmdline, int cmd return 0; } - success = command->init(); + success = control->init(); if (success) { - logger->log("Core", Log::INFO, "Command module initialised"); + logger->log("Core", Log::INFO, "Control module initialised"); } else { - logger->log("Core", Log::EMERG, "Command module failed to initialise"); + logger->log("Core", Log::EMERG, "Control module failed to initialise"); shutdown(1); WSACleanup(); return 0; @@ -333,20 +333,20 @@ INT WINAPI WinMain( HINSTANCE hinst , HINSTANCE previnst, LPSTR cmdline, int cmd // Ok, all major device components and other bits are loaded and ready lastmousemove=timeGetTime(); - HANDLE commandthread; - commandthread= CreateThread(NULL, 0, commandthreadStart, NULL,0, + HANDLE controlthread; + controlthread= CreateThread(NULL, 0, controlthreadStart, NULL,0, NULL); MSG message; message.message=WM_NULL; bool run=true; - while(run && WaitForSingleObject(commandthread,0)==WAIT_TIMEOUT) { + while(run && WaitForSingleObject(controlthread,0)==WAIT_TIMEOUT) { if (PeekMessage(&message, NULL, 0,0,PM_REMOVE)!=0) { if (TranslateAccelerator(win_main,acc,&message)==NULL) { TranslateMessage(&message); DispatchMessage(&message); switch (message.message) { case WM_QUIT: - run=false; //TODO post exit to command Messages + run=false; //TODO post exit to control Messages }; } } else { @@ -356,7 +356,7 @@ INT WINAPI WinMain( HINSTANCE hinst , HINSTANCE previnst, LPSTR cmdline, int cmd } } // When that returns quit ------------------------------------------------------------------------------------------ - WaitForSingleObject(commandthread,INFINITE); + WaitForSingleObject(controlthread,INFINITE); shutdown(0); WSACleanup(); if (user32dll) FreeModule(user32dll); @@ -567,9 +567,9 @@ LONG FAR PASCAL WindowProc(HWND wind, UINT msg, WPARAM wparam, LPARAM lparam) switch (msg) { case WM_DESTROY: { - //TODO: call command + //TODO: call control logger->log("Core", Log::NOTICE, "Window closed, shutting down..."); - command->stop(); + control->stop(); PostQuitMessage(0); }break; case WM_SIZING: { @@ -837,11 +837,11 @@ void shutdown(int code) logger->log("Core", Log::NOTICE, "BoxStack module shut down"); } - if (command) // shut down command here in case views have posted messages + if (control) // shut down control here in case views have posted messages { - command->shutdown(); - delete command; - logger->log("Core", Log::NOTICE, "Command module shut down"); + control->shutdown(); + delete control; + logger->log("Core", Log::NOTICE, "Control module shut down"); } if (vdr) diff --git a/wremoteconfig.cc b/wremoteconfig.cc index 24e032c..fa5a13f 100644 --- a/wremoteconfig.cc +++ b/wremoteconfig.cc @@ -172,7 +172,7 @@ void WRemoteConfig::doSave() m->message = Message::CHANGED_REMOTECONTROL; m->to = parent; m->parameter = 0; - //Command::getInstance()->postMessage(m); + //Control::getInstance()->postMessage(m); } */ @@ -250,7 +250,7 @@ int WRemoteConfig::handleCommand(int command) m->message = Message::CLOSE_ME; m->from = this; m->to = viewman; - //Command::getInstance()->postMessage(m); + //Control::getInstance()->postMessage(m); return 2; */ } diff --git a/wwinaudiofilter.cc b/wwinaudiofilter.cc index bfa48a2..9e1737c 100644 --- a/wwinaudiofilter.cc +++ b/wwinaudiofilter.cc @@ -170,7 +170,7 @@ void WWinAudioFilter::doSave() m->message = Message::CHANGED_DEVICEOPTIONS; m->to = parent; m->parameter = 0; - //Command::getInstance()->postMessage(m); + //Control::getInstance()->postMessage(m); }*/ diff --git a/wwinmp3audiofilter.cc b/wwinmp3audiofilter.cc index 751cc1e..68e7019 100644 --- a/wwinmp3audiofilter.cc +++ b/wwinmp3audiofilter.cc @@ -178,7 +178,7 @@ void WWinMp3AudioFilter::processMessage(Message* m) m->message = Message::CHANGED_DEVICEOPTIONS; m->to = parent; m->parameter = 0; - //Command::getInstance()->postMessage(m); + //Control::getInstance()->postMessage(m); }*/ diff --git a/wwinvideofilter.cc b/wwinvideofilter.cc index d3a759f..8dd34e6 100644 --- a/wwinvideofilter.cc +++ b/wwinvideofilter.cc @@ -170,7 +170,7 @@ void WWinVideoFilter::doSave() m->message = Message::CHANGED_DEVICEOPTIONS; m->to = parent; m->parameter = 0; - //Command::getInstance()->postMessage(m); + //Control::getInstance()->postMessage(m); }*/ diff --git a/wwinvideoh264filter.cc b/wwinvideoh264filter.cc index c0c4e18..b82ccac 100644 --- a/wwinvideoh264filter.cc +++ b/wwinvideoh264filter.cc @@ -170,7 +170,7 @@ void WWinVideoH264Filter::doSave() m->message = Message::CHANGED_DEVICEOPTIONS; m->to = parent; m->parameter = 0; - //Command::getInstance()->postMessage(m); + //Control::getInstance()->postMessage(m); }*/ -- 2.39.5