- if (command.parameters[0] <= CEC_USER_CONTROL_CODE_MAX)
- m_controller->SetCurrentButton((cec_user_control_code) command.parameters[0]);
- }
- break;
- case CEC_OPCODE_USER_CONTROL_RELEASE:
- m_controller->AddKey();
- break;
- case CEC_OPCODE_ROUTING_CHANGE:
- m_controller->SetActiveView();
- break;
- default:
- m_controller->AddCommand(command);
- break;
- }
- }
- else if (command.destination == CECDEVICE_BROADCAST)
- {
- CStdString strLog;
- if (command.opcode == CEC_OPCODE_REQUEST_ACTIVE_SOURCE)
- {
- strLog.Format(">> %i requests active source", (uint8_t) command.initiator);
- m_controller->AddLog(CEC_LOG_DEBUG, strLog.c_str());
- BroadcastActiveSource();
- }
- else if (command.opcode == CEC_OPCODE_SET_STREAM_PATH)
- {
- if (command.parameters.size >= 2)
- {
- int streamaddr = ((int)command.parameters[0] << 8) | ((int)command.parameters[1]);
- strLog.Format(">> %i requests stream path from physical address %04x", command.initiator, streamaddr);
- m_controller->AddLog(CEC_LOG_DEBUG, strLog.c_str());
- if (streamaddr == m_physicaladdress)
- BroadcastActiveSource();
- }
- }
- else
- {
- m_controller->AddCommand(command);
- }
- }
- else
- {
- CStdString strLog;
- strLog.Format("ignoring frame: destination: %u != %u", command.destination, (uint8_t)m_iLogicalAddress);
- m_controller->AddLog(CEC_LOG_DEBUG, strLog.c_str());
- }