]> git.vomp.tv Git - vompclient-marten.git/commitdiff
Report to libcec the current power state
authorMarten Richter <marten.richter@freenet.de>
Wed, 21 Aug 2013 10:31:23 +0000 (12:31 +0200)
committerMarten Richter <marten.richter@freenet.de>
Wed, 21 Aug 2013 10:31:23 +0000 (12:31 +0200)
command.cc
remote.h
remotelinux.cc
remotelinux.h

index 6fb521e63910e27e78998861fb837f03acdd6f7c..8368a9b126a6c542ac66830001bce6e4410e685d 100644 (file)
@@ -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
index b51781116a3c3c2fd871fcb3b3e676b8b5e6a2bd..72c0292ee91cf68227f6cf193edc3d958cc943c9 100644 (file)
--- 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;
index fad7baf95743bd41ab665f2aef51d096cd6e09ee..77d50b92893c7493885682cbd929d861240e9cfc 100644 (file)
@@ -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)
 {
index 0c96427f6ba3dabd87b49c35a6780b743e8f9afb..9f65884135997551356c8198272a2055e8486e55 100644 (file)
@@ -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);