Added missing const for cec_set_configuration argument
[deb_libcec.git] / src / lib / LibCECC.cpp
index b87e06c611f28946a58331a26d9d73e6e25e0d6b..ecf45654408ad56c08085704b552fe6ef4fd1a5a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the libCEC(R) library.
  *
- * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited.  All rights reserved.
+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited.  All rights reserved.
  * libCEC(R) is an original work, containing original code.
  *
  * libCEC(R) is a trademark of Pulse-Eight Limited.
@@ -30,8 +30,9 @@
  *     http://www.pulse-eight.net/
  */
 
-#include "../../include/cec.h"
-#include "../../include/cecc.h"
+#include "env.h"
+#include "cec.h"
+#include "cecc.h"
 
 using namespace CEC;
 using namespace std;
@@ -48,12 +49,6 @@ int cec_initialise(libcec_configuration *configuration)
   return (cec_parser != NULL) ? 1 : 0;
 }
 
-int cec_init_typed(const char *strDeviceName, cec_device_type_list deviceTypes)
-{
-  cec_parser = (ICECAdapter *) CECInit(strDeviceName, deviceTypes);
-  return (cec_parser != NULL) ? 1 : 0;
-}
-
 void cec_destroy(void)
 {
   cec_close();
@@ -102,48 +97,6 @@ int cec_start_bootloader(void)
   return -1;
 }
 
-int8_t cec_get_min_lib_version(void)
-{
-  if (cec_parser)
-    return cec_parser->GetMinLibVersion();
-  return -1;
-}
-
-int8_t cec_get_lib_version_major(void)
-{
-  if (cec_parser)
-    return cec_parser->GetLibVersionMajor();
-  return -1;
-}
-
-int8_t cec_get_lib_version_minor(void)
-{
-  if (cec_parser)
-    return cec_parser->GetLibVersionMinor();
-  return -1;
-}
-
-int cec_get_next_log_message(cec_log_message *message)
-{
-  if (cec_parser)
-    return cec_parser->GetNextLogMessage(message) ? 1 : 0;
-  return -1;
-}
-
-int cec_get_next_keypress(cec_keypress *key)
-{
-  if (cec_parser)
-    return cec_parser->GetNextKeypress(key) ? 1 : 0;
-  return -1;
-}
-
-int cec_get_next_command(cec_command *command)
-{
-  if (cec_parser)
-    return cec_parser->GetNextCommand(command) ? 1 : 0;
-  return -1;
-}
-
 int cec_transmit(const CEC::cec_command *data)
 {
   if (cec_parser)
@@ -179,13 +132,6 @@ int cec_standby_devices(cec_logical_address address /* = CECDEVICE_BROADCAST */)
   return -1;
 }
 
-int cec_set_active_view(void)
-{
-  if (cec_parser)
-    return cec_parser->SetActiveView() ? 1 : 0;
-  return -1;
-}
-
 int cec_set_active_source(cec_device_type type)
 {
   if (cec_parser)
@@ -366,11 +312,6 @@ cec_osd_name cec_get_device_osd_name(cec_logical_address iAddress)
   return retVal;
 }
 
-int cec_enable_physical_address_detection(void)
-{
-  return cec_parser ? (cec_parser->EnablePhysicalAddressDetection() ? 1 : 0) : -1;
-}
-
 int cec_set_stream_path_logical(CEC::cec_logical_address iAddress)
 {
   return cec_parser ? (cec_parser->SetStreamPath(iAddress) ? 1 : 0) : -1;
@@ -405,7 +346,7 @@ int cec_persist_configuration(libcec_configuration *configuration)
   return cec_parser ? (cec_parser->PersistConfiguration(configuration) ? 1 : 0) : -1;
 }
 
-int cec_set_configuration(libcec_configuration *configuration)
+int cec_set_configuration(const libcec_configuration *configuration)
 {
   return cec_parser ? (cec_parser->SetConfiguration(configuration) ? 1 : 0) : -1;
 }
@@ -416,4 +357,62 @@ void cec_rescan_devices(void)
     cec_parser->RescanActiveDevices();
 }
 
+int cec_is_libcec_active_source(void)
+{
+  return cec_parser ? (cec_parser->IsLibCECActiveSource() ? 1 : 0) : -1;
+}
+
+int cec_get_device_information(const char *strPort, CEC::libcec_configuration *config, uint32_t iTimeoutMs)
+{
+  return cec_parser ? (cec_parser->GetDeviceInformation(strPort, config, iTimeoutMs) ? 1 : 0) : -1;
+}
+
+const char * cec_get_lib_info(void)
+{
+  return cec_parser ? cec_parser->GetLibInfo() : NULL;
+}
+
+void cec_init_video_standalone(void)
+{
+  if (cec_parser)
+    cec_parser->InitVideoStandalone();
+}
+
+uint16_t cec_get_adapter_vendor_id(void)
+{
+  return cec_parser ? cec_parser->GetAdapterVendorId() : 0;
+}
+
+uint16_t cec_get_adapter_product_id(void)
+{
+  return cec_parser ? cec_parser->GetAdapterProductId() : 0;
+}
+
+uint8_t cec_audio_toggle_mute(void)
+{
+  return cec_parser ? cec_parser->AudioToggleMute() : (uint8_t)CEC_AUDIO_VOLUME_STATUS_UNKNOWN;
+}
+
+uint8_t cec_audio_mute(void)
+{
+  return cec_parser ? cec_parser->AudioMute() : (uint8_t)CEC_AUDIO_VOLUME_STATUS_UNKNOWN;
+}
+
+uint8_t cec_audio_unmute(void)
+{
+  return cec_parser ? cec_parser->AudioUnmute() : (uint8_t)CEC_AUDIO_VOLUME_STATUS_UNKNOWN;
+}
+
+uint8_t cec_audio_get_status(void)
+{
+  return cec_parser ? cec_parser->AudioStatus() : (uint8_t)CEC_AUDIO_VOLUME_STATUS_UNKNOWN;
+}
+
+int8_t cec_detect_adapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath, int bQuickScan)
+{
+  if (cec_parser)
+    return cec_parser->DetectAdapters(deviceList, iBufSize, strDevicePath, bQuickScan == 1);
+  return -1;
+}
+
 //@}