X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FCECProcessor.h;h=ad444480ff1e3f5f6259b48e212ea84ab4a0e9d7;hb=a1f8fb1b065d260eb9d6eaf7e053f7415b453613;hp=d865167e114ff6e9332682a665c8873e31e30c9d;hpb=82b65f18fa44f1f9a673f10d917b2efdf087e565;p=deb_libcec.git diff --git a/src/lib/CECProcessor.h b/src/lib/CECProcessor.h index d865167..ad44448 100644 --- a/src/lib/CECProcessor.h +++ b/src/lib/CECProcessor.h @@ -50,6 +50,7 @@ namespace CEC { public: CCECProcessor(CLibCEC *controller, CAdapterCommunication *serComm, const char *strDeviceName, cec_logical_address iLogicalAddress = CECDEVICE_PLAYBACKDEVICE1, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS); + CCECProcessor(CLibCEC *controller, CAdapterCommunication *serComm, const char *strDeviceName, const cec_device_type_list &types); virtual ~CCECProcessor(void); virtual bool Start(void); @@ -60,7 +61,8 @@ namespace CEC virtual const std::string & GetDeviceName(void) { return m_strDeviceName; } 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_iLogicalAddress; } + virtual cec_logical_address GetLogicalAddress(void) const { return m_logicalAddresses.primary; } + virtual bool HasLogicalAddress(cec_logical_address address) const { return m_logicalAddresses.isset(address); } virtual uint16_t GetPhysicalAddress(void) const; virtual bool SetActiveView(void); @@ -68,6 +70,7 @@ namespace CEC virtual bool SetLogicalAddress(cec_logical_address iLogicalAddress); virtual bool SetPhysicalAddress(uint16_t iPhysicalAddress); virtual bool SwitchMonitoring(bool bEnable); + virtual bool PollDevice(cec_logical_address iAddress); virtual bool Transmit(const cec_command &data); virtual bool Transmit(CCECAdapterMessage *output); @@ -79,22 +82,32 @@ namespace CEC virtual void AddKey(void); virtual void AddLog(cec_log_level level, const CStdString &strMessage); + virtual bool FindLogicalAddresses(void); + CCECBusDevice *m_busDevices[16]; private: + bool TryLogicalAddress(cec_logical_address address, const char *strLabel, unsigned int iIndex); + bool FindLogicalAddressRecordingDevice(unsigned int iIndex); + bool FindLogicalAddressTuner(unsigned int iIndex); + bool FindLogicalAddressPlaybackDevice(unsigned int iIndex); + bool FindLogicalAddressAudioSystem(unsigned int iIndex); + 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; cec_command m_currentframe; - cec_logical_address m_iLogicalAddress; + cec_logical_addresses m_logicalAddresses; std::string m_strDeviceName; + cec_device_type_list m_types; CMutex m_mutex; CCondition m_startCondition; - CAdapterCommunication *m_communication; - CLibCEC *m_controller; + CAdapterCommunication* m_communication; + CLibCEC* m_controller; bool m_bMonitor; }; };