X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FLibCECC.cpp;h=dc63c2927794ae768d1fd0698af1686036f6d778;hb=5606e90bb3c5a85ab8e29e639e8248581247699e;hp=a637a8314d248d590057641754bee3904ae71cc5;hpb=f2cdbc3683e19fa58e5311e4020c0420901cfed5;p=deb_libcec.git diff --git a/src/lib/LibCECC.cpp b/src/lib/LibCECC.cpp index a637a83..dc63c29 100644 --- a/src/lib/LibCECC.cpp +++ b/src/lib/LibCECC.cpp @@ -264,6 +264,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; @@ -283,32 +284,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(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; +} + //@}