+ {
+ m_bSLEnabled = true;
+
+ device->SetPowerStatus(CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON); //XXX
+ device->TransmitPowerState(command.initiator);
+ device->SetPowerStatus(CEC_POWER_STATUS_ON);
+
+ device->SetActiveSource();
+ TransmitImageViewOn(device->GetLogicalAddress(), command.initiator);
+ }
+}
+void CSLCommandHandler::HandleVendorCommandPowerOnStatus(const cec_command &command)
+{
+ if (command.destination != CECDEVICE_BROADCAST)
+ {
+ CCECBusDevice *device = m_processor->m_busDevices[m_processor->GetLogicalAddresses().primary];
+ device->SetPowerStatus(CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON);
+ device->TransmitPowerState(command.initiator);
+ device->SetPowerStatus(CEC_POWER_STATUS_ON);
+ }
+}
+
+void CSLCommandHandler::HandleVendorCommandSLConnect(const cec_command &command)
+{
+ m_bSLEnabled = true;
+ TransmitVendorCommandSetDeviceMode(m_processor->GetLogicalAddress(), command.initiator, CEC_DEVICE_TYPE_RECORDING_DEVICE);
+
+ ActivateSource();
+}
+
+void CSLCommandHandler::TransmitVendorCommandSetDeviceMode(const cec_logical_address iSource, const cec_logical_address iDestination, const cec_device_type type)
+{
+ cec_command response;
+ cec_command::Format(response, iSource, iDestination, CEC_OPCODE_VENDOR_COMMAND);
+ response.PushBack(SL_COMMAND_SET_DEVICE_MODE);
+ response.PushBack((uint8_t)type);
+ Transmit(response, false);
+}
+
+bool CSLCommandHandler::HandleGiveDeckStatus(const cec_command &command)
+{
+ if (m_processor->IsRunning() && m_busDevice->MyLogicalAddressContains(command.destination))
+ {
+ CCECBusDevice *device = GetDevice(command.destination);
+ if (device && (device->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE || device->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE))
+ {
+ if (command.parameters.size > 0)
+ {
+ if (command.parameters[0] == CEC_STATUS_REQUEST_ON)
+ {
+ ((CCECPlaybackDevice *) device)->SetDeckStatus(CEC_DECK_INFO_STOP);
+ return ((CCECPlaybackDevice *) device)->TransmitDeckStatus(command.initiator) &&
+ device->TransmitImageViewOn() &&
+ device->TransmitPhysicalAddress();
+ }
+ else if (command.parameters[0] == CEC_STATUS_REQUEST_ONCE)
+ {
+ ((CCECPlaybackDevice *) device)->SetDeckStatus(CEC_DECK_INFO_OTHER_STATUS_LG);
+ return ((CCECPlaybackDevice *) device)->TransmitDeckStatus(command.initiator);
+ }
+ }
+ }
+ return CCECCommandHandler::HandleGiveDeckStatus(command);
+ }