X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FCECProcessor.h;h=05dc4b28ae5c8c0382e5df8f223f5ca75491361c;hb=d2f1c15733e3f6f2c8a17abfd3c6612ea93ce734;hp=a0192f24d451c9b39c03d5ad4fd76a3ad91ccf9b;hpb=a9232a79cfb71be51caea8aae6c8ea63ae3884ad;p=deb_libcec.git diff --git a/src/lib/CECProcessor.h b/src/lib/CECProcessor.h index a0192f2..05dc4b2 100644 --- a/src/lib/CECProcessor.h +++ b/src/lib/CECProcessor.h @@ -57,28 +57,51 @@ namespace CEC virtual void *Process(void); virtual bool IsMonitoring(void) const { return m_bMonitor; } - virtual CCECBusDevice * GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress) const; + virtual CCECBusDevice * GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress, bool bRefresh = false) const; virtual CCECBusDevice * GetDeviceByType(cec_device_type type) const; virtual cec_version GetDeviceCecVersion(cec_logical_address iAddress); virtual bool GetDeviceMenuLanguage(cec_logical_address iAddress, cec_menu_language *language); virtual const std::string & GetDeviceName(void) { return m_strDeviceName; } + virtual cec_osd_name GetDeviceOSDName(cec_logical_address iAddress); virtual uint64_t GetDeviceVendorId(cec_logical_address iAddress); virtual cec_power_status GetDevicePowerStatus(cec_logical_address iAddress); virtual cec_logical_address GetLogicalAddress(void) const { return m_logicalAddresses.primary; } virtual cec_logical_addresses GetLogicalAddresses(void) const { return m_logicalAddresses; } - virtual bool HasLogicalAddress(cec_logical_address address) const { return m_logicalAddresses.isset(address); } + virtual cec_logical_addresses GetActiveDevices(void); + virtual bool HasLogicalAddress(cec_logical_address address) const { return m_logicalAddresses.IsSet(address); } + virtual bool IsActiveDevice(cec_logical_address address); + virtual bool IsActiveDeviceType(cec_device_type type); virtual uint16_t GetPhysicalAddress(void) const; virtual bool SetActiveView(void); virtual bool SetActiveSource(cec_device_type type = CEC_DEVICE_TYPE_RESERVED); - virtual bool SetDeckControlMode(cec_deck_control_mode mode); - virtual bool SetDeckInfo(cec_deck_info info); - virtual bool SetInactiveView(void); + virtual bool SetActiveSource(cec_logical_address iAddress); + virtual bool SetDeckControlMode(cec_deck_control_mode mode, bool bSendUpdate = true); + virtual bool SetDeckInfo(cec_deck_info info, bool bSendUpdate = true); + virtual bool SetHDMIPort(cec_logical_address iBaseDevice, uint8_t iPort, bool bForce = false); + virtual bool TransmitInactiveSource(void); virtual bool SetLogicalAddress(cec_logical_address iLogicalAddress); + virtual bool SetMenuState(cec_menu_state state, bool bSendUpdate = true); virtual bool SetPhysicalAddress(uint16_t iPhysicalAddress); virtual bool SetStreamPath(uint16_t iStreamPath); virtual bool SwitchMonitoring(bool bEnable); virtual bool PollDevice(cec_logical_address iAddress); + virtual uint8_t VolumeUp(bool bWait = true); + virtual uint8_t VolumeDown(bool bWait = true); + virtual uint8_t MuteAudio(bool bWait = true); + virtual bool SendKeypress(cec_logical_address iDestination, cec_user_control_code key, bool bWait = false); + virtual bool SendKeyRelease(cec_logical_address iDestination, bool bWait = false); + + const char *ToString(const cec_menu_state state); + const char *ToString(const cec_version version); + const char *ToString(const cec_power_status status); + const char *ToString(const cec_logical_address address); + const char *ToString(const cec_deck_control_mode mode); + const char *ToString(const cec_deck_info status); + const char *ToString(const cec_opcode opcode); + const char *ToString(const cec_system_audio_status mode); + const char *ToString(const cec_audio_status status); + const char *ToString(const cec_vendor_id vendor); virtual bool Transmit(const cec_command &data); virtual bool Transmit(CCECAdapterMessage *output); @@ -91,23 +114,27 @@ namespace CEC virtual void AddLog(cec_log_level level, const CStdString &strMessage); virtual bool FindLogicalAddresses(void); + virtual bool SetAckMask(uint16_t iMask); CCECBusDevice *m_busDevices[16]; private: - bool TryLogicalAddress(cec_logical_address address, unsigned int iIndex); - bool FindLogicalAddressRecordingDevice(unsigned int iIndex); - bool FindLogicalAddressTuner(unsigned int iIndex); - bool FindLogicalAddressPlaybackDevice(unsigned int iIndex); - bool FindLogicalAddressAudioSystem(unsigned int iIndex); + void ScanCECBus(void); + bool CheckPhysicalAddress(uint16_t iPhysicalAddress); + bool TryLogicalAddress(cec_logical_address address); + bool FindLogicalAddressRecordingDevice(void); + bool FindLogicalAddressTuner(void); + bool FindLogicalAddressPlaybackDevice(void); + bool FindLogicalAddressAudioSystem(void); - bool SetAckMask(uint16_t iMask); void LogOutput(const cec_command &data); bool WaitForTransmitSucceeded(uint8_t iLength, uint32_t iTimeout = 1000); bool ParseMessage(const CCECAdapterMessage &msg); void ParseCommand(cec_command &command); bool m_bStarted; + uint8_t m_iHDMIPort; + cec_logical_address m_iBaseDevice; cec_command m_currentframe; cec_logical_addresses m_logicalAddresses; std::string m_strDeviceName; @@ -118,5 +145,18 @@ namespace CEC CLibCEC* m_controller; bool m_bMonitor; CecBuffer m_commandBuffer; + cec_keypress m_previousKey; + CThread * m_busScan; + }; + + class CCECBusScan : public CThread + { + public: + CCECBusScan(CCECProcessor *processor) { m_processor = processor; } + virtual ~CCECBusScan(void) {} + virtual void *Process(void); + + private: + CCECProcessor *m_processor; }; };