-void CCECProcessor::ReportPowerState(cec_logical_address address /*= CECDEVICE_TV */, bool bOn /* = true */)
-{
- cec_frame frame;
- frame.clear();
-
- if (bOn)
- m_controller->AddLog(CEC_LOG_NOTICE, "<< reporting \"On\" power status");
- else
- m_controller->AddLog(CEC_LOG_NOTICE, "<< reporting \"Off\" power status");
-
- frame.push_back(GetSourceDestination(address));
- frame.push_back((uint8_t) CEC_OPCODE_REPORT_POWER_STATUS);
- frame.push_back(bOn ? (uint8_t) CEC_POWER_STATUS_ON : (uint8_t) CEC_POWER_STATUS_STANDBY);
- Transmit(frame);
-}
-
-void CCECProcessor::ReportMenuState(cec_logical_address address /* = CECDEVICE_TV */, bool bActive /* = true */)
-{
- cec_frame frame;
- frame.clear();
-
- if (bActive)
- m_controller->AddLog(CEC_LOG_NOTICE, "<< reporting menu state as active");
- else
- m_controller->AddLog(CEC_LOG_NOTICE, "<< reporting menu state as inactive");
-
- frame.push_back(GetSourceDestination(address));
- frame.push_back((uint8_t) CEC_OPCODE_MENU_STATUS);
- frame.push_back(bActive ? (uint8_t) CEC_MENU_STATE_ACTIVATED : (uint8_t) CEC_MENU_STATE_DEACTIVATED);
- Transmit(frame);
-}
-
-void CCECProcessor::ReportVendorID(cec_logical_address address /* = CECDEVICE_TV */)
-{
- m_controller->AddLog(CEC_LOG_NOTICE, "<< vendor ID requested, feature abort");
- TransmitAbort(address, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID);
-}
-
-void CCECProcessor::ReportOSDName(cec_logical_address address /* = CECDEVICE_TV */)
-{
- cec_frame frame;
- frame.clear();
-
- const char *osdname = m_strDeviceName.c_str();
- CStdString strLog;
- strLog.Format("<< reporting OSD name as %s", osdname);
- m_controller->AddLog(CEC_LOG_NOTICE, strLog.c_str());
- frame.push_back(GetSourceDestination(address));
- frame.push_back((uint8_t) CEC_OPCODE_SET_OSD_NAME);
-
- for (unsigned int i = 0; i < strlen(osdname); i++)
- frame.push_back(osdname[i]);
-
- Transmit(frame);
-}
-
-void CCECProcessor::ReportPhysicalAddress(void)
-{
- cec_frame frame;
- frame.clear();
-
- CStdString strLog;
- strLog.Format("<< reporting physical address as %04x", m_physicaladdress);
- m_controller->AddLog(CEC_LOG_NOTICE, strLog.c_str());
- frame.push_back(GetSourceDestination(CECDEVICE_BROADCAST));
- frame.push_back((uint8_t) CEC_OPCODE_REPORT_PHYSICAL_ADDRESS);
- frame.push_back((uint8_t) ((m_physicaladdress >> 8) & 0xFF));
- frame.push_back((uint8_t) (m_physicaladdress & 0xFF));
- frame.push_back((uint8_t) CEC_DEVICE_TYPE_PLAYBACK_DEVICE);
- Transmit(frame);
-}
-
-void CCECProcessor::BroadcastActiveSource(void)
-{
- cec_frame frame;
- frame.clear();
-
- m_controller->AddLog(CEC_LOG_NOTICE, "<< broadcasting active source");
- frame.push_back(GetSourceDestination(CECDEVICE_BROADCAST));
- frame.push_back((uint8_t) CEC_OPCODE_ACTIVE_SOURCE);
- frame.push_back((uint8_t) ((m_physicaladdress >> 8) & 0xFF));
- frame.push_back((uint8_t) (m_physicaladdress & 0xFF));
- Transmit(frame);
-}
-
-uint8_t CCECProcessor::GetSourceDestination(cec_logical_address destination /* = CECDEVICE_BROADCAST */) const
-{
- return ((uint8_t)m_iLogicalAddress << 4) + (uint8_t)destination;