From e1a9636212b506a0c6603d5cfc188d1afe03453b Mon Sep 17 00:00:00 2001 From: Marten Richter Date: Wed, 21 Aug 2013 12:31:23 +0200 Subject: [PATCH] Report to libcec the current power state --- command.cc | 2 ++ remote.h | 2 ++ remotelinux.cc | 12 ++++++++++++ remotelinux.h | 2 ++ 4 files changed, 18 insertions(+) diff --git a/command.cc b/command.cc index 6fb521e..8368a9b 100644 --- a/command.cc +++ b/command.cc @@ -537,6 +537,7 @@ void Command::doStandby() { Video::getInstance()->signalOn(); Led::getInstance()->on(); + Remote::getInstance()->changePowerState(true); isStandby = 0; @@ -554,6 +555,7 @@ void Command::doStandby() logger->unsetExternLogger(); VDR::getInstance()->disconnect(); Led::getInstance()->off(); + Remote::getInstance()->changePowerState(false); isStandby = 1; Sleeptimer::getInstance()->shutdown(); #ifdef WIN32 diff --git a/remote.h b/remote.h index b517811..72c0292 100644 --- a/remote.h +++ b/remote.h @@ -69,6 +69,8 @@ class Remote: public AbstractOption void EnterLearnMode(UCHAR command); void ResetToDefault(); + virtual void changePowerState(bool poweron) {}; //informs the remote control, that about vomp's power state, this is important e.g. for cec + const static ULONG NOLEARNMODE = 256; // Not buttons const static UCHAR NA_LEARN = 101; diff --git a/remotelinux.cc b/remotelinux.cc index fad7baf..77d50b9 100644 --- a/remotelinux.cc +++ b/remotelinux.cc @@ -876,6 +876,18 @@ char* RemoteLinux::HCWDesc(unsigned long long hcw) return rt; } +void RemoteLinux::changePowerState(bool poweron){ + if (cec_adap) { + if (poweron) { + Log::getInstance()->log("Remote", Log::DEBUG, "CEC set active source" ); + cec_adap->SetActiveSource(); + } else { + Log::getInstance()->log("Remote", Log::DEBUG, "CEC set inactive view" ); + cec_adap->SetInactiveView(); + } + } +} + int RemoteLinux::cecLogMessage(void *param, const cec_log_message &message) { diff --git a/remotelinux.h b/remotelinux.h index 0c96427..9f65884 100644 --- a/remotelinux.h +++ b/remotelinux.h @@ -52,6 +52,8 @@ class RemoteLinux : public Remote const char*HardcodedTranslateStr(UCHAR command); char* HCWDesc(ULLONG hcw); + void changePowerState(bool poweron); + bool loadOptionsfromServer(VDR* vdr); bool saveOptionstoServer(); bool addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane); -- 2.39.5