X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FCECProcessor.cpp;h=cc8d86eb471e844345b8c4c0276536072ba4db63;hb=3557c68d1c9f4ce0191163a4ab48b6c5cec68488;hp=cf3ea3f39631b9b71daf41697658fd843acfae78;hpb=c409848208093a15758c91e3fab9fbe806a62e12;p=deb_libcec.git diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index cf3ea3f..cc8d86e 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -320,7 +320,7 @@ bool CCECProcessor::SetActiveView(void) return SetActiveSource(); } -bool CCECProcessor::SetDeckControlMode(cec_deck_control_mode mode) +bool CCECProcessor::SetDeckControlMode(cec_deck_control_mode mode, bool bSendUpdate /* = true */) { bool bReturn(false); @@ -328,13 +328,15 @@ bool CCECProcessor::SetDeckControlMode(cec_deck_control_mode mode) if (device) { ((CCECPlaybackDevice *) device)->SetDeckControlMode(mode); + if (bSendUpdate) + ((CCECPlaybackDevice *) device)->TransmitDeckStatus(CECDEVICE_TV); bReturn = true; } return bReturn; } -bool CCECProcessor::SetDeckInfo(cec_deck_info info) +bool CCECProcessor::SetDeckInfo(cec_deck_info info, bool bSendUpdate /* = true */) { bool bReturn(false); @@ -342,6 +344,8 @@ bool CCECProcessor::SetDeckInfo(cec_deck_info info) if (device) { ((CCECPlaybackDevice *) device)->SetDeckStatus(info); + if (bSendUpdate) + ((CCECPlaybackDevice *) device)->TransmitDeckStatus(CECDEVICE_TV); bReturn = true; } @@ -361,10 +365,7 @@ bool CCECProcessor::SetStreamPath(uint16_t iStreamPath) device->m_bActiveSource = true; device->m_powerStatus = CEC_POWER_STATUS_ON; - if (m_logicalAddresses.isset(device->m_iLogicalAddress)) - bReturn = device->TransmitActiveSource(); - else - bReturn = true; + bReturn = true; } return bReturn; @@ -407,6 +408,20 @@ bool CCECProcessor::SetLogicalAddress(cec_logical_address iLogicalAddress) return true; } +bool CCECProcessor::SetMenuState(cec_menu_state state, bool bSendUpdate /* = true */) +{ + for (uint8_t iPtr = 0; iPtr < 16; iPtr++) + { + if (m_logicalAddresses[iPtr]) + m_busDevices[iPtr]->SetMenuState(state); + } + + if (bSendUpdate) + m_busDevices[m_logicalAddresses.primary]->TransmitMenuState(CECDEVICE_TV); + + return true; +} + bool CCECProcessor::SetPhysicalAddress(uint16_t iPhysicalAddress) { if (!m_logicalAddresses.empty() && m_busDevices[m_logicalAddresses.primary]) @@ -644,7 +659,7 @@ void CCECProcessor::ParseCommand(cec_command &command) dataStr.AppendFormat(":%02x", (unsigned int)command.parameters[iPtr]); m_controller->AddLog(CEC_LOG_TRAFFIC, dataStr.c_str()); - if (!m_bMonitor) + if (!m_bMonitor && command.initiator >= CECDEVICE_TV && command.initiator < CECDEVICE_BROADCAST) m_busDevices[(uint8_t)command.initiator]->HandleCommand(command); }