break;
case CEC_OPCODE_DECK_CONTROL:
HandleDeckControl(command);
+ /* pass to listeners */
+ m_busDevice->GetProcessor()->AddCommand(command);
break;
case CEC_OPCODE_MENU_REQUEST:
- HandleMenuRequest(command);
+ if (!HandleMenuRequest(command))
+ {
+ /* pass to listeners */
+ m_busDevice->GetProcessor()->AddCommand(command);
+ }
break;
case CEC_OPCODE_GIVE_DEVICE_POWER_STATUS:
HandleGiveDevicePowerStatus(command);
bool CCECCommandHandler::HandleDeckControl(const cec_command &command)
{
CCECBusDevice *device = GetDevice(command.destination);
- if (device && device->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE && command.parameters.size > 0)
+ if (device && (device->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE || device->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE) && command.parameters.size > 0)
{
((CCECPlaybackDevice *) device)->SetDeckControlMode((cec_deck_control_mode) command.parameters[0]);
return true;
bool CCECCommandHandler::HandleGiveDeckStatus(const cec_command &command)
{
CCECBusDevice *device = GetDevice(command.destination);
- if (device && device->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE)
+ if (device && (device->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE || device->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE))
return ((CCECPlaybackDevice *) device)->TransmitDeckStatus(command.initiator);
return false;
{
if (command.parameters.size >= 2)
{
- uint16_t streamaddr = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
+ uint16_t iStreamAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
CStdString strLog;
- strLog.Format(">> %i sets stream path to physical address %04x", command.initiator, streamaddr);
+ strLog.Format(">> %i sets stream path to physical address %04x", command.initiator, iStreamAddress);
m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str());
- return m_busDevice->GetProcessor()->SetStreamPath(streamaddr);
+ if (m_busDevice->GetProcessor()->SetStreamPath(iStreamAddress))
+ {
+ CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamAddress);
+ if (device)
+ {
+ return device->TransmitActiveSource() &&
+ device->TransmitMenuState(command.initiator);
+ }
+ }
+ return false;
}
return true;
}