cec: added GetActiveSource()/cec_get_active_source() and IsActiveSource()/cec_is_acti...
[deb_libcec.git] / src / lib / CECProcessor.cpp
index 46e3419d484c38ddc2a8aea86b9cd99c5157ed92..b07f2ddc72bbfcc6c61d85c440b814bc4707ca20 100644 (file)
@@ -684,6 +684,22 @@ cec_power_status CCECProcessor::GetDevicePowerStatus(cec_logical_address iAddres
   return CEC_POWER_STATUS_UNKNOWN;
 }
 
+cec_logical_address CCECProcessor::GetActiveSource(void)
+{
+  for (uint8_t iPtr = 0; iPtr <= 11; iPtr++)
+  {
+    if (m_busDevices[iPtr]->IsActiveSource())
+      return (cec_logical_address)iPtr;
+  }
+
+  return CECDEVICE_UNKNOWN;
+}
+
+bool CCECProcessor::IsActiveSource(cec_logical_address iAddress)
+{
+  return m_busDevices[iAddress]->IsActiveSource();
+}
+
 bool CCECProcessor::Transmit(const cec_command &data)
 {
   bool bReturn(false);