X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FLibCEC.h;h=0ef3e832d3d318218eda23c4beeccceefd40947e;hb=c0152c0940ee81c79150dbafafd6621f576c3ccb;hp=b0853de56979dbd34672277b5fea717368a1085f;hpb=e186a8436089dfa0f8a7cb65b00cbeb056923467;p=deb_libcec.git diff --git a/src/lib/LibCEC.h b/src/lib/LibCEC.h index b0853de..0ef3e83 100644 --- a/src/lib/LibCEC.h +++ b/src/lib/LibCEC.h @@ -39,19 +39,20 @@ namespace CEC { class CAdapterCommunication; class CCECProcessor; + class CCECClient; class CLibCEC : public ICECAdapter { public: - /*! - * ICECAdapter implementation - */ - //@{ CLibCEC(const char *strDeviceName, cec_device_type_list types, uint16_t iPhysicalAddress = 0); CLibCEC(libcec_configuration *configuration); virtual ~CLibCEC(void); - bool Open(const char *strPort, uint32_t iTimeout = 10000); + /*! + * ICECAdapter implementation + */ + //@{ + bool Open(const char *strPort, uint32_t iTimeout = CEC_DEFAULT_CONNECT_TIMEOUT); void Close(void); bool EnableCallbacks(void *cbParam, ICECCallbacks *callbacks); int8_t FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath = NULL); @@ -127,33 +128,40 @@ namespace CEC static uint16_t GetMaskForType(cec_logical_address address); static uint16_t GetMaskForType(cec_device_type type); - bool GetDeviceInformation(const char *strPort, libcec_configuration *config, uint32_t iTimeoutMs = 10000); + bool GetDeviceInformation(const char *strPort, libcec_configuration *config, uint32_t iTimeoutMs = CEC_DEFAULT_CONNECT_TIMEOUT); //@} - static void AddLog(const cec_log_level level, const char *strFormat, ...); - static void AddKey(void); - static void AddKey(const cec_keypress &key); - static void AddCommand(const cec_command &command); - static void ConfigurationChanged(const libcec_configuration &config); - static void SetCurrentButton(cec_user_control_code iButtonCode); + void AddLog(const cec_log_level level, const char *strFormat, ...); + static void AddKey(void) {} //UNUSED + static void AddKey(const cec_keypress &key); //UNUSED + static void AddCommand(const cec_command &command); //UNUSED + static void ConfigurationChanged(const libcec_configuration &config); //UNUSED + static void SetCurrentButton(cec_user_control_code iButtonCode); //UNUSED void CheckKeypressTimeout(void); - static int MenuStateChanged(const cec_menu_state newState); - static void Alert(const libcec_alert type, const libcec_parameter ¶m); + void Alert(const libcec_alert type, const libcec_parameter ¶m); + static CLibCEC *GetInstance(void); //UNUSED + static void SetInstance(CLibCEC *instance); //UNUSED - static CLibCEC *GetInstance(void); - static void SetInstance(CLibCEC *instance); + static bool IsValidPhysicalAddress(uint16_t iPhysicalAddress); + CCECClient *RegisterClient(libcec_configuration &configuration); + void UnregisterClients(void); + std::vector GetClients(void) { return m_clients; }; + + CCECProcessor * m_cec; - CCECProcessor * m_cec; protected: int64_t m_iStartTime; - cec_user_control_code m_iCurrentButton; - int64_t m_buttontime; - PLATFORM::SyncedBuffer m_logBuffer; - PLATFORM::SyncedBuffer m_keyBuffer; - PLATFORM::SyncedBuffer m_commandBuffer; - ICECCallbacks * m_callbacks; - void * m_cbParam; + cec_user_control_code m_iCurrentButton; //UNUSED + int64_t m_buttontime; //UNUSED + PLATFORM::SyncedBuffer m_logBuffer; //UNUSED + PLATFORM::SyncedBuffer m_keyBuffer; //UNUSED + PLATFORM::SyncedBuffer m_commandBuffer; //UNUSED + ICECCallbacks * m_callbacks; //UNUSED + void * m_cbParam; //UNUSED PLATFORM::CMutex m_mutex; - PLATFORM::CMutex m_logMutex; + PLATFORM::CMutex m_logMutex; //UNUSED + + CCECClient * m_client; + std::vector m_clients; }; };