+ CLockObject lock(m_mutex);
+ lang[0] = language.language[0];
+ lang[1] = language.language[1];
+ lang[2] = language.language[2];
+ }
+
+ MarkBusy();
+ if (lang[0] == '?' && lang[1] == '?' && lang[2] == '?')
+ {
+ LIB_CEC->AddLog(CEC_LOG_NOTICE, "<< %s (%X) -> %s (%X): Menu language feature abort", GetLogicalAddressName(), m_iLogicalAddress, ToString(destination), destination);
+ m_processor->TransmitAbort(m_iLogicalAddress, destination, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID);
+ bReturn = true;
+ }
+ else
+ {
+ LIB_CEC->AddLog(CEC_LOG_NOTICE, "<< %s (%X) -> broadcast (F): Menu language '%s'", GetLogicalAddressName(), m_iLogicalAddress, lang);
+ bReturn = m_handler->TransmitSetMenuLanguage(m_iLogicalAddress, lang, bIsReply);
+ }
+ MarkReady();
+ return bReturn;
+}
+
+bool CCECBusDevice::TransmitOSDString(const cec_logical_address destination, cec_display_control duration, const char *strMessage, bool bIsReply)
+{
+ bool bReturn(false);
+ if (!m_processor->GetDevice(destination)->IsUnsupportedFeature(CEC_OPCODE_SET_OSD_STRING))
+ {
+ LIB_CEC->AddLog(CEC_LOG_NOTICE, "<< %s (%X) -> %s (%X): display OSD message '%s'", GetLogicalAddressName(), m_iLogicalAddress, ToString(destination), destination, strMessage);
+ MarkBusy();
+ bReturn = m_handler->TransmitOSDString(m_iLogicalAddress, destination, duration, strMessage, bIsReply);
+ MarkReady();
+ }
+ return bReturn;
+}
+
+CStdString CCECBusDevice::GetCurrentOSDName(void)
+{
+ CLockObject lock(m_mutex);
+ return m_strDeviceName;
+}
+
+CStdString CCECBusDevice::GetOSDName(const cec_logical_address initiator, bool bUpdate /* = false */)
+{
+ bool bIsPresent(GetStatus() == CEC_DEVICE_STATUS_PRESENT);
+ bool bRequestUpdate(false);
+ {
+ CLockObject lock(m_mutex);
+ bRequestUpdate = bIsPresent &&
+ (bUpdate || m_strDeviceName.Equals(ToString(m_iLogicalAddress))) &&
+ m_type != CEC_DEVICE_TYPE_TV;
+ }
+
+ if (bRequestUpdate)
+ {
+ CheckVendorIdRequested(initiator);
+ RequestOSDName(initiator);
+ }
+
+ CLockObject lock(m_mutex);
+ return m_strDeviceName;
+}
+
+void CCECBusDevice::SetOSDName(CStdString strName)
+{
+ CLockObject lock(m_mutex);
+ if (m_strDeviceName != strName)
+ {
+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s (%X): osd name set to '%s'", GetLogicalAddressName(), m_iLogicalAddress, strName.c_str());
+ m_strDeviceName = strName;
+ }
+}
+
+bool CCECBusDevice::RequestOSDName(const cec_logical_address initiator, bool bWaitForResponse /* = true */)
+{
+ bool bReturn(false);
+
+ if (!IsHandledByLibCEC() &&
+ !IsUnsupportedFeature(CEC_OPCODE_GIVE_OSD_NAME))
+ {
+ MarkBusy();
+ LIB_CEC->AddLog(CEC_LOG_NOTICE, "<< requesting OSD name of '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress);
+ bReturn = m_handler->TransmitRequestOSDName(initiator, m_iLogicalAddress, bWaitForResponse);
+ MarkReady();
+ }
+ return bReturn;
+}
+
+bool CCECBusDevice::TransmitOSDName(const cec_logical_address destination, bool bIsReply)
+{
+ CStdString strDeviceName;
+ {
+ CLockObject lock(m_mutex);
+ LIB_CEC->AddLog(CEC_LOG_NOTICE, "<< %s (%X) -> %s (%X): OSD name '%s'", GetLogicalAddressName(), m_iLogicalAddress, ToString(destination), destination, m_strDeviceName.c_str());
+ strDeviceName = m_strDeviceName;
+ }
+
+ MarkBusy();
+ bool bReturn = m_handler->TransmitOSDName(m_iLogicalAddress, destination, strDeviceName, bIsReply);
+ MarkReady();
+ return bReturn;
+}
+
+bool CCECBusDevice::HasValidPhysicalAddress(void)
+{
+ CLockObject lock(m_mutex);
+ return CLibCEC::IsValidPhysicalAddress(m_iPhysicalAddress);
+}
+
+uint16_t CCECBusDevice::GetCurrentPhysicalAddress(void)
+{
+ CLockObject lock(m_mutex);
+ return m_iPhysicalAddress;
+}
+
+uint16_t CCECBusDevice::GetPhysicalAddress(const cec_logical_address initiator, bool bSuppressUpdate /* = false */)
+{
+ if (!bSuppressUpdate)
+ {
+ bool bIsPresent(GetStatus() == CEC_DEVICE_STATUS_PRESENT);
+ bool bRequestUpdate(false);