X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=include%2FCECExportsCpp.h;h=54dbcbfe3770e16eb027451f1b6970cf814fc066;hb=b9187cc6999276ce37a5c9852655fd558ea76b8e;hp=996ec7fe3e479bc8a7dd769c896fc3307765f0f4;hpb=6dfe921375b746dab058c1f1c3a8263fbd409d3d;p=deb_libcec.git diff --git a/include/CECExportsCpp.h b/include/CECExportsCpp.h index 996ec7f..54dbcbf 100644 --- a/include/CECExportsCpp.h +++ b/include/CECExportsCpp.h @@ -33,53 +33,46 @@ namespace CEC { - class ICECDevice + class ICECAdapter { public: + /*! @name Adapter methods */ + //@{ /*! * @see cec_open */ virtual bool Open(const char *strPort, int iTimeoutMs = 10000) = 0; /*! - * @see cec_find_devices + * @see cec_close */ - virtual int FindDevices(std::vector &deviceList, const char *strDevicePath = NULL) = 0; + virtual void Close(void) = 0; /*! - * @see cec_ping + * @see cec_find_adapters */ - virtual bool Ping(void) = 0; + virtual int FindAdapters(std::vector &deviceList, const char *strDevicePath = NULL) = 0; /*! - * @see cec_start_bootloader - */ - virtual bool StartBootloader(void) = 0; - - /*! - * @see cec_power_off_devices + * @see cec_ping_adapters */ - virtual bool PowerOffDevices(cec_logical_address address = CECDEVICE_BROADCAST) = 0; + virtual bool PingAdapter(void) = 0; /*! - * @see cec_power_on_devices - */ - virtual bool PowerOnDevices(cec_logical_address address = CECDEVICE_BROADCAST) = 0; - - /*! - * @see cec_standby_devices + * @see cec_start_bootloader */ - virtual bool StandbyDevices(cec_logical_address address = CECDEVICE_BROADCAST) = 0; + virtual bool StartBootloader(void) = 0; + //@} /*! - * @see cec_set_active_view + * @see cec_get_min_version */ - virtual bool SetActiveView(void) = 0; + virtual int GetMinVersion(void) = 0; /*! - * @see cec_set_inactive_view + * @see cec_get_lib_version */ - virtual bool SetInactiveView(void) = 0; + virtual int GetLibVersion(void) = 0; /*! * @see cec_get_next_log_message @@ -91,10 +84,15 @@ namespace CEC */ virtual bool GetNextKeypress(cec_keypress *key) = 0; + /*! + * @see cec_get_next_command + */ + virtual bool GetNextCommand(cec_command *command) = 0; + /*! * @see cec_transmit */ - virtual bool Transmit(const cec_frame &data, bool bWaitForAck = true, int64_t iTimeout = (int64_t) 5000) = 0; + virtual bool Transmit(const cec_frame &data, bool bWaitForAck = true) = 0; /*! * @see cec_set_logical_address @@ -102,19 +100,25 @@ namespace CEC virtual bool SetLogicalAddress(cec_logical_address iLogicalAddress) = 0; /*! - * @deprecated use SetLogicalAddress() instead + * @see cec_power_on_devices */ - virtual bool SetAckMask(uint16_t iMask) = 0; + virtual bool PowerOnDevices(cec_logical_address address = CECDEVICE_TV) = 0; /*! - * @see cec_get_min_version + * @see cec_standby_devices */ - virtual int GetMinVersion(void) = 0; + virtual bool StandbyDevices(cec_logical_address address = CECDEVICE_BROADCAST) = 0; /*! - * @see cec_get_lib_version + * @see cec_set_active_view */ - virtual int GetLibVersion(void) = 0; + virtual bool SetActiveView(void) = 0; + + /*! + * @see cec_set_inactive_view + */ + virtual bool SetInactiveView(void) = 0; + }; }; @@ -131,9 +135,9 @@ static int g_iLibCECInstanceCount = 0; /*! * @see cec_init */ -inline CEC::ICECDevice *LoadLibCec(const char *strName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, int iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS) +inline CEC::ICECAdapter *LoadLibCec(const char *strName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, int iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS) { - typedef void* (__cdecl*_CreateLibCec)(const char *); + typedef void* (__cdecl*_CreateLibCec)(const char *, uint8_t, uint8_t); _CreateLibCec CreateLibCec; if (!g_libCEC) @@ -145,14 +149,14 @@ inline CEC::ICECDevice *LoadLibCec(const char *strName, CEC::cec_logical_address CreateLibCec = (_CreateLibCec) (GetProcAddress(g_libCEC, "CECCreate")); if (!CreateLibCec) return NULL; - return static_cast< CEC::ICECDevice* > (CreateLibCec(strName, iLogicalAddress, iPhysicalAddress)); + return static_cast< CEC::ICECAdapter* > (CreateLibCec(strName, iLogicalAddress, iPhysicalAddress)); } /*! * @brief Unload the given libcec instance. * @param device The instance to unload. */ -inline void UnloadLibCec(CEC::ICECDevice *device) +inline void UnloadLibCec(CEC::ICECAdapter *device) { delete device; @@ -168,16 +172,16 @@ inline void UnloadLibCec(CEC::ICECDevice *device) /*! * @see cec_init */ -inline CEC::ICECDevice *LoadLibCec(const char *strName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, int iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS) +inline CEC::ICECAdapter *LoadLibCec(const char *strName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, int iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS) { - return (CEC::ICECDevice*) CECCreate(strName, iLogicalAddress, iPhysicalAddress); + return (CEC::ICECAdapter*) CECCreate(strName, iLogicalAddress, iPhysicalAddress); }; /*! * @brief Unload the given libcec instance. * @param device The instance to unload. */ -inline void UnloadLibCec(CEC::ICECDevice *device) +inline void UnloadLibCec(CEC::ICECAdapter *device) { delete device; };