*/
#include "CECAudioSystem.h"
+#include "../CECProcessor.h"
using namespace CEC;
m_type = CEC_DEVICE_TYPE_AUDIO_SYSTEM;
m_strDeviceName = "Audio";
}
+
+bool CCECAudioSystem::TransmitAudioStatus(cec_logical_address dest)
+{
+ // TODO
+ CStdString strLog;
+ strLog.Format("<< %x -> %x: audio status feature abort", m_iLogicalAddress, dest);
+ AddLog(CEC_LOG_NOTICE, strLog);
+
+ m_processor->TransmitAbort(dest, CEC_OPCODE_GIVE_AUDIO_STATUS);
+ return false;
+}
virtual uint16_t GetMyPhysicalAddress(void) const;
virtual uint16_t GetPhysicalAddress(void) const { return m_iPhysicalAddress; }
virtual cec_power_status GetPowerStatus(void);
- virtual CCECProcessor * GetProcessor() const { return m_processor; }
+ virtual CCECProcessor * GetProcessor(void) const { return m_processor; }
+ virtual cec_device_type GetType(void) const { return m_type; }
virtual const cec_vendor & GetVendor(void);
virtual uint8_t GetVendorClass(void) const { return m_iVendorClass; }
virtual cec_vendor_id GetVendorId(void) { return GetVendor().vendor; };
#include "CECCommandHandler.h"
#include "../devices/CECBusDevice.h"
+#include "../devices/CECAudioSystem.h"
#include "../CECProcessor.h"
using namespace CEC;
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);
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);
virtual cec_vendor_id GetVendorId(void) { return CEC_VENDOR_UNKNOWN; };
protected:
- bool HandleDeviceCecVersion(const cec_command &command);
- bool HandleDeviceVendorCommandWithId(const cec_command &command);
- bool HandleDeviceVendorId(const cec_command &command);
- bool HandleGetCecVersion(const cec_command &command);
- bool HandleGiveDeckStatus(const cec_command &command);
- bool HandleGiveDevicePowerStatus(const cec_command &command);
- bool HandleGiveDeviceVendorId(const cec_command &command);
- bool HandleGiveOSDName(const cec_command &command);
- bool HandleGivePhysicalAddress(const cec_command &command);
- bool HandleMenuRequest(const cec_command &command);
- bool HandleReportPowerStatus(const cec_command &command);
- bool HandleRequestActiveSource(const cec_command &command);
- bool HandleRoutingChange(const cec_command &command);
- bool HandleSetMenuLanguage(const cec_command &command);
- bool HandleSetStreamPath(const cec_command &command);
- bool HandleUserControlPressed(const cec_command &command);
- bool HandleUserControlRelease(const cec_command &command);
- void UnhandledCommand(const cec_command &command);
+ virtual bool HandleDeviceCecVersion(const cec_command &command);
+ virtual bool HandleDeviceVendorCommandWithId(const cec_command &command);
+ virtual bool HandleDeviceVendorId(const cec_command &command);
+ virtual bool HandleGetCecVersion(const cec_command &command);
+ virtual bool HandleGiveAudioStatus(const cec_command &command);
+ virtual bool HandleGiveDeckStatus(const cec_command &command);
+ virtual bool HandleGiveDevicePowerStatus(const cec_command &command);
+ virtual bool HandleGiveDeviceVendorId(const cec_command &command);
+ virtual bool HandleGiveOSDName(const cec_command &command);
+ virtual bool HandleGivePhysicalAddress(const cec_command &command);
+ virtual bool HandleMenuRequest(const cec_command &command);
+ virtual bool HandleReportPowerStatus(const cec_command &command);
+ virtual bool HandleRequestActiveSource(const cec_command &command);
+ virtual bool HandleRoutingChange(const cec_command &command);
+ virtual bool HandleSetMenuLanguage(const cec_command &command);
+ virtual bool HandleSetStreamPath(const cec_command &command);
+ virtual bool HandleUserControlPressed(const cec_command &command);
+ virtual bool HandleUserControlRelease(const cec_command &command);
+ virtual void UnhandledCommand(const cec_command &command);
- void SendToCommandBuffer(const cec_command &command);
-
- CCECBusDevice *GetDevice(cec_logical_address iLogicalAddress) const;
+ virtual CCECBusDevice *GetDevice(cec_logical_address iLogicalAddress) const;
CCECBusDevice *m_busDevice;
};
};