X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FCECProcessor.h;h=8e5349accccc86f97b3f51e98d985b0e6ee27787;hb=f46dc8465450028c44c7cb0c253ab8b06dc1bcf4;hp=5b5ba4ba1b09276eaf1379c8b22ea9dd5bb31bd7;hpb=93fff5c18f5e39ffbee143b4d01e89cc02d6fd99;p=deb_libcec.git diff --git a/src/lib/CECProcessor.h b/src/lib/CECProcessor.h index 5b5ba4b..8e5349a 100644 --- a/src/lib/CECProcessor.h +++ b/src/lib/CECProcessor.h @@ -57,29 +57,40 @@ 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 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 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 SetInactiveView(void); + virtual bool SetHDMIPort(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); virtual bool Transmit(const cec_command &data); virtual bool Transmit(CCECAdapterMessage *output); @@ -97,11 +108,13 @@ namespace CEC 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); void LogOutput(const cec_command &data); bool WaitForTransmitSucceeded(uint8_t iLength, uint32_t iTimeout = 1000); @@ -109,6 +122,7 @@ namespace CEC void ParseCommand(cec_command &command); bool m_bStarted; + uint8_t m_iHDMIPort; cec_command m_currentframe; cec_logical_addresses m_logicalAddresses; std::string m_strDeviceName; @@ -119,5 +133,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; }; };