cec-config-gui: don't enable the 'connected device' selection when there's only one...
[deb_libcec.git] / src / lib / CECProcessor.cpp
index ebd17729f4e0355f3ad77ab8f2a30a3a85f70188..0ec1ef7e9b6959322f1418aed6178aab71df7a38 100644 (file)
@@ -60,10 +60,16 @@ CCECProcessor::CCECProcessor(CLibCEC *controller, const libcec_configuration *co
     m_iStandardLineTimeout(3),
     m_iRetryLineTimeout(3),
     m_iLastTransmission(0),
-    m_clientVersion(configuration->clientVersion)
+    m_clientVersion(configuration->clientVersion),
+    m_wakeDevices(configuration->wakeDevices)
 {
   m_logicalAddresses.Clear();
   CreateBusDevices();
+  if (configuration->tvVendor != CEC_VENDOR_UNKNOWN)
+  {
+    m_busDevices[CECDEVICE_TV]->SetVendorId((uint64_t)configuration->tvVendor);
+    m_busDevices[CECDEVICE_TV]->ReplaceHandler(false);
+  }
 }
 
 CCECProcessor::CCECProcessor(CLibCEC *controller, const char *strDeviceName, const cec_device_type_list &types, uint16_t iPhysicalAddress, cec_client_version clientVersion) :
@@ -81,6 +87,7 @@ CCECProcessor::CCECProcessor(CLibCEC *controller, const char *strDeviceName, con
     m_iLastTransmission(0),
     m_clientVersion(clientVersion)
 {
+  m_wakeDevices.Clear();
   m_logicalAddresses.Clear();
   CreateBusDevices();
 }
@@ -222,6 +229,12 @@ bool CCECProcessor::Initialise(void)
   else if (m_iPhysicalAddress == 0 && (bReturn = SetHDMIPort(m_iBaseDevice, m_iHDMIPort, true)) == false)
     CLibCEC::AddLog(CEC_LOG_ERROR, "unable to set HDMI port %d on %s (%x)", m_iHDMIPort, ToString(m_iBaseDevice), (uint8_t)m_iBaseDevice);
 
+  for (uint8_t iPtr = 0; iPtr <= 0xF; iPtr++)
+  {
+    if (m_wakeDevices[iPtr])
+      m_busDevices[iPtr]->PowerOn();
+  }
+
   SetInitialised(bReturn);
 
   return bReturn;