cec: refresh device statuses by default
authorLars Op den Kamp <lars@opdenkamp.eu>
Sun, 30 Oct 2011 19:01:04 +0000 (20:01 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Sun, 30 Oct 2011 19:01:04 +0000 (20:01 +0100)
src/lib/devices/CECBusDevice.cpp
src/lib/devices/CECBusDevice.h

index 05a8cdb4e5dd13b680288930d044ef9f1b97dac0..07d944eb32eefc0083d8356441f7ade4e9a6bac5 100644 (file)
@@ -386,9 +386,9 @@ bool CCECBusDevice::BroadcastActiveSource(void)
   return m_processor->Transmit(command);
 }
 
-cec_version CCECBusDevice::GetCecVersion(void)
+cec_version CCECBusDevice::GetCecVersion(bool bRefresh /* = true */)
 {
-  if (m_cecVersion == CEC_VERSION_UNKNOWN)
+  if (bRefresh || m_cecVersion == CEC_VERSION_UNKNOWN)
   {
     AddLog(CEC_LOG_NOTICE, "<< requesting CEC version");
     cec_command command;
@@ -401,9 +401,9 @@ cec_version CCECBusDevice::GetCecVersion(void)
   return m_cecVersion;
 }
 
-cec_menu_language &CCECBusDevice::GetMenuLanguage(void)
+cec_menu_language &CCECBusDevice::GetMenuLanguage(bool bRefresh /* = true */)
 {
-  if (!strcmp(m_menuLanguage.language, "???"))
+  if (bRefresh || !strcmp(m_menuLanguage.language, "???"))
   {
     AddLog(CEC_LOG_NOTICE, "<< requesting menu language");
     cec_command command;
@@ -416,9 +416,9 @@ cec_menu_language &CCECBusDevice::GetMenuLanguage(void)
   return m_menuLanguage;
 }
 
-cec_power_status CCECBusDevice::GetPowerStatus(void)
+cec_power_status CCECBusDevice::GetPowerStatus(bool bRefresh /* = true */)
 {
-  if (m_powerStatus == CEC_POWER_STATUS_UNKNOWN)
+  if (bRefresh || m_powerStatus == CEC_POWER_STATUS_UNKNOWN)
   {
     AddLog(CEC_LOG_NOTICE, "<< requesting power status");
     cec_command command;
index 66948ad82ce29f5b2098b761909d4210ad781dda..5971f58718a9fe929e78bddcfeffffb71c168aa2 100644 (file)
@@ -55,9 +55,9 @@ namespace CEC
     virtual uint64_t            GetLastActive(void) const { return m_iLastActive; }
     virtual cec_logical_address GetLogicalAddress(void) const { return m_iLogicalAddress; }
     virtual uint16_t            GetPhysicalAddress(void) const { return m_iPhysicalAddress; }
-    virtual cec_version         GetCecVersion(void);
-    virtual cec_menu_language & GetMenuLanguage(void);
-    virtual cec_power_status    GetPowerStatus(void);
+    virtual cec_version         GetCecVersion(bool bRefresh = true);
+    virtual cec_menu_language & GetMenuLanguage(bool bRefresh = true);
+    virtual cec_power_status    GetPowerStatus(bool bRefresh = true);
 
     virtual bool PowerOn(void);
     virtual bool Standby(void);