X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=inline;f=include%2FCECExportsCpp.h;h=d5903515b4d9603c54927f336c15015b08fe0be8;hb=48a229b119ab50aab51bfaefe8b5930204ea2dcf;hp=54dbcbfe3770e16eb027451f1b6970cf814fc066;hpb=93f86187ea362ab62f9e0f93b77fb3bcc29166ab;p=deb_libcec.git diff --git a/include/CECExportsCpp.h b/include/CECExportsCpp.h index 54dbcbf..d590351 100644 --- a/include/CECExportsCpp.h +++ b/include/CECExportsCpp.h @@ -41,7 +41,7 @@ namespace CEC /*! * @see cec_open */ - virtual bool Open(const char *strPort, int iTimeoutMs = 10000) = 0; + virtual bool Open(const char *strPort, uint64_t iTimeoutMs = 10000) = 0; /*! * @see cec_close @@ -122,7 +122,7 @@ namespace CEC }; }; -extern DECLSPEC void * CECCreate(const char *strDeviceName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, int iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS); +extern DECLSPEC void * CECCreate(const char *strDeviceName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS); #if !defined(DLL_EXPORT) #if defined(_WIN32) || defined(_WIN64) @@ -135,9 +135,9 @@ static int g_iLibCECInstanceCount = 0; /*! * @see cec_init */ -inline CEC::ICECAdapter *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, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS) { - typedef void* (__cdecl*_CreateLibCec)(const char *, uint8_t, uint8_t); + typedef void* (__cdecl*_CreateLibCec)(const char *, uint8_t, uint16_t); _CreateLibCec CreateLibCec; if (!g_libCEC) @@ -149,7 +149,7 @@ inline CEC::ICECAdapter *LoadLibCec(const char *strName, CEC::cec_logical_addres CreateLibCec = (_CreateLibCec) (GetProcAddress(g_libCEC, "CECCreate")); if (!CreateLibCec) return NULL; - return static_cast< CEC::ICECAdapter* > (CreateLibCec(strName, iLogicalAddress, iPhysicalAddress)); + return static_cast< CEC::ICECAdapter* > (CreateLibCec(strName, (uint8_t) iLogicalAddress, iPhysicalAddress)); } /*! @@ -172,7 +172,7 @@ inline void UnloadLibCec(CEC::ICECAdapter *device) /*! * @see cec_init */ -inline CEC::ICECAdapter *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, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS) { return (CEC::ICECAdapter*) CECCreate(strName, iLogicalAddress, iPhysicalAddress); }; @@ -183,6 +183,7 @@ inline CEC::ICECAdapter *LoadLibCec(const char *strName, CEC::cec_logical_addres */ inline void UnloadLibCec(CEC::ICECAdapter *device) { + device->Close(); delete device; }; #endif