cec: handle image view on and text view on
[deb_libcec.git] / src / lib / implementations / CECCommandHandler.cpp
index d1cfdf005f75f4c3c2fb11a8e2ce7617918280a4..0a39333e54c52f8a410f066481fe56062c78b0e1 100644 (file)
@@ -138,6 +138,12 @@ bool CCECCommandHandler::HandleCommand(const cec_command &command)
   case CEC_OPCODE_SET_OSD_NAME:
     HandleSetOSDName(command);
     break;
+  case CEC_OPCODE_IMAGE_VIEW_ON:
+    HandleImageViewOn(command);
+    break;
+  case CEC_OPCODE_TEXT_VIEW_ON:
+    HandleTextViewOn(command);
+    break;
   default:
     UnhandledCommand(command);
     bHandled = false;
@@ -283,6 +289,24 @@ bool CCECCommandHandler::HandleGivePhysicalAddress(const cec_command &command)
   return false;
 }
 
+bool CCECCommandHandler::HandleGiveSystemAudioModeStatus(const cec_command &command)
+{
+  if (m_busDevice->MyLogicalAddressContains(command.destination))
+  {
+    CCECBusDevice *device = GetDevice(command.destination);
+    if (device && device->GetType() == CEC_DEVICE_TYPE_AUDIO_SYSTEM)
+      return ((CCECAudioSystem *) device)->TransmitSystemAudioModeStatus(command.initiator);
+  }
+
+  return false;
+}
+
+bool CCECCommandHandler::HandleImageViewOn(const cec_command &command)
+{
+  m_busDevice->GetProcessor()->SetActiveSource(command.initiator);
+  return true;
+}
+
 bool CCECCommandHandler::HandleMenuRequest(const cec_command &command)
 {
   if (m_busDevice->MyLogicalAddressContains(command.destination))
@@ -475,16 +499,10 @@ bool CCECCommandHandler::HandleSystemAudioStatus(const cec_command &command)
   return false;
 }
 
-bool CCECCommandHandler::HandleGiveSystemAudioModeStatus(const cec_command &command)
+bool CCECCommandHandler::HandleTextViewOn(const cec_command &command)
 {
-  if (m_busDevice->MyLogicalAddressContains(command.destination))
-  {
-    CCECBusDevice *device = GetDevice(command.destination);
-    if (device && device->GetType() == CEC_DEVICE_TYPE_AUDIO_SYSTEM)
-      return ((CCECAudioSystem *) device)->TransmitSystemAudioModeStatus(command.initiator);
-  }
-
-  return false;
+  m_busDevice->GetProcessor()->SetActiveSource(command.initiator);
+  return true;
 }
 
 bool CCECCommandHandler::HandleUserControlPressed(const cec_command &command)