cec: add GetDevicePhysicalAddress()/cec_get_device_physical_address()
[deb_libcec.git] / src / lib / LibCECC.cpp
index 0193124e84cb07d78b78ceb5b8c0ad49a12d6e9c..ffa8f5561dfc7fd3c4755c1ac1bf652a5148c0a5 100644 (file)
@@ -186,6 +186,19 @@ int cec_set_active_source(cec_device_type type)
   return -1;
 }
 
+int cec_set_deck_control_mode(cec_deck_control_mode mode, int bSendUpdate) {
+  if (cec_parser)
+    return cec_parser->SetDeckControlMode(mode, bSendUpdate == 1) ? 1 : 0;
+  return -1;
+}
+
+int cec_set_deck_info(cec_deck_info info, int bSendUpdate) {
+  if (cec_parser)
+    return cec_parser->SetDeckInfo(info, bSendUpdate == 1) ? 1 : 0;
+  return -1;
+
+}
+
 int cec_set_inactive_view(void)
 {
   if (cec_parser)
@@ -193,6 +206,12 @@ int cec_set_inactive_view(void)
   return -1;
 }
 
+int cec_set_menu_state(cec_menu_state state, int bSendUpdate) {
+  if (cec_parser)
+    return cec_parser->SetMenuState(state, bSendUpdate == 1) ? 1 : 0;
+  return -1;
+}
+
 int cec_set_osd_string(cec_logical_address iLogicalAddress, cec_display_control duration, const char *strMessage)
 {
   if (cec_parser)
@@ -228,6 +247,13 @@ uint64_t cec_get_device_vendor_id(cec_logical_address iLogicalAddress)
   return 0;
 }
 
+uint16_t cec_get_device_physical_address(cec_logical_address iLogicalAddress)
+{
+  if (cec_parser)
+    return cec_parser->GetDevicePhysicalAddress(iLogicalAddress);
+  return 0;
+}
+
 cec_power_status cec_get_device_power_status(cec_logical_address iLogicalAddress)
 {
   if (cec_parser)
@@ -245,6 +271,7 @@ int cec_poll_device(cec_logical_address iLogicalAddress)
 cec_logical_addresses cec_get_active_devices(void)
 {
   cec_logical_addresses addresses;
+  addresses.Clear();
   if (cec_parser)
     addresses = cec_parser->GetActiveDevices();
   return addresses;
@@ -264,32 +291,63 @@ int cec_is_active_device_type(cec_device_type type)
   return -1;
 }
 
-int cec_set_hdmi_port(uint8_t iPort)
+int cec_set_hdmi_port(cec_logical_address iBaseDevice, uint8_t iPort)
 {
   if (cec_parser)
-    return cec_parser->SetHDMIPort(iPort) ? 1 : 0;
+    return cec_parser->SetHDMIPort(iBaseDevice, iPort) ? 1 : 0;
   return -1;
 }
 
-int cec_volume_up(int bWait /* = 1 */)
+int cec_volume_up(int bWait)
 {
   if (cec_parser)
     return cec_parser->VolumeUp(bWait == 1);
   return -1;
 }
 
-int cec_volume_down(int bWait /* = 1 */)
+int cec_volume_down(int bWait)
 {
   if (cec_parser)
     return cec_parser->VolumeDown(bWait == 1);
   return -1;
 }
 
-int cec_mute_audio(int bWait /* = 1 */)
+int cec_mute_audio(int bWait)
 {
   if (cec_parser)
     return cec_parser->MuteAudio(bWait == 1);
   return -1;
 }
 
+int cec_send_keypress(cec_logical_address iDestination, cec_user_control_code key, int bWait)
+{
+  if (cec_parser)
+    return cec_parser->SendKeypress(iDestination, key, bWait == 1) ? 1 : 0;
+  return -1;
+}
+
+int cec_send_key_release(cec_logical_address iDestination, int bWait)
+{
+  if (cec_parser)
+    return cec_parser->SendKeyRelease(iDestination, bWait == 1) ? 1 : 0;
+  return -1;
+}
+
+cec_osd_name cec_get_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);
+
+  return retVal;
+}
+
+int cec_enable_physical_address_detection(void)
+{
+  return cec_parser ? (cec_parser->EnablePhysicalAddressDetection() ? 1 : 0) : -1;
+}
+
 //@}