cec: handle GiveAudioStatus. currently send a feature abort
[deb_libcec.git] / src / lib / implementations / CECCommandHandler.cpp
index 2324c2011d9664a04d361e3210398fcf00baaf16..94348676b94600b020b27405667ddf7468140a98 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "CECCommandHandler.h"
 #include "../devices/CECBusDevice.h"
+#include "../devices/CECAudioSystem.h"
 #include "../CECProcessor.h"
 
 using namespace CEC;
@@ -92,6 +93,9 @@ bool CCECCommandHandler::HandleCommand(const cec_command &command)
     case CEC_OPCODE_USER_CONTROL_RELEASE:
       HandleUserControlRelease(command);
       break;
+    case CEC_OPCODE_GIVE_AUDIO_STATUS:
+      HandleGiveAudioStatus(command);
+      break;
     default:
       UnhandledCommand(command);
       m_busDevice->GetProcessor()->AddCommand(command);
@@ -182,6 +186,15 @@ bool CCECCommandHandler::HandleGetCecVersion(const cec_command &command)
   return false;
 }
 
+bool CCECCommandHandler::HandleGiveAudioStatus(const cec_command &command)
+{
+  CCECBusDevice *device = GetDevice(command.destination);
+  if (device && device->GetType() == CEC_DEVICE_TYPE_AUDIO_SYSTEM)
+    return ((CCECAudioSystem *) device)->TransmitAudioStatus(command.initiator);
+
+  return false;
+}
+
 bool CCECCommandHandler::HandleGiveDeckStatus(const cec_command &command)
 {
   CCECBusDevice *device = GetDevice(command.destination);