+ CLockObject lock(m_mutex);
+ if (language.device == m_iLogicalAddress)
+ {
+ CLibCEC::AddLog(CEC_LOG_DEBUG, ">> %s (%X): menu language set to '%s'", GetLogicalAddressName(), m_iLogicalAddress, language.language);
+ m_menuLanguage = language;
+ }
+}
+
+void CCECBusDevice::SetOSDName(CStdString strName)
+{
+ CLockObject lock(m_mutex);
+ if (m_strDeviceName != strName)
+ {
+ CLibCEC::AddLog(CEC_LOG_DEBUG, ">> %s (%X): osd name set to '%s'", GetLogicalAddressName(), m_iLogicalAddress, strName.c_str());
+ m_strDeviceName = strName;
+ }
+}
+
+void CCECBusDevice::SetMenuState(const cec_menu_state state)
+{
+ CLockObject lock(m_mutex);
+ if (m_menuState != state)
+ {
+ CLibCEC::AddLog(CEC_LOG_DEBUG, ">> %s (%X): menu state set to '%s'", GetLogicalAddressName(), m_iLogicalAddress, ToString(m_menuState));
+ m_menuState = state;
+ }
+}
+
+void CCECBusDevice::SetInactiveSource(void)
+{
+ {
+ CLockObject lock(m_mutex);
+ m_bActiveSource = false;
+ }
+
+ if (MyLogicalAddressContains(m_iLogicalAddress))
+ SetPowerStatus(CEC_POWER_STATUS_STANDBY);
+}
+
+void CCECBusDevice::SetActiveSource(void)
+{
+ CLockObject lock(m_mutex);
+ if (!m_bActiveSource)
+ CLibCEC::AddLog(CEC_LOG_DEBUG, "making %s (%x) the active source", GetLogicalAddressName(), m_iLogicalAddress);
+
+ for (int iPtr = 0; iPtr < 16; iPtr++)
+ if (iPtr != m_iLogicalAddress)
+ m_processor->m_busDevices[iPtr]->SetInactiveSource();
+
+ m_bActiveSource = true;
+ m_powerStatus = CEC_POWER_STATUS_ON;
+}
+
+bool CCECBusDevice::TryLogicalAddress(void)
+{
+ CLibCEC::AddLog(CEC_LOG_DEBUG, "trying logical address '%s'", GetLogicalAddressName());
+
+ m_processor->SetAckMask(0);
+ if (!TransmitPoll(m_iLogicalAddress))
+ {
+ CLibCEC::AddLog(CEC_LOG_NOTICE, "using logical address '%s'", GetLogicalAddressName());
+ SetDeviceStatus(CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC);
+
+ return true;
+ }
+
+ CLibCEC::AddLog(CEC_LOG_DEBUG, "logical address '%s' already taken", GetLogicalAddressName());
+ SetDeviceStatus(CEC_DEVICE_STATUS_PRESENT);