cec: added GetLogicalAddresses()/cec_get_logical_addresses() to the interface, that...
[deb_libcec.git] / src / lib / LibCECC.cpp
index ffa8f5561dfc7fd3c4755c1ac1bf652a5148c0a5..e2ae7f5d21b4fc4e544bc9ffd4059fd528249ba8 100644 (file)
@@ -1,7 +1,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.
@@ -74,6 +74,13 @@ void cec_close(void)
     cec_parser->Close();
 }
 
+int cec_enable_callbacks(void *cbParam, ICECCallbacks *callbacks)
+{
+  if (cec_parser)
+    return cec_parser->EnableCallbacks(cbParam, callbacks) ? 1 : 0;
+  return -1;
+}
+
 int8_t cec_find_adapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath /* = NULL */)
 {
   if (cec_parser)
@@ -95,7 +102,7 @@ int cec_start_bootloader(void)
   return -1;
 }
 
-int8_t cec_get_min_version(void)
+int8_t cec_get_min_lib_version(void)
 {
   if (cec_parser)
     return cec_parser->GetMinLibVersion();
@@ -254,6 +261,20 @@ uint16_t cec_get_device_physical_address(cec_logical_address iLogicalAddress)
   return 0;
 }
 
+cec_logical_address cec_get_active_source(void)
+{
+  if (cec_parser)
+    return cec_parser->GetActiveSource();
+  return CECDEVICE_UNKNOWN;
+}
+
+int cec_is_active_source(cec_logical_address iAddress)
+{
+  if (cec_parser)
+    return cec_parser->IsActiveSource(iAddress);
+  return false;
+}
+
 cec_power_status cec_get_device_power_status(cec_logical_address iLogicalAddress)
 {
   if (cec_parser)
@@ -298,24 +319,24 @@ int cec_set_hdmi_port(cec_logical_address iBaseDevice, uint8_t iPort)
   return -1;
 }
 
-int cec_volume_up(int bWait)
+int cec_volume_up(int bSendRelease)
 {
   if (cec_parser)
-    return cec_parser->VolumeUp(bWait == 1);
+    return cec_parser->VolumeUp(bSendRelease == 1);
   return -1;
 }
 
-int cec_volume_down(int bWait)
+int cec_volume_down(int bSendRelease)
 {
   if (cec_parser)
-    return cec_parser->VolumeDown(bWait == 1);
+    return cec_parser->VolumeDown(bSendRelease == 1);
   return -1;
 }
 
-int cec_mute_audio(int bWait)
+int cec_mute_audio(int bSendRelease)
 {
   if (cec_parser)
-    return cec_parser->MuteAudio(bWait == 1);
+    return cec_parser->MuteAudio(bSendRelease == 1);
   return -1;
 }
 
@@ -333,14 +354,14 @@ int cec_send_key_release(cec_logical_address iDestination, int bWait)
   return -1;
 }
 
-cec_osd_name cec_get_osd_name(cec_logical_address iAddress)
+cec_osd_name cec_get_device_osd_name(cec_logical_address iAddress)
 {
   cec_osd_name retVal;
   retVal.device = iAddress;
   retVal.name[0] = 0;
 
   if (cec_parser)
-    retVal = cec_parser->GetOSDName(iAddress);
+    retVal = cec_parser->GetDeviceOSDName(iAddress);
 
   return retVal;
 }
@@ -350,4 +371,23 @@ 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;
+}
+
+int cec_set_stream_path_physical(uint16_t iPhysicalAddress)
+{
+  return cec_parser ? (cec_parser->SetStreamPath(iPhysicalAddress) ? 1 : 0) : -1;
+}
+
+cec_logical_addresses cec_get_logical_addresses(void)
+{
+  cec_logical_addresses addr;
+  addr.Clear();
+  if (cec_parser)
+    addr = cec_parser->GetLogicalAddresses();
+  return addr;
+}
+
 //@}