X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FLibCEC.h;h=a0cc25405802654a8fda197e966547fcb95f405b;hb=ded7e7cea9571381bef47bb2f2fb0e5266671914;hp=02ea9c29a0f751eee1484b0c8ef46780bfd87fa0;hpb=7837bab3f716a157f901a43bf6367e6203e4c60b;p=deb_libcec.git diff --git a/src/lib/LibCEC.h b/src/lib/LibCEC.h index 02ea9c2..a0cc254 100644 --- a/src/lib/LibCEC.h +++ b/src/lib/LibCEC.h @@ -2,7 +2,7 @@ /* * This file is part of the libCEC(R) library. * - * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited. All rights reserved. + * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited. All rights reserved. * libCEC(R) is an original work, containing original code. * * libCEC(R) is a trademark of Pulse-Eight Limited. @@ -33,7 +33,7 @@ #include #include -#include "util/buffer.h" +#include "platform/util/buffer.h" namespace CEC { @@ -53,6 +53,7 @@ namespace CEC virtual bool Open(const char *strPort, uint32_t iTimeout = 10000); virtual void Close(void); + virtual bool EnableCallbacks(void *cbParam, ICECCallbacks *callbacks); virtual int8_t FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath = NULL); virtual bool PingAdapter(void); virtual bool StartBootloader(void); @@ -89,12 +90,12 @@ namespace CEC virtual bool IsActiveDevice(cec_logical_address iAddress); virtual bool IsActiveDeviceType(cec_device_type type); virtual bool SetHDMIPort(cec_logical_address iBaseDevice, uint8_t iPort = CEC_DEFAULT_HDMI_PORT); - 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 cec_osd_name GetOSDName(cec_logical_address iAddress); + virtual uint8_t VolumeUp(bool bSendRelease = true); + virtual uint8_t VolumeDown(bool bSendRelease = true); + virtual uint8_t MuteAudio(bool bSendRelease = true); + virtual bool SendKeypress(cec_logical_address iDestination, cec_user_control_code key, bool bWait = true); + virtual bool SendKeyRelease(cec_logical_address iDestination, bool bWait = true); + virtual cec_osd_name GetDeviceOSDName(cec_logical_address iAddress); virtual bool EnablePhysicalAddressDetection(void); virtual cec_logical_address GetActiveSource(void); virtual bool IsActiveSource(cec_logical_address iAddress); @@ -111,20 +112,26 @@ namespace CEC const char *ToString(const cec_vendor_id vendor); //@} - virtual void AddLog(cec_log_level level, const std::string &strMessage); - virtual void AddKey(void); - virtual void AddKey(cec_keypress &key); - virtual void AddCommand(const cec_command &command); + static void AddLog(cec_log_level level, const char *strFormat, ...); + static void AddKey(void); + static void AddKey(cec_keypress &key); + static void AddCommand(const cec_command &command); + static void SetCurrentButton(cec_user_control_code iButtonCode); virtual void CheckKeypressTimeout(void); - virtual void SetCurrentButton(cec_user_control_code iButtonCode); + + static CLibCEC *GetInstance(void); + static void SetInstance(CLibCEC *instance); protected: - int64_t m_iStartTime; - cec_user_control_code m_iCurrentButton; - int64_t m_buttontime; - CCECProcessor *m_cec; - CecBuffer m_logBuffer; - CecBuffer m_keyBuffer; - CecBuffer m_commandBuffer; + int64_t m_iStartTime; + cec_user_control_code m_iCurrentButton; + int64_t m_buttontime; + CCECProcessor * m_cec; + PLATFORM::SyncedBuffer m_logBuffer; + PLATFORM::SyncedBuffer m_keyBuffer; + PLATFORM::SyncedBuffer m_commandBuffer; + ICECCallbacks * m_callbacks; + void * m_cbParam; + PLATFORM::CMutex m_mutex; }; };