Merge pull request #7 from og01/master
authorLars Op den Kamp <opdenkamp@gmail.com>
Fri, 2 Dec 2011 10:52:42 +0000 (02:52 -0800)
committerLars Op den Kamp <opdenkamp@gmail.com>
Fri, 2 Dec 2011 10:52:42 +0000 (02:52 -0800)
Deck control functions missing from C interface

1  2 
include/cecc.h
src/lib/LibCECC.cpp

diff --combined include/cecc.h
index 972c4a2cf414cec1dfe467cd6a18bb58ea199bbc,640a609c4b0c6c23d56c765fe08438aa271876e7..d433b3ebc50cfcf65482de567a116cf9cd5efafd
@@@ -95,8 -95,26 +95,26 @@@ extern DECLSPEC int cec_set_active_sour
  extern DECLSPEC int cec_set_active_source(cec_device_type type);
  #endif
  
+ #ifdef __cplusplus
+ extern DECLSPEC int cec_set_deck_control_mode(CEC::cec_deck_control_mode mode, int bSendUpdate);
+ #else
+ extern DECLSPEC int cec_set_deck_control_mode(cec_deck_control_mode mode, int bSendUpdate);
+ #endif
+ #ifdef __cplusplus
+ extern DECLSPEC int cec_set_deck_info(CEC::cec_deck_info info, int bSendUpdate);
+ #else
+ extern DECLSPEC int cec_set_deck_info(cec_deck_info info, int bSendUpdate);
+ #endif
  extern DECLSPEC int cec_set_inactive_view(void);
  
+ #ifdef __cplusplus
+ extern DECLSPEC int cec_set_menu_state(CEC::cec_menu_state state, int bSendUpdate);
+ #else
+ extern DECLSPEC int cec_set_menu_state(cec_menu_state state, int bSendUpdate);
+ #endif
  #ifdef __cplusplus
  extern DECLSPEC int cec_get_next_log_message(CEC::cec_log_message *message);
  #else
@@@ -185,37 -203,13 +203,37 @@@ extern DECLSPEC int cec_is_active_devic
  extern DECLSPEC int cec_is_active_device_type(cec_device_type type);
  #endif
  
 -extern DECLSPEC int cec_set_hdmi_port(uint8_t iPort);
 +#ifdef __cplusplus
 +extern DECLSPEC int cec_set_hdmi_port(CEC::cec_logical_address iBaseDevice, uint8_t iPort);
 +#else
 +extern DECLSPEC int cec_set_hdmi_port(cec_logical_address iBaseDevice, uint8_t iPort);
 +#endif
 +
 +extern DECLSPEC int cec_volume_up(int bWait);
 +
 +extern DECLSPEC int cec_volume_down(int bWait);
 +
 +extern DECLSPEC int cec_mute_audio(int bWait);
 +
 +#ifdef __cplusplus
 +extern DECLSPEC int cec_send_keypress(CEC::cec_logical_address iDestination, CEC::cec_user_control_code key, int bWait);
 +#else
 +extern DECLSPEC int cec_send_keypress(cec_logical_address iDestination, cec_user_control_code key, int bWait);
 +#endif
  
 -extern DECLSPEC int cec_volume_up(void);
 +#ifdef __cplusplus
 +extern DECLSPEC int cec_send_key_release(CEC::cec_logical_address iDestination, int bWait);
 +#else
 +extern DECLSPEC int cec_send_key_release(cec_logical_address iDestination, int bWait);
 +#endif
  
 -extern DECLSPEC int cec_volume_down(void);
 +#ifdef __cplusplus
 +extern DECLSPEC CEC::cec_osd_name cec_get_osd_name(CEC::cec_logical_address iAddress);
 +#else
 +extern DECLSPEC cec_osd_name cec_get_osd_name(cec_logical_address iAddress);
 +#endif
  
 -extern DECLSPEC int cec_mute_audio(void);
 +extern DECLSPEC int cec_enable_physical_address_detection(void);
  
  #ifdef __cplusplus
  };
diff --combined src/lib/LibCECC.cpp
index fdcc9e7a57bc0dcf4c2f239449272f93e2d47522,a637a8314d248d590057641754bee3904ae71cc5..dc63c2927794ae768d1fd0698af1686036f6d778
@@@ -186,6 -186,19 +186,19 @@@ int cec_set_active_source(cec_device_ty
    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)
    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)
@@@ -245,7 -264,6 +264,7 @@@ int cec_poll_device(cec_logical_addres
  cec_logical_addresses cec_get_active_devices(void)
  {
    cec_logical_addresses addresses;
 +  addresses.Clear();
    if (cec_parser)
      addresses = cec_parser->GetActiveDevices();
    return addresses;
@@@ -265,63 -283,32 +284,63 @@@ int cec_is_active_device_type(cec_devic
    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(void)
 +int cec_volume_up(int bWait)
  {
    if (cec_parser)
 -    return cec_parser->VolumeUp();
 +    return cec_parser->VolumeUp(bWait == 1);
    return -1;
  }
  
 -int cec_volume_down(void)
 +int cec_volume_down(int bWait)
  {
    if (cec_parser)
 -    return cec_parser->VolumeDown();
 +    return cec_parser->VolumeDown(bWait == 1);
    return -1;
  }
  
 -int cec_mute_audio(void)
 +int cec_mute_audio(int bWait)
  {
    if (cec_parser)
 -    return cec_parser->MuteAudio();
 +    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;
 +}
 +
  //@}