cec: removed deprecated CECCreate() method
authorLars Op den Kamp <lars@opdenkamp.eu>
Wed, 8 Feb 2012 23:07:48 +0000 (00:07 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Wed, 8 Feb 2012 23:07:48 +0000 (00:07 +0100)
include/cec.h
include/cecc.h
include/cecloader.h
src/lib/CECProcessor.cpp
src/lib/CECProcessor.h
src/lib/LibCEC.cpp
src/lib/LibCEC.h
src/lib/LibCECC.cpp

index a916389c5d1d450a42c50610b55b0836e388fe39..8780857988852a7f25b1fe1aa6b9da608b597c4f 100644 (file)
@@ -390,16 +390,6 @@ namespace CEC
  */
 extern "C" DECLSPEC void * CECInit(const char *strDeviceName, CEC::cec_device_type_list devicesTypes);
 
-/*!
- * @deprecated Please use CECInit() instead
- * @brief Load the CEC adapter library.
- * @param strDeviceName How to present this device to other devices.
- * @param iLogicalAddress The logical of this device. PLAYBACKDEVICE1 by default.
- * @param iPhysicalAddress The physical address of this device. 0x1000 by default.
- * @return An instance of ICECAdapter or NULL on error.
- */
-extern "C" DECLSPEC void * CECCreate(const char *strDeviceName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS);
-
 /*!
  * @brief Unload the CEC adapter library.
  */
index c19f1a7b20d9a2bc472e8dacdaf129283b08a567..a720e7f9733924bffd755ae1f0dfd499955a984a 100644 (file)
 extern "C" {
 #endif
 
-#ifdef __cplusplus
-extern DECLSPEC int cec_init(const char *strDeviceName, CEC::cec_logical_address iLogicalAddress, uint16_t iPhysicalAddress);
-#else
-extern DECLSPEC int cec_init(const char *strDeviceName, cec_logical_address iLogicalAddress, uint16_t iPhysicalAddress);
-#endif
-
 #ifdef __cplusplus
 extern DECLSPEC int cec_init_typed(const char *strDeviceName, CEC::cec_device_type_list devicesTypes);
 #else
 extern DECLSPEC int cec_init_typed(const char *strDeviceName, cec_device_type_list devicesTypes);
 #endif
 
-
 extern DECLSPEC void cec_destroy(void);
 
 extern DECLSPEC int cec_open(const char *strPort, uint32_t iTimeout);
index 3e48b26ed16abda5d5c6fc3c02f426100b87dabd..33a2e3feaf666e56e2212afa202b3c4b58744e28 100644 (file)
 
 HINSTANCE g_libCEC = NULL;
 
-/*!
- * @deprecated Please use LibCecInit() instead
- */
-CEC::ICECAdapter *LoadLibCec(const char *strName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS, const char *strLib = NULL)
-{
-  if (!g_libCEC)
-#if defined(_WIN64)
-    g_libCEC = LoadLibrary(strLib ? strLib : "libcec.x64.dll");
-#else
-    g_libCEC = LoadLibrary(strLib ? strLib : "libcec.dll");
-#endif
-  if (!g_libCEC)
-    return NULL;
-
-  typedef void* (__cdecl*_CreateLibCec)(const char *, uint8_t, uint16_t);
-  _CreateLibCec CreateLibCec;
-  CreateLibCec = (_CreateLibCec) (GetProcAddress(g_libCEC, "CECCreate"));
-  if (!CreateLibCec)
-    return NULL;
-  return static_cast< CEC::ICECAdapter* > (CreateLibCec(strName, (uint8_t) iLogicalAddress, iPhysicalAddress));
-}
-
 /*!
  * @brief Create a new libCEC instance.
  * @param strDeviceName The name of the primary device to pass to other CEC devices.
index 06f847754f621711c4f7225439ccbd4943f76f1d..1ecbd86d5b6ca8c684f4311110b96b27e935ed25 100644 (file)
@@ -47,25 +47,6 @@ using namespace CEC;
 using namespace std;
 using namespace PLATFORM;
 
-CCECProcessor::CCECProcessor(CLibCEC *controller, const char *strDeviceName, cec_logical_address iLogicalAddress /* = CECDEVICE_PLAYBACKDEVICE1 */, uint16_t iPhysicalAddress /* = CEC_DEFAULT_PHYSICAL_ADDRESS*/) :
-    m_bInitialised(false),
-    m_iHDMIPort(CEC_DEFAULT_HDMI_PORT),
-    m_iBaseDevice((cec_logical_address)CEC_DEFAULT_BASE_DEVICE),
-    m_strDeviceName(strDeviceName),
-    m_communication(NULL),
-    m_controller(controller),
-    m_bMonitor(false),
-    m_iStandardLineTimeout(3),
-    m_iRetryLineTimeout(3),
-    m_iLastTransmission(0)
-{
-  m_logicalAddresses.Clear();
-  m_logicalAddresses.Set(iLogicalAddress);
-  m_types.clear();
-  for (int iPtr = 0; iPtr <= 16; iPtr++)
-    m_busDevices[iPtr] = new CCECBusDevice(this, (cec_logical_address) iPtr, iPtr == iLogicalAddress ? iPhysicalAddress : 0);
-}
-
 CCECProcessor::CCECProcessor(CLibCEC *controller, const char *strDeviceName, const cec_device_type_list &types) :
     m_bInitialised(false),
     m_iHDMIPort(CEC_DEFAULT_HDMI_PORT),
index 24c02bbfa9691d7afb66993ddad98002a9ae8f00..53d9f6b5bfcf3da9e3e700e37f506c97c32624b5 100644 (file)
@@ -46,7 +46,6 @@ namespace CEC
   class CCECProcessor : public PLATFORM::CThread, public IAdapterCommunicationCallback
   {
     public:
-      CCECProcessor(CLibCEC *controller, const char *strDeviceName, cec_logical_address iLogicalAddress = CECDEVICE_PLAYBACKDEVICE1, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS);
       CCECProcessor(CLibCEC *controller, const char *strDeviceName, const cec_device_type_list &types);
       virtual ~CCECProcessor(void);
 
index 30a3221cfb46fe86f5000a1f1107b7e2270c6313..e0cb4ea7bd71b43a8628b151baf1a4b68f3c4eab 100644 (file)
@@ -52,16 +52,6 @@ CLibCEC::CLibCEC(const char *strDeviceName, cec_device_type_list types) :
   m_cec = new CCECProcessor(this, strDeviceName, types);
 }
 
-CLibCEC::CLibCEC(const char *strDeviceName, cec_logical_address iLogicalAddress /* = CECDEVICE_PLAYBACKDEVICE1 */, uint16_t iPhysicalAddress /* = CEC_DEFAULT_PHYSICAL_ADDRESS */) :
-    m_iStartTime(GetTimeMs()),
-    m_iCurrentButton(CEC_USER_CONTROL_CODE_UNKNOWN),
-    m_buttontime(0),
-    m_callbacks(NULL),
-    m_cbParam(NULL)
-{
-  m_cec = new CCECProcessor(this, strDeviceName, iLogicalAddress, iPhysicalAddress);
-}
-
 CLibCEC::~CLibCEC(void)
 {
   Close();
@@ -467,13 +457,6 @@ void CLibCEC::SetInstance(CLibCEC *instance)
   g_libCEC_instance = instance;
 }
 
-void * CECCreate(const char *strDeviceName, CEC::cec_logical_address iLogicalAddress /*= CEC::CECDEVICE_PLAYBACKDEVICE1 */, uint16_t iPhysicalAddress /* = CEC_DEFAULT_PHYSICAL_ADDRESS */)
-{
-  CLibCEC *lib = new CLibCEC(strDeviceName, iLogicalAddress, iPhysicalAddress);
-  CLibCEC::SetInstance(lib);
-  return static_cast< void* > (lib);
-}
-
 void * CECInit(const char *strDeviceName, CEC::cec_device_type_list types)
 {
   CLibCEC *lib = new CLibCEC(strDeviceName, types);
index ad2eca97571deafe022bbd564f02ca2c242324ce..78881d9e339348a9853f1d21fa4a979c1b3fcb42 100644 (file)
@@ -48,7 +48,6 @@ namespace CEC
      */
     //@{
       CLibCEC(const char *strDeviceName, cec_device_type_list types);
-      CLibCEC(const char *strDeviceName, cec_logical_address iLogicalAddress = CECDEVICE_PLAYBACKDEVICE1, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS);
       virtual ~CLibCEC(void);
 
       virtual bool Open(const char *strPort, uint32_t iTimeout = 10000);
index 1a7b0454bc21ca22693d59ccdc60052df63853c4..2b5357c340408986eb6942d61b733f3d6296b1ea 100644 (file)
@@ -42,12 +42,6 @@ using namespace std;
 //@{
 ICECAdapter *cec_parser;
 
-int cec_init(const char *strDeviceName, cec_logical_address iLogicalAddress, uint16_t iPhysicalAddress)
-{
-  cec_parser = (ICECAdapter *) CECCreate(strDeviceName, iLogicalAddress, iPhysicalAddress);
-  return (cec_parser != NULL) ? 1 : 0;
-}
-
 int cec_init_typed(const char *strDeviceName, cec_device_type_list devicesTypes)
 {
   cec_parser = (ICECAdapter *) CECInit(strDeviceName, devicesTypes);