diff -Nru libcec-2.0.4/ChangeLog libcec-2.1.1/ChangeLog --- libcec-2.0.4/ChangeLog 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/ChangeLog 2013-03-09 20:14:55.000000000 +0000 @@ -1,3 +1,76 @@ +libcec (2.1.1-1) unstable; urgency=low + + * changed / added: + * send an alert when the TV does not respond to polls + * fixed: + * LG didn't switch sources after the TV powered up + * always poll a device when the status is unknown, and don't try to + determine whether it needs to be polled by checking the status of other + devices + * don't mark a device as inactive when receiving a routing change message, + only when another device was made acive. fixes the issue that rc + passthrough doesn't work when a tv sends a quick routing change to + another port before requesting the active source when coming out of + standby + * LibCecSharp: fixed 14 char long OSD name (wasn't \0 terminated) + * LibCecSharp: fixed return value of GetActiveDevices(). issue #131 + * cec-tray: fixed index out of range exception in CECSettingNumeric.cs. + bugzid: 2082 + * cec-tray: ensure that the tray app only initialises once. bugzid: 2082 + * rpi: don't set the physical address to 1.0.0.0 when receiving + VC_HDMI_UNPLUGGED. it may wake up device when they were just sent to + standby. issue #142 + * osx: use the correct dylib name in cecloader.h, used by cec-client + + -- Pulse-Eight Packaging Fri, 8 Mar 2013 17:21:00 +0100 + + libcec (2.1.0-1) unstable; urgency=low + + * changed / added: + * added vendor id for Denon + * added DetectAdapters() method, that returns all device information for + detected adapters, not just the com port + * added new method PowerOnScreensaver. credits: @jmarcet + * LibCECTray: Added ability to send modifiers by nesting commands in + KeyInput.cs. credits: Nate Burr + * rpi: Added /opt/vc/include/interface/vmcs_host/linux to rpi_cflags to fix + building on 'next' firmware branch. credits: Nedim Lisica + * fixed: + * don't send two active source message sequences to philips. issue #118 + * don't send deck status updates to philips when activating the source + * update the active source status correctly after a manual switch to + another source. closes #124 + * rename cec_audio_status() to cec_audio_get_status() to avoid conflict + with the cec_audio_status enum. This makes the C API compile again. + credits: Dave Chapman + * LibCECTray: Fixed bug with libcec adding the keyup for button commands + and making sure they are still executed. credits: Nate Burr + * rpi: register callback for HPD. re-read the physical address when we + received VC_HDMI_ATTACHED. issue #109 + + -- Pulse-Eight Packaging Tue, 26 Feb 2013 23:06:00 +0100 + +libcec (2.0.5-1) unstable; urgency=low + + * changed: + * also try polls at least twice when it failed + * added methods to get the audiostatus and toggle the mute status from the + amplifier (if connected) + * added comboKey and iComboKeyTimeoutMs to libcec_configuration + * force cec_user_control_code_unknown to 0xFF + * fixed: + * check unsupported features properly + * only send an active source message when the stream path changed and we + weren't the active source yet + * don't mark as inactive source on routing changes + * press & hold + * never mark user control opcodes as unsupported + * report our OSD name to the TV, since some TVs don't request it + * initial audiostatus value + * don't log a no longer relevant FIXME + + -- Pulse-Eight Packaging Thu, 6 Dec 2012 20:58:00 +0100 + libcec (2.0.4-1) unstable; urgency=low * changed: diff -Nru libcec-2.0.4/config.h.in libcec-2.1.1/config.h.in --- libcec-2.0.4/config.h.in 2012-11-15 13:49:45.000000000 +0000 +++ libcec-2.1.1/config.h.in 2013-03-09 20:23:01.000000000 +0000 @@ -62,6 +62,9 @@ /* Define to 1 if you have the `listen' function. */ #undef HAVE_LISTEN +/* Define to 1 if liblockdev is installed */ +#undef HAVE_LOCKDEV + /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H diff -Nru libcec-2.0.4/configure libcec-2.1.1/configure --- libcec-2.0.4/configure 2012-11-15 13:49:44.000000000 +0000 +++ libcec-2.1.1/configure 2013-03-09 20:23:00.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for libcec 2:0:0. +# Generated by GNU Autoconf 2.68 for libcec 2:1:0. # # Report bugs to . # @@ -570,8 +570,8 @@ # Identity of this package. PACKAGE_NAME='libcec' PACKAGE_TARNAME='libcec' -PACKAGE_VERSION='2:0:0' -PACKAGE_STRING='libcec 2:0:0' +PACKAGE_VERSION='2:1:0' +PACKAGE_STRING='libcec 2:1:0' PACKAGE_BUGREPORT='http://libcec.pulse-eight.com/' PACKAGE_URL='' @@ -1339,7 +1339,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libcec 2:0:0 to adapt to many kinds of systems. +\`configure' configures libcec 2:1:0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1409,7 +1409,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libcec 2:0:0:";; + short | recursive ) echo "Configuration of libcec 2:1:0:";; esac cat <<\_ACEOF @@ -1534,7 +1534,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libcec configure 2:0:0 +libcec configure 2:1:0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2091,7 +2091,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libcec $as_me 2:0:0, which was +It was created by libcec $as_me 2:1:0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2910,7 +2910,7 @@ # Define the identity of the package. PACKAGE='libcec' - VERSION='2:0:0' + VERSION='2:1:0' cat >>confdefs.h <<_ACEOF @@ -3012,7 +3012,7 @@ # Define the identity of the package. PACKAGE=libcec - VERSION=2:0:0 + VERSION=2:1:0 cat >>confdefs.h <<_ACEOF @@ -15503,7 +15503,7 @@ msg_dl_missing="required library 'dl' is missing" msg_udev_missing="library 'udev' is missing - adapter detection will not be available" msg_dirent_missing="dirent.h header is missing - adapter detection will not be available" -msg_lockdev_missing="required library 'liblockdev' is missing" +msg_lockdev_missing="library 'liblockdev' is missing" msg_rpi_api_missing="Raspberry Pi API not found or incompatible with libCEC" msg_rpi_will_check="will check for RPi support" msg_rpi_unsupported_target="will not check for RPi support (unsupported cpu: ${host_cpu})" @@ -15559,7 +15559,7 @@ # Check whether --with-rpi-include-path was given. if test "${with_rpi_include_path+set}" = set; then : - withval=$with_rpi_include_path; RPI_CFLAGS="-I$withval -I$withval/interface/vcos/pthreads" + withval=$with_rpi_include_path; RPI_CFLAGS="-I$withval -I$withval/interface/vcos/pthreads -I$withval/interface/vmcs_host/linux" fi @@ -15784,7 +15784,62 @@ case "${host}" in *-*-linux*) # for timeutils - LIBS="$LIBS -lrt" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 +$as_echo_n "checking for library containing clock_gettime... " >&6; } +if ${ac_cv_search_clock_gettime+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (); +int +main () +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_search_clock_gettime=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_clock_gettime+:} false; then : + break +fi +done +if ${ac_cv_search_clock_gettime+:} false; then : + +else + ac_cv_search_clock_gettime=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 +$as_echo "$ac_cv_search_clock_gettime" >&6; } +ac_res=$ac_cv_search_clock_gettime +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + ;; *-apple-darwin*) LIBS="$LIBS -framework CoreVideo -framework IOKit" @@ -15797,6 +15852,7 @@ ## search for udev, lockdev and the RPi API, only required by libCEC use_udev="no" use_adapter_detection="yes" +use_lockdev="no" case "${host}" in *-*-linux*) ## search for udev if pkg-config was found @@ -16015,11 +16071,13 @@ fi ## search for lockdev + use_lockdev="yes" ac_fn_cxx_check_header_mongrel "$LINENO" "lockdev.h" "ac_cv_header_lockdev_h" "$ac_includes_default" if test "x$ac_cv_header_lockdev_h" = xyes; then : else - as_fn_error $? "$msg_lockdev_missing" "$LINENO" 5 + use_lockdev="no";{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $msg_lockdev_missing" >&5 +$as_echo "$as_me: WARNING: $msg_lockdev_missing" >&2;} fi @@ -16067,7 +16125,8 @@ LIBS="-llockdev $LIBS" else - as_fn_error $? "$msg_lockdev_missing" "$LINENO" 5 + use_lockdev="no";{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $msg_lockdev_missing" >&5 +$as_echo "$as_me: WARNING: $msg_lockdev_missing" >&2;} fi @@ -16871,6 +16930,12 @@ fi +if test "x$use_lockdev" = "xyes"; then + +$as_echo "#define HAVE_LOCKDEV 1" >>confdefs.h + +fi + ## mark adapter detection as available if the required deps were found if test "x$use_adapter_detection" = "xyes"; then ## mark udev as available if it was found @@ -17448,7 +17513,7 @@ LIBS_LIBCEC="$LIBS" LIBS="$libs_client" -CXXFLAGS="$CXXFLAGS -fPIC -Wall -Wextra -Werror -Wno-missing-field-initializers" +CXXFLAGS="$CXXFLAGS -fPIC -Wall -Wextra -Wno-missing-field-initializers" if test "x$use_debug" = "xyes"; then CXXFLAGS="$CXXFLAGS -g" @@ -18060,7 +18125,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libcec $as_me 2:0:0, which was +This file was extended by libcec $as_me 2:1:0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18126,7 +18191,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libcec config.status 2:0:0 +libcec config.status 2:1:0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff -Nru libcec-2.0.4/configure.ac libcec-2.1.1/configure.ac --- libcec-2.0.4/configure.ac 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/configure.ac 2013-03-09 20:14:55.000000000 +0000 @@ -1,5 +1,5 @@ AC_PREREQ(2.59) -AC_INIT([libcec], [2:0:0], [http://libcec.pulse-eight.com/]) +AC_INIT([libcec], [2:1:0], [http://libcec.pulse-eight.com/]) AC_CONFIG_HEADERS([config.h]) AH_TOP([#pragma once]) @@ -23,7 +23,7 @@ msg_dl_missing="required library 'dl' is missing" msg_udev_missing="library 'udev' is missing - adapter detection will not be available" msg_dirent_missing="dirent.h header is missing - adapter detection will not be available" -msg_lockdev_missing="required library 'liblockdev' is missing" +msg_lockdev_missing="library 'liblockdev' is missing" msg_rpi_api_missing="Raspberry Pi API not found or incompatible with libCEC" msg_rpi_will_check="will check for RPi support" msg_rpi_unsupported_target="will not check for RPi support (unsupported cpu: ${host_cpu})" @@ -68,7 +68,7 @@ AC_ARG_WITH([rpi-include-path], [AS_HELP_STRING([--with-rpi-include-path], [location of the Raspberry Pi headers (location of /opt/vc/include, default is auto)])], - [RPI_CFLAGS="-I$withval -I$withval/interface/vcos/pthreads"]) + [RPI_CFLAGS="-I$withval -I$withval/interface/vcos/pthreads -I$withval/interface/vmcs_host/linux"]) ## Optional path to libbcm_host.so AC_ARG_WITH([rpi-lib-path], @@ -116,7 +116,7 @@ case "${host}" in *-*-linux*) # for timeutils - LIBS="$LIBS -lrt" + AC_SEARCH_LIBS([clock_gettime], [rt]) ;; *-apple-darwin*) LIBS="$LIBS -framework CoreVideo -framework IOKit" @@ -129,6 +129,7 @@ ## search for udev, lockdev and the RPi API, only required by libCEC use_udev="no" use_adapter_detection="yes" +use_lockdev="no" case "${host}" in *-*-linux*) ## search for udev if pkg-config was found @@ -146,8 +147,9 @@ fi ## search for lockdev - AC_CHECK_HEADER(lockdev.h,,AC_MSG_ERROR($msg_lockdev_missing)) - AC_CHECK_LIB(lockdev,dev_unlock,,AC_MSG_ERROR($msg_lockdev_missing)) + use_lockdev="yes" + AC_CHECK_HEADER(lockdev.h,,[use_lockdev="no";AC_MSG_WARN($msg_lockdev_missing)]) + AC_CHECK_LIB(lockdev,dev_unlock,,[use_lockdev="no";AC_MSG_WARN($msg_lockdev_missing)]) AC_CHECK_HEADER(time.h,,AC_MSG_ERROR($msg_required_header_missing)) AC_CHECK_HEADER(sys/prctl.h,,AC_MSG_ERROR($msg_required_header_missing)) @@ -219,6 +221,10 @@ AC_DEFINE([HAVE_P8_USB],[1],[Define to 1 to include support for the Pulse-Eight USB-CEC Adapter]) AM_CONDITIONAL(USE_P8_USB, true) +if test "x$use_lockdev" = "xyes"; then + AC_DEFINE([HAVE_LOCKDEV],[1],[Define to 1 if liblockdev is installed]) +fi + ## mark adapter detection as available if the required deps were found if test "x$use_adapter_detection" = "xyes"; then ## mark udev as available if it was found @@ -336,7 +342,7 @@ LIBS_LIBCEC="$LIBS" LIBS="$libs_client" -CXXFLAGS="$CXXFLAGS -fPIC -Wall -Wextra -Werror -Wno-missing-field-initializers" +CXXFLAGS="$CXXFLAGS -fPIC -Wall -Wextra -Wno-missing-field-initializers" if test "x$use_debug" = "xyes"; then CXXFLAGS="$CXXFLAGS -g" diff -Nru libcec-2.0.4/debian/changelog libcec-2.1.1/debian/changelog --- libcec-2.0.4/debian/changelog 2012-11-15 13:49:39.000000000 +0000 +++ libcec-2.1.1/debian/changelog 2013-03-09 20:22:55.000000000 +0000 @@ -1,8 +1,81 @@ -libcec (2.0.4-3~precise) precise; urgency=low +libcec (2.1.1-5~precise) precise; urgency=low * Build for Ubuntu 'precise' - -- Pulse-Eight Packaging Thu, 15 Nov 2012 14:49:39 +0100 + -- Pulse-Eight Packaging Sat, 09 Mar 2013 21:22:55 +0100 + +libcec (2.1.1-1) unstable; urgency=low + + * changed / added: + * send an alert when the TV does not respond to polls + * fixed: + * LG didn't switch sources after the TV powered up + * always poll a device when the status is unknown, and don't try to + determine whether it needs to be polled by checking the status of other + devices + * don't mark a device as inactive when receiving a routing change message, + only when another device was made acive. fixes the issue that rc + passthrough doesn't work when a tv sends a quick routing change to + another port before requesting the active source when coming out of + standby + * LibCecSharp: fixed 14 char long OSD name (wasn't \0 terminated) + * LibCecSharp: fixed return value of GetActiveDevices(). issue #131 + * cec-tray: fixed index out of range exception in CECSettingNumeric.cs. + bugzid: 2082 + * cec-tray: ensure that the tray app only initialises once. bugzid: 2082 + * rpi: don't set the physical address to 1.0.0.0 when receiving + VC_HDMI_UNPLUGGED. it may wake up device when they were just sent to + standby. issue #142 + * osx: use the correct dylib name in cecloader.h, used by cec-client + + -- Pulse-Eight Packaging Fri, 8 Mar 2013 17:21:00 +0100 + + libcec (2.1.0-1) unstable; urgency=low + + * changed / added: + * added vendor id for Denon + * added DetectAdapters() method, that returns all device information for + detected adapters, not just the com port + * added new method PowerOnScreensaver. credits: @jmarcet + * LibCECTray: Added ability to send modifiers by nesting commands in + KeyInput.cs. credits: Nate Burr + * rpi: Added /opt/vc/include/interface/vmcs_host/linux to rpi_cflags to fix + building on 'next' firmware branch. credits: Nedim Lisica + * fixed: + * don't send two active source message sequences to philips. issue #118 + * don't send deck status updates to philips when activating the source + * update the active source status correctly after a manual switch to + another source. closes #124 + * rename cec_audio_status() to cec_audio_get_status() to avoid conflict + with the cec_audio_status enum. This makes the C API compile again. + credits: Dave Chapman + * LibCECTray: Fixed bug with libcec adding the keyup for button commands + and making sure they are still executed. credits: Nate Burr + * rpi: register callback for HPD. re-read the physical address when we + received VC_HDMI_ATTACHED. issue #109 + + -- Pulse-Eight Packaging Tue, 26 Feb 2013 23:06:00 +0100 + +libcec (2.0.5-1) unstable; urgency=low + + * changed: + * also try polls at least twice when it failed + * added methods to get the audiostatus and toggle the mute status from the + amplifier (if connected) + * added comboKey and iComboKeyTimeoutMs to libcec_configuration + * force cec_user_control_code_unknown to 0xFF + * fixed: + * check unsupported features properly + * only send an active source message when the stream path changed and we + weren't the active source yet + * don't mark as inactive source on routing changes + * press & hold + * never mark user control opcodes as unsupported + * report our OSD name to the TV, since some TVs don't request it + * initial audiostatus value + * don't log a no longer relevant FIXME + + -- Pulse-Eight Packaging Thu, 6 Dec 2012 20:58:00 +0100 libcec (2.0.4-1) unstable; urgency=low diff -Nru libcec-2.0.4/include/cec.h libcec-2.1.1/include/cec.h --- libcec-2.0.4/include/cec.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/include/cec.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. @@ -72,6 +72,7 @@ virtual void Close(void) = 0; /*! + * @deprecated Use DetectAdapters() instead * @brief Try to find all connected CEC adapters. * @param deviceList The vector to store device descriptors in. * @param iBufSize The size of the deviceList buffer. @@ -251,6 +252,7 @@ virtual uint8_t VolumeDown(bool bSendRelease = true) = 0; /*! + * @deprecated Use AudioToggleMute() instead * @brief Sends a mute keypress to an audiosystem if it's present. * @param bSendRelease Send a key release after the keypress. * @return The new audio status. @@ -421,6 +423,41 @@ virtual const char *ToString(const cec_server_version version) = 0; virtual const char *ToString(const cec_user_control_code key) = 0; virtual const char *ToString(const cec_adapter_type type) = 0; + + /*! + * @brief Toggle the mute status of the AVR (if present) + * @return The new audio status. + */ + virtual uint8_t AudioToggleMute(void) = 0; + + /*! + * @brief Mute the AVR (if present) + * @return The new audio status. + */ + virtual uint8_t AudioMute(void) = 0; + + /*! + * @brief Mute the AVR (if connected) + * @return The new audio status. + */ + virtual uint8_t AudioUnmute(void) = 0; + + /*! + * @brief Get the current audio status (if an AVR is connected) + * @return The current audio status, or cec_audio_status if unknown. + */ + virtual uint8_t AudioStatus(void) = 0; + + /*! + * @brief Try to find all connected CEC adapters. + * @param deviceList The vector to store device descriptors in. + * @param iBufSize The size of the deviceList buffer. + * @param strDevicePath Optional device path. Only adds device descriptors that match the given device path. + * @param bQuickScan True to do a "quick scan", which will not open a connection to the adapter. Firmware version information and the exact device type will be missing + * @return The number of devices that were found, or -1 when an error occured. + */ + virtual int8_t DetectAdapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath = NULL, bool bQuickScan = false) = 0; + }; }; diff -Nru libcec-2.0.4/include/cecc.h libcec-2.1.1/include/cecc.h --- libcec-2.0.4/include/cecc.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/include/cecc.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. @@ -276,6 +276,20 @@ extern DECLSPEC uint16_t cec_get_adapter_product_id(void); +extern DECLSPEC uint8_t cec_audio_toggle_mute(void); + +extern DECLSPEC uint8_t cec_audio_mute(void); + +extern DECLSPEC uint8_t cec_audio_unmute(void); + +extern DECLSPEC uint8_t cec_audio_get_status(void); + +#ifdef __cplusplus +extern DECLSPEC int8_t cec_detect_adapters(CEC::cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath, int bQuickScan); +#else +extern DECLSPEC int8_t cec_detect_adapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath, int bQuickScan); +#endif + #ifdef __cplusplus }; #endif diff -Nru libcec-2.0.4/include/cecloader.h libcec-2.1.1/include/cecloader.h --- libcec-2.0.4/include/cecloader.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/include/cecloader.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. @@ -130,7 +130,7 @@ if (!g_libCEC) { #if defined(__APPLE__) - g_libCEC = dlopen(strLib ? strLib : "libcec.dylib", RTLD_LAZY); + g_libCEC = dlopen(strLib ? strLib : "libcec." CEC_LIB_VERSION_MAJOR_STR ".dylib", RTLD_LAZY); #else g_libCEC = dlopen(strLib ? strLib : "libcec.so." CEC_LIB_VERSION_MAJOR_STR, RTLD_LAZY); #endif diff -Nru libcec-2.0.4/include/cectypes.h libcec-2.1.1/include/cectypes.h --- libcec-2.0.4/include/cectypes.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/include/cectypes.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. @@ -175,6 +175,11 @@ #define CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER 1 /*! + * default value for settings "wake up when deactivating the screensaver" + */ +#define CEC_DEFAULT_SETTING_POWER_ON_SCREENSAVER 1 + +/*! * default value for settings "power off on standby" */ #define CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY 1 @@ -265,6 +270,11 @@ #define CEC_FORWARD_STANDBY_MIN_INTERVAL 10000 /*! + * default timeout in milliseconds for combo keys + */ +#define CEC_DEFAULT_COMBO_TIMEOUT_MS 1000 + +/*! * the virtual device path to use for the Raspberry Pi's CEC wire */ #define CEC_RPI_VIRTUAL_PATH "Raspberry Pi" @@ -302,13 +312,15 @@ /*! * libCEC's minor version number */ -#define CEC_LIB_VERSION_MINOR 0 +#define CEC_LIB_VERSION_MINOR 1 #define MSGSTART 0xFF #define MSGEND 0xFE #define MSGESC 0xFD #define ESCOFFSET 3 +// defines to make compile time checks for certain features easy +#define CEC_FEATURE_CONFIGURABLE_COMBO_KEY 1 typedef enum cec_abort_reason { @@ -691,7 +703,7 @@ CEC_USER_CONTROL_CODE_AN_RETURN = 0x91, CEC_USER_CONTROL_CODE_AN_CHANNELS_LIST = 0x96, CEC_USER_CONTROL_CODE_MAX = 0x96, - CEC_USER_CONTROL_CODE_UNKNOWN + CEC_USER_CONTROL_CODE_UNKNOWN = 0xFF } cec_user_control_code; typedef enum cec_logical_address @@ -813,26 +825,26 @@ typedef enum cec_vendor_id { + CEC_VENDOR_TOSHIBA = 0x000039, CEC_VENDOR_SAMSUNG = 0x0000F0, - CEC_VENDOR_LG = 0x00E091, - CEC_VENDOR_PANASONIC = 0x008045, - CEC_VENDOR_PIONEER = 0x00E036, + CEC_VENDOR_DENON = 0x0005CD, + CEC_VENDOR_LOEWE = 0x000982, CEC_VENDOR_ONKYO = 0x0009B0, - CEC_VENDOR_YAMAHA = 0x00A0DE, - CEC_VENDOR_PHILIPS = 0x00903E, - CEC_VENDOR_SONY = 0x080046, - CEC_VENDOR_TOSHIBA = 0x000039, + CEC_VENDOR_MEDION = 0x000CB8, CEC_VENDOR_AKAI = 0x0020C7, CEC_VENDOR_AOC = 0x002467, - CEC_VENDOR_BENQ = 0x8065E9, + CEC_VENDOR_PANASONIC = 0x008045, + CEC_VENDOR_PHILIPS = 0x00903E, CEC_VENDOR_DAEWOO = 0x009053, + CEC_VENDOR_YAMAHA = 0x00A0DE, CEC_VENDOR_GRUNDIG = 0x00D0D5, - CEC_VENDOR_MEDION = 0x000CB8, + CEC_VENDOR_PIONEER = 0x00E036, + CEC_VENDOR_LG = 0x00E091, CEC_VENDOR_SHARP = 0x08001F, - CEC_VENDOR_VIZIO = 0x6B746D, + CEC_VENDOR_SONY = 0x080046, CEC_VENDOR_BROADCOM = 0x18C086, - CEC_VENDOR_LOEWE = 0x000982, - + CEC_VENDOR_VIZIO = 0x6B746D, + CEC_VENDOR_BENQ = 0x8065E9, CEC_VENDOR_UNKNOWN = 0 } cec_vendor_id; @@ -876,6 +888,18 @@ char comm[1024]; /**< the name of the com port */ } cec_adapter; +typedef struct cec_adapter_descriptor +{ + char strComPath[1024]; /**< the path to the com port */ + char strComName[1024]; /**< the name of the com port */ + uint16_t iVendorId; + uint16_t iProductId; + uint16_t iFirmwareVersion; + uint16_t iPhysicalAddress; + uint32_t iFirmwareBuildDate; + cec_adapter_type adapterType; +} cec_adapter_descriptor; + typedef struct cec_datapacket { uint8_t data[100]; /**< the actual data */ @@ -1256,7 +1280,9 @@ CEC_ALERT_SERVICE_DEVICE, CEC_ALERT_CONNECTION_LOST, CEC_ALERT_PERMISSION_ERROR, - CEC_ALERT_PORT_BUSY + CEC_ALERT_PORT_BUSY, + CEC_ALERT_PHYSICAL_ADDRESS_ERROR, + CEC_ALERT_TV_POLL_FAILED } libcec_alert; typedef enum libcec_parameter_type @@ -1378,7 +1404,10 @@ CEC_CLIENT_VERSION_2_0_2 = 0x2002, CEC_CLIENT_VERSION_2_0_3 = 0x2003, CEC_CLIENT_VERSION_2_0_4 = 0x2004, - CEC_CLIENT_VERSION_CURRENT = 0x2004 + CEC_CLIENT_VERSION_2_0_5 = 0x2005, + CEC_CLIENT_VERSION_2_1_0 = 0x2100, + CEC_CLIENT_VERSION_2_1_1 = 0x2101, + CEC_CLIENT_VERSION_CURRENT = 0x2101 } cec_client_version; typedef enum cec_server_version @@ -1405,7 +1434,10 @@ CEC_SERVER_VERSION_2_0_2 = 0x2002, CEC_SERVER_VERSION_2_0_3 = 0x2003, CEC_SERVER_VERSION_2_0_4 = 0x2004, - CEC_SERVER_VERSION_CURRENT = 0x2004 + CEC_SERVER_VERSION_2_0_5 = 0x2005, + CEC_SERVER_VERSION_2_1_0 = 0x2100, + CEC_SERVER_VERSION_2_1_1 = 0x2101, + CEC_SERVER_VERSION_CURRENT = 0x2101 } cec_server_version; struct libcec_configuration @@ -1428,6 +1460,7 @@ uint8_t bUseTVMenuLanguage; /*!< use the menu language of the TV in the player application */ uint8_t bActivateSource; /*!< make libCEC the active source on the bus when starting the player application */ uint8_t bPowerOffScreensaver; /*!< put devices in standby mode when activating the screensaver */ + uint8_t bPowerOnScreensaver; /*!< wake devices when deactivating the screensaver */ uint8_t bPowerOffOnStandby; /*!< put this PC in standby mode when the TV is switched off. only used when bShutdownOnStandby = 0 */ uint8_t bSendInactiveSource; /*!< send an 'inactive source' message when stopping the player. added in 1.5.1 */ @@ -1444,6 +1477,8 @@ cec_version cecVersion; /*!< CEC spec version to use by libCEC. defaults to v1.4. added in 1.8.0 */ cec_adapter_type adapterType; /*!< type of the CEC adapter that we're connected to. added in 1.8.2 */ uint8_t iDoubleTapTimeoutMs; /*!< prevent double taps withing this timeout. defaults to 200ms. added in 2.0.0 */ + cec_user_control_code comboKey; /*!< key code that initiates combo keys. defaults to CEC_USER_CONTROL_CODE_F1_BLUE. CEC_USER_CONTROL_CODE_UNKNOWN to disable. added in 2.0.5 */ + uint32_t iComboKeyTimeoutMs; /*!< timeout until the combo key is sent as normal keypress */ #ifdef __cplusplus libcec_configuration(void) { Clear(); } @@ -1477,7 +1512,10 @@ bMonitorOnly == other.bMonitorOnly && cecVersion == other.cecVersion && adapterType == other.adapterType && - iDoubleTapTimeoutMs == other.iDoubleTapTimeoutMs); + iDoubleTapTimeoutMs == other.iDoubleTapTimeoutMs && + (other.clientVersion <= CEC_CLIENT_VERSION_2_0_4 || comboKey == other.comboKey) && + (other.clientVersion <= CEC_CLIENT_VERSION_2_0_4 || iComboKeyTimeoutMs == other.iComboKeyTimeoutMs) && + (other.clientVersion < CEC_CLIENT_VERSION_2_1_0 || bPowerOnScreensaver == other.bPowerOnScreensaver)); } bool operator!=(const libcec_configuration &other) const @@ -1494,13 +1532,14 @@ baseDevice = (cec_logical_address)CEC_DEFAULT_BASE_DEVICE; iHDMIPort = CEC_DEFAULT_HDMI_PORT; tvVendor = (uint64_t)CEC_VENDOR_UNKNOWN; - clientVersion = (uint32_t)CEC_CLIENT_VERSION_2_0_0; - serverVersion = (uint32_t)CEC_SERVER_VERSION_2_0_0; + clientVersion = (uint32_t)CEC_CLIENT_VERSION_CURRENT; + serverVersion = (uint32_t)CEC_SERVER_VERSION_CURRENT; bAutodetectAddress = 0; bGetSettingsFromROM = CEC_DEFAULT_SETTING_GET_SETTINGS_FROM_ROM; bUseTVMenuLanguage = CEC_DEFAULT_SETTING_USE_TV_MENU_LANGUAGE; bActivateSource = CEC_DEFAULT_SETTING_ACTIVATE_SOURCE; bPowerOffScreensaver = CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER; + bPowerOnScreensaver = CEC_DEFAULT_SETTING_POWER_ON_SCREENSAVER; bPowerOffOnStandby = CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY; bShutdownOnStandby = CEC_DEFAULT_SETTING_SHUTDOWN_ON_STANDBY; bSendInactiveSource = CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE; @@ -1512,6 +1551,8 @@ cecVersion = (cec_version)CEC_DEFAULT_SETTING_CEC_VERSION; adapterType = ADAPTERTYPE_UNKNOWN; iDoubleTapTimeoutMs = CEC_DOUBLE_TAP_TIMEOUT_MS; + comboKey = CEC_USER_CONTROL_CODE_STOP; + iComboKeyTimeoutMs = CEC_DEFAULT_COMBO_TIMEOUT_MS; memset(strDeviceName, 0, 13); deviceTypes.Clear(); diff -Nru libcec-2.0.4/src/CecSharpTester/CecSharpClient.cs libcec-2.1.1/src/CecSharpTester/CecSharpClient.cs --- libcec-2.0.4/src/CecSharpTester/CecSharpClient.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/CecSharpTester/CecSharpClient.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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-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. @@ -43,7 +43,7 @@ Config = new LibCECConfiguration(); Config.DeviceTypes.Types[0] = CecDeviceType.RecordingDevice; Config.DeviceName = "CEC Tester"; - Config.ClientVersion = CecClientVersion.Version2_0_4; + Config.ClientVersion = CecClientVersion.Version2_1_0; Config.SetCallbacks(this); LogLevel = (int)CecLogLevel.All; diff -Nru libcec-2.0.4/src/CecSharpTester/Properties/AssemblyInfo.cs libcec-2.1.1/src/CecSharpTester/Properties/AssemblyInfo.cs --- libcec-2.0.4/src/CecSharpTester/Properties/AssemblyInfo.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/CecSharpTester/Properties/AssemblyInfo.cs 2013-03-09 20:14:55.000000000 +0000 @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Pulse-Eight Ltd.")] [assembly: AssemblyProduct("CecSharpClient")] -[assembly: AssemblyCopyright("Copyright (c) Pulse-Eight Ltd. 2011-2012")] +[assembly: AssemblyCopyright("Copyright (c) Pulse-Eight Ltd. 2011-2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.4.0")] -[assembly: AssemblyFileVersion("2.0.4.0")] +[assembly: AssemblyVersion("2.1.1.0")] +[assembly: AssemblyFileVersion("2.1.1.0")] diff -Nru libcec-2.0.4/src/LibCecSharp/AssemblyInfo.cpp libcec-2.1.1/src/LibCecSharp/AssemblyInfo.cpp --- libcec-2.0.4/src/LibCecSharp/AssemblyInfo.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecSharp/AssemblyInfo.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -9,11 +9,11 @@ [assembly:AssemblyConfigurationAttribute("")]; [assembly:AssemblyCompanyAttribute("Pulse-Eight Ltd.")]; [assembly:AssemblyProductAttribute("LibCecSharp")]; -[assembly:AssemblyCopyrightAttribute("Copyright (c) Pulse-Eight Ltd. 2011-2012")]; +[assembly:AssemblyCopyrightAttribute("Copyright (c) Pulse-Eight Ltd. 2011-2013")]; [assembly:AssemblyTrademarkAttribute("")]; [assembly:AssemblyCultureAttribute("")]; -[assembly:AssemblyVersionAttribute("2.0.4.0")]; +[assembly:AssemblyVersionAttribute("2.1.1.0")]; [assembly:ComVisible(false)]; [assembly:CLSCompliantAttribute(true)]; diff -Nru libcec-2.0.4/src/LibCecSharp/CecSharpTypes.h libcec-2.1.1/src/LibCecSharp/CecSharpTypes.h --- libcec-2.0.4/src/LibCecSharp/CecSharpTypes.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecSharp/CecSharpTypes.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. @@ -764,22 +764,26 @@ /// public enum class CecVendorId { + Toshiba = 0x000039, Samsung = 0x0000F0, - LG = 0x00E091, - Panasonic = 0x008045, - Pioneer = 0x00E036, + Denon = 0x0005CD, + Loewe = 0x000982, Onkyo = 0x0009B0, - Yamaha = 0x00A0DE, - Philips = 0x00903E, - Sony = 0x080046, - Toshiba = 0x000039, + Medion = 0x000CB8, Akai = 0x0020C7, - Benq = 0x8065E9, + AOC = 0x002467, + Panasonic = 0x008045, + Philips = 0x00903E, Daewoo = 0x009053, + Yamaha = 0x00A0DE, Grundig = 0x00D0D5, - Medion = 0x000CB8, + Pioneer = 0x00E036, + LG = 0x00E091, Sharp = 0x08001F, + Sony = 0x080046, + Broadcom = 0x18C086, Vizio = 0x6B746D, + Benq = 0x8065E9, Unknown = 0 }; @@ -1179,7 +1183,19 @@ /// /// v2.0.4 /// - Version2_0_4 = 0x2004 + Version2_0_4 = 0x2004, + /// + /// v2.0.5 + /// + Version2_0_5 = 0x2005, + /// + /// v2.1.0 + /// + Version2_1_0 = 0x2100, + /// + /// v2.1.1 + /// + Version2_1_1 = 0x2101 }; /// @@ -1274,7 +1290,19 @@ /// /// v2.0.4 /// - Version2_0_4 = 0x2004 + Version2_0_4 = 0x2004, + /// + /// v2.0.5 + /// + Version2_0_5 = 0x2005, + /// + /// v2.1.0 + /// + Version2_1_0 = 0x2100, + /// + /// v2.1.1 + /// + Version2_1_1 = 0x2101 }; /// @@ -1297,7 +1325,11 @@ /// /// Raspberry Pi /// - RaspberryPi = 0x100 + RaspberryPi = 0x100, + /// + /// TDA995x + /// + TDA995x = 0x200 }; /// @@ -1661,8 +1693,8 @@ PhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS; BaseDevice = (CecLogicalAddress)CEC_DEFAULT_BASE_DEVICE; HDMIPort = CEC_DEFAULT_HDMI_PORT; - ClientVersion = CecClientVersion::VersionPre1_5; - ServerVersion = CecServerVersion::VersionPre1_5; + ClientVersion = CecClientVersion::Version2_1_1; + ServerVersion = CecServerVersion::Version2_1_1; TvVendor = CecVendorId::Unknown; GetSettingsFromROM = false; @@ -1770,6 +1802,9 @@ if (ServerVersion >= CecServerVersion::Version1_8_2) AdapterType = (CecAdapterType)config.adapterType; + + if (ServerVersion >= CecServerVersion::Version2_1_0) + PowerOnScreensaver = config.bPowerOnScreensaver == 1; } /// @@ -1908,6 +1943,11 @@ /// The type of adapter that libCEC is connected to. /// property CecAdapterType AdapterType; + + /// + /// True to power on when quitting the screensaver. + /// + property bool PowerOnScreensaver; }; // the callback methods are called by unmanaged code, so we need some delegates for this diff -Nru libcec-2.0.4/src/LibCecSharp/LibCecSharp.cpp libcec-2.1.1/src/LibCecSharp/LibCecSharp.cpp --- libcec-2.0.4/src/LibCecSharp/LibCecSharp.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecSharp/LibCecSharp.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -377,7 +377,7 @@ for (uint8_t iPtr = 0; iPtr < 16; iPtr++) if (activeDevices[iPtr]) - retVal->Addresses[iDevices++] = (CecLogicalAddress)iPtr; + retVal->Set((CecLogicalAddress)iPtr); return retVal; } @@ -474,7 +474,11 @@ String ^ GetDeviceOSDName(CecLogicalAddress logicalAddress) { cec_osd_name osd = m_libCec->GetDeviceOSDName((cec_logical_address) logicalAddress); - return gcnew String(osd.name); + // we need to terminate with \0, and we only got 14 chars in osd.name + char strOsdName[15]; + memset(strOsdName, 0, sizeof(strOsdName)); + memcpy(strOsdName, osd.name, sizeof(osd.name)); + return gcnew String(strOsdName); } /// @@ -822,6 +826,9 @@ if (netConfig->ServerVersion >= CecServerVersion::Version1_8_0) config.cecVersion = (cec_version)netConfig->CECVersion; + if (netConfig->ServerVersion >= CecServerVersion::Version2_1_0) + config.bPowerOnScreensaver = netConfig->PowerOnScreensaver ? 1 : 0; + config.callbacks = &g_cecCallbacks; } diff -Nru libcec-2.0.4/src/LibCecTray/Program.cs libcec-2.1.1/src/LibCecTray/Program.cs --- libcec-2.0.4/src/LibCecTray/Program.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/Program.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/Properties/AssemblyInfo.cs libcec-2.1.1/src/LibCecTray/Properties/AssemblyInfo.cs --- libcec-2.0.4/src/LibCecTray/Properties/AssemblyInfo.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/Properties/AssemblyInfo.cs 2013-03-09 20:14:55.000000000 +0000 @@ -9,7 +9,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Pulse-Eight Ltd.")] [assembly: AssemblyProduct("libCEC Tray")] -[assembly: AssemblyCopyright("Copyright (c) Pulse-Eight Ltd. 2011-2012")] +[assembly: AssemblyCopyright("Copyright (c) Pulse-Eight Ltd. 2011-2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.4.0")] -[assembly: AssemblyFileVersion("2.0.4.0")] +[assembly: AssemblyVersion("2.1.1.0")] +[assembly: AssemblyFileVersion("2.1.1.0")] diff -Nru libcec-2.0.4/src/LibCecTray/Properties/Resources.Designer.cs libcec-2.1.1/src/LibCecTray/Properties/Resources.Designer.cs --- libcec-2.0.4/src/LibCecTray/Properties/Resources.Designer.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/Properties/Resources.Designer.cs 2013-03-09 20:14:55.000000000 +0000 @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.5448 +// Runtime Version:2.0.50727.5466 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -304,7 +304,7 @@ } /// - /// Looks up a localized string similar to Pulse-Eight USB-CEC Adapter - libCECTray BETA3. + /// Looks up a localized string similar to Pulse-Eight USB-CEC Adapter - libCECTray. /// internal static string app_name { get { diff -Nru libcec-2.0.4/src/LibCecTray/Properties/Resources.resx libcec-2.1.1/src/LibCecTray/Properties/Resources.resx --- libcec-2.0.4/src/LibCecTray/Properties/Resources.resx 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/Properties/Resources.resx 2013-03-09 20:14:55.000000000 +0000 @@ -121,7 +121,7 @@ Could not detect to any CEC adapter. Please check your configuration. Do you want to try again? - Pulse-Eight USB-CEC Adapter - libCECTray BETA3 + Pulse-Eight USB-CEC Adapter - libCECTray You have changed the device type. Persist the configuration, and restart the application to use the new setting. diff -Nru libcec-2.0.4/src/LibCecTray/controller/Actions.cs libcec-2.1.1/src/LibCecTray/controller/Actions.cs --- libcec-2.0.4/src/LibCecTray/controller/Actions.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/Actions.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/CECController.cs libcec-2.1.1/src/LibCecTray/controller/CECController.cs --- libcec-2.0.4/src/LibCecTray/controller/CECController.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/CECController.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -203,6 +203,11 @@ /// public void Initialise() { + // only load once + if (_initialised) + return; + _initialised = true; + CECActions.ConnectToDevice(Config); Applications.Initialise(this); } @@ -215,6 +220,7 @@ Lib.DisableCallbacks(); Lib.StandbyDevices(CecLogicalAddress.Broadcast); Lib.Close(); + _initialised = false; } /// @@ -438,7 +444,7 @@ { if (_config == null) { - _config = new LibCECConfiguration { DeviceName = "CEC Tray", ClientVersion = CecClientVersion.Version2_0_4 }; + _config = new LibCECConfiguration { DeviceName = "CEC Tray", ClientVersion = CecClientVersion.Version2_1_0 }; _config.DeviceTypes.Types[0] = CecDeviceType.RecordingDevice; _config.SetCallbacks(this); @@ -519,6 +525,7 @@ private readonly CECTray _gui; public Actions CECActions; private bool _deviceChangeWarningDisplayed; + private bool _initialised; #endregion } diff -Nru libcec-2.0.4/src/LibCecTray/controller/actions/ConnectToDevice.cs libcec-2.1.1/src/LibCecTray/controller/actions/ConnectToDevice.cs --- libcec-2.0.4/src/LibCecTray/controller/actions/ConnectToDevice.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/actions/ConnectToDevice.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/actions/GetCurrentPhysicalAddress.cs libcec-2.1.1/src/LibCecTray/controller/actions/GetCurrentPhysicalAddress.cs --- libcec-2.0.4/src/LibCecTray/controller/actions/GetCurrentPhysicalAddress.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/actions/GetCurrentPhysicalAddress.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/actions/RescanDevices.cs libcec-2.1.1/src/LibCecTray/controller/actions/RescanDevices.cs --- libcec-2.0.4/src/LibCecTray/controller/actions/RescanDevices.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/actions/RescanDevices.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/actions/SendActivateSource.cs libcec-2.1.1/src/LibCecTray/controller/actions/SendActivateSource.cs --- libcec-2.0.4/src/LibCecTray/controller/actions/SendActivateSource.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/actions/SendActivateSource.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/actions/SendImageViewOn.cs libcec-2.1.1/src/LibCecTray/controller/actions/SendImageViewOn.cs --- libcec-2.0.4/src/LibCecTray/controller/actions/SendImageViewOn.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/actions/SendImageViewOn.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/actions/SendStandby.cs libcec-2.1.1/src/LibCecTray/controller/actions/SendStandby.cs --- libcec-2.0.4/src/LibCecTray/controller/actions/SendStandby.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/actions/SendStandby.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/actions/ShowDeviceInfo.cs libcec-2.1.1/src/LibCecTray/controller/actions/ShowDeviceInfo.cs --- libcec-2.0.4/src/LibCecTray/controller/actions/ShowDeviceInfo.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/actions/ShowDeviceInfo.cs 2013-03-09 20:14:55.000000000 +0000 @@ -1,3 +1,35 @@ +/* + * This file is part of the libCEC(R) library. + * + * 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. + * + * This program is dual-licensed; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * + * Alternatively, you can license this library under a commercial license, + * please contact Pulse-Eight Licensing for more information. + * + * For more information contact: + * Pulse-Eight Licensing + * http://www.pulse-eight.com/ + * http://www.pulse-eight.net/ + */ + using CecSharp; using LibCECTray.Properties; using LibCECTray.ui; diff -Nru libcec-2.0.4/src/LibCecTray/controller/actions/UpdateConfiguration.cs libcec-2.1.1/src/LibCecTray/controller/actions/UpdateConfiguration.cs --- libcec-2.0.4/src/LibCecTray/controller/actions/UpdateConfiguration.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/actions/UpdateConfiguration.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/actions/UpdateConnectedDevice.cs libcec-2.1.1/src/LibCecTray/controller/actions/UpdateConnectedDevice.cs --- libcec-2.0.4/src/LibCecTray/controller/actions/UpdateConnectedDevice.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/actions/UpdateConnectedDevice.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/actions/UpdateDeviceInfo.cs libcec-2.1.1/src/LibCecTray/controller/actions/UpdateDeviceInfo.cs --- libcec-2.0.4/src/LibCecTray/controller/actions/UpdateDeviceInfo.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/actions/UpdateDeviceInfo.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/actions/UpdateEvent.cs libcec-2.1.1/src/LibCecTray/controller/actions/UpdateEvent.cs --- libcec-2.0.4/src/LibCecTray/controller/actions/UpdateEvent.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/actions/UpdateEvent.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/actions/UpdatePhysicalAddress.cs libcec-2.1.1/src/LibCecTray/controller/actions/UpdatePhysicalAddress.cs --- libcec-2.0.4/src/LibCecTray/controller/actions/UpdatePhysicalAddress.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/actions/UpdatePhysicalAddress.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/applications/ApplicationController.cs libcec-2.1.1/src/LibCecTray/controller/applications/ApplicationController.cs --- libcec-2.0.4/src/LibCecTray/controller/applications/ApplicationController.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/applications/ApplicationController.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -114,7 +114,20 @@ var item = args.RowIndex < ButtonConfig.Count ? ButtonConfig[args.RowIndex] : null; if (item == null) return; - (new CecButtonConfigUI(item)).ShowDialog(); + if (args.ColumnIndex >= 0) + { + (new CecButtonConfigUI(item)).ShowDialog(); + } + else + { + var mappedButton = ButtonConfig[item.Key]; + if (mappedButton == null || mappedButton.Value.Empty()) + return; + + var controlWindow = FindInstance(); + if (controlWindow != IntPtr.Zero && item.Key.Duration == 0) + mappedButton.Value.Transmit(controlWindow); + } }; foreach (var item in _buttonConfig) @@ -235,7 +248,7 @@ return false; var controlWindow = FindInstance(); - if (controlWindow != IntPtr.Zero && key.Duration == 0) + if (controlWindow != IntPtr.Zero && (key.Duration == 0 || key.Duration > 500)) return mappedButton.Value.Transmit(controlWindow); return false; diff -Nru libcec-2.0.4/src/LibCecTray/controller/applications/ApplicationControllerUI.cs libcec-2.1.1/src/LibCecTray/controller/applications/ApplicationControllerUI.cs --- libcec-2.0.4/src/LibCecTray/controller/applications/ApplicationControllerUI.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/applications/ApplicationControllerUI.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/applications/ApplicationInput.cs libcec-2.1.1/src/LibCecTray/controller/applications/ApplicationInput.cs --- libcec-2.0.4/src/LibCecTray/controller/applications/ApplicationInput.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/applications/ApplicationInput.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/applications/Applications.cs libcec-2.1.1/src/LibCecTray/controller/applications/Applications.cs --- libcec-2.0.4/src/LibCecTray/controller/applications/Applications.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/applications/Applications.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/applications/CecButtonConfig.cs libcec-2.1.1/src/LibCecTray/controller/applications/CecButtonConfig.cs --- libcec-2.0.4/src/LibCecTray/controller/applications/CecButtonConfig.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/applications/CecButtonConfig.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/applications/CecButtonConfigUI.cs libcec-2.1.1/src/LibCecTray/controller/applications/CecButtonConfigUI.cs --- libcec-2.0.4/src/LibCecTray/controller/applications/CecButtonConfigUI.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/applications/CecButtonConfigUI.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/applications/ConfigureApplication.cs libcec-2.1.1/src/LibCecTray/controller/applications/ConfigureApplication.cs --- libcec-2.0.4/src/LibCecTray/controller/applications/ConfigureApplication.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/applications/ConfigureApplication.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/applications/IControllerTabPage.cs libcec-2.1.1/src/LibCecTray/controller/applications/IControllerTabPage.cs --- libcec-2.0.4/src/LibCecTray/controller/applications/IControllerTabPage.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/applications/IControllerTabPage.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/applications/KeyInput.cs libcec-2.1.1/src/LibCecTray/controller/applications/KeyInput.cs --- libcec-2.0.4/src/LibCecTray/controller/applications/KeyInput.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/applications/KeyInput.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -176,8 +176,39 @@ { if (input != null) { - foreach (var item in input._input) - _input.Add(item); + bool foundModifier = false; + if (KeyCount > 0) + { + for (int i = _input.Count - 1; i >= 0; i--) + { + + if (_input[i].Data.Keyboard.Flags == 0 && ( + (ushort)WindowsAPI.VirtualKeyCode.VK_SHIFT == _input[i].Data.Keyboard.KeyCode || + (ushort)WindowsAPI.VirtualKeyCode.VK_LSHIFT == _input[i].Data.Keyboard.KeyCode || + (ushort)WindowsAPI.VirtualKeyCode.VK_RSHIFT == _input[i].Data.Keyboard.KeyCode || + + (ushort)WindowsAPI.VirtualKeyCode.VK_CONTROL == _input[i].Data.Keyboard.KeyCode || + (ushort)WindowsAPI.VirtualKeyCode.VK_LCONTROL == _input[i].Data.Keyboard.KeyCode || + (ushort)WindowsAPI.VirtualKeyCode.VK_RCONTROL == _input[i].Data.Keyboard.KeyCode || + + (ushort)WindowsAPI.VirtualKeyCode.VK_MENU == _input[i].Data.Keyboard.KeyCode || + (ushort)WindowsAPI.VirtualKeyCode.VK_LMENU == _input[i].Data.Keyboard.KeyCode || + (ushort)WindowsAPI.VirtualKeyCode.VK_RMENU == _input[i].Data.Keyboard.KeyCode + )) + { + foundModifier = true; + _input.Insert(i+1, input._input[0]); + _input.Insert(i+2, input._input[1]); + break; + } + } + } + + if (!foundModifier) + { + _input.Add(input._input[0]); + _input.Add(input._input[1]); + } } return this; } @@ -202,12 +233,38 @@ public ApplicationAction RemoveItem(int index) { - //both keyup and keydown - if (index * 2 + 1 < _input.Count) + var current = 0; + var downKeyIndex = 0; + var upKeyIndex = 0; + bool downFound = false; + + for (int i = 0; i < _input.Count; i++) { - _input.RemoveAt(index * 2); - _input.RemoveAt(index * 2); + if (_input[i].Data.Keyboard.Flags == 0 && !downFound) + { + if (index == current) + { + downKeyIndex = i; + downFound = true; + } + current++; + } + else if(_input[i].Data.Keyboard.Flags != 0 && downFound) + { + if (_input[i].Data.Keyboard.KeyCode == _input[downKeyIndex].Data.Keyboard.KeyCode) + { + upKeyIndex = i; + break; + } + } } + + WindowsAPI.Input downKey = _input[downKeyIndex]; + WindowsAPI.Input upKey = _input[upKeyIndex]; + + _input.Remove(downKey); + _input.Remove(upKey); + return this; } @@ -221,7 +278,7 @@ { var tmp = string.Format(KeyCount > 1 ? "[{0}] " : "{0} ", WindowsAPI.GetVirtualKeyName((WindowsAPI.VirtualKeyCode) input.Data.Keyboard.KeyCode)); - current += tmp.Length + 1; + current += tmp.Length; if (index <= current) return RemoveItem(item); item++; @@ -233,4 +290,4 @@ private readonly List _input = new List(); } -} \ No newline at end of file +} diff -Nru libcec-2.0.4/src/LibCecTray/controller/applications/WindowsAPI.cs libcec-2.1.1/src/LibCecTray/controller/applications/WindowsAPI.cs --- libcec-2.0.4/src/LibCecTray/controller/applications/WindowsAPI.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/applications/WindowsAPI.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -451,4 +451,4 @@ return null; } } -} \ No newline at end of file +} diff -Nru libcec-2.0.4/src/LibCecTray/controller/applications/internal/WMCController.cs libcec-2.1.1/src/LibCecTray/controller/applications/internal/WMCController.cs --- libcec-2.0.4/src/LibCecTray/controller/applications/internal/WMCController.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/applications/internal/WMCController.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/applications/internal/XBMCController.cs libcec-2.1.1/src/LibCecTray/controller/applications/internal/XBMCController.cs --- libcec-2.0.4/src/LibCecTray/controller/applications/internal/XBMCController.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/applications/internal/XBMCController.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/controller/applications/internal/XBMCControllerUI.cs libcec-2.1.1/src/LibCecTray/controller/applications/internal/XBMCControllerUI.cs --- libcec-2.0.4/src/LibCecTray/controller/applications/internal/XBMCControllerUI.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/controller/applications/internal/XBMCControllerUI.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/settings/CECSetting.cs libcec-2.1.1/src/LibCecTray/settings/CECSetting.cs --- libcec-2.0.4/src/LibCecTray/settings/CECSetting.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/settings/CECSetting.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/settings/CECSettingBool.cs libcec-2.1.1/src/LibCecTray/settings/CECSettingBool.cs --- libcec-2.0.4/src/LibCecTray/settings/CECSettingBool.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/settings/CECSettingBool.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/settings/CECSettingByte.cs libcec-2.1.1/src/LibCecTray/settings/CECSettingByte.cs --- libcec-2.0.4/src/LibCecTray/settings/CECSettingByte.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/settings/CECSettingByte.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/settings/CECSettingDeviceType.cs libcec-2.1.1/src/LibCecTray/settings/CECSettingDeviceType.cs --- libcec-2.0.4/src/LibCecTray/settings/CECSettingDeviceType.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/settings/CECSettingDeviceType.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/settings/CECSettingLogicalAddress.cs libcec-2.1.1/src/LibCecTray/settings/CECSettingLogicalAddress.cs --- libcec-2.0.4/src/LibCecTray/settings/CECSettingLogicalAddress.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/settings/CECSettingLogicalAddress.cs 2013-03-09 20:14:55.000000000 +0000 @@ -1,3 +1,35 @@ +/* + * This file is part of the libCEC(R) library. + * + * 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. + * + * This program is dual-licensed; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * + * Alternatively, you can license this library under a commercial license, + * please contact Pulse-Eight Licensing for more information. + * + * For more information contact: + * Pulse-Eight Licensing + * http://www.pulse-eight.com/ + * http://www.pulse-eight.net/ + */ + using System.Windows.Forms; using CecSharp; using LibCECTray.Properties; diff -Nru libcec-2.0.4/src/LibCecTray/settings/CECSettingLogicalAddresses.cs libcec-2.1.1/src/LibCecTray/settings/CECSettingLogicalAddresses.cs --- libcec-2.0.4/src/LibCecTray/settings/CECSettingLogicalAddresses.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/settings/CECSettingLogicalAddresses.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/settings/CECSettingNumeric.cs libcec-2.1.1/src/LibCecTray/settings/CECSettingNumeric.cs --- libcec-2.0.4/src/LibCecTray/settings/CECSettingNumeric.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/settings/CECSettingNumeric.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -158,10 +158,13 @@ ResetItems(BaseItems.Count == 0); - control.SelectedValueChanged += delegate - { - Value = BaseItems[control.SelectedIndex]; - }; + if (BaseItems.Count > 0 && control.SelectedIndex < BaseItems.Count) + { + control.SelectedValueChanged += delegate + { + Value = BaseItems[control.SelectedIndex]; + }; + } } public override Control ValueControl diff -Nru libcec-2.0.4/src/LibCecTray/settings/CECSettingString.cs libcec-2.1.1/src/LibCecTray/settings/CECSettingString.cs --- libcec-2.0.4/src/LibCecTray/settings/CECSettingString.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/settings/CECSettingString.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/settings/CECSettingUShort.cs libcec-2.1.1/src/LibCecTray/settings/CECSettingUShort.cs --- libcec-2.0.4/src/LibCecTray/settings/CECSettingUShort.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/settings/CECSettingUShort.cs 2013-03-09 20:14:55.000000000 +0000 @@ -1,3 +1,35 @@ +/* + * This file is part of the libCEC(R) library. + * + * 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. + * + * This program is dual-licensed; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * + * Alternatively, you can license this library under a commercial license, + * please contact Pulse-Eight Licensing for more information. + * + * For more information contact: + * Pulse-Eight Licensing + * http://www.pulse-eight.com/ + * http://www.pulse-eight.net/ + */ + using System.Globalization; using System.Windows.Forms; diff -Nru libcec-2.0.4/src/LibCecTray/settings/CECSettingVendorId.cs libcec-2.1.1/src/LibCecTray/settings/CECSettingVendorId.cs --- libcec-2.0.4/src/LibCecTray/settings/CECSettingVendorId.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/settings/CECSettingVendorId.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/settings/CECSettings.cs libcec-2.1.1/src/LibCecTray/settings/CECSettings.cs --- libcec-2.0.4/src/LibCecTray/settings/CECSettings.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/settings/CECSettings.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/ui/About.cs libcec-2.1.1/src/LibCecTray/ui/About.cs --- libcec-2.0.4/src/LibCecTray/ui/About.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/ui/About.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/ui/About.resx libcec-2.1.1/src/LibCecTray/ui/About.resx --- libcec-2.0.4/src/LibCecTray/ui/About.resx 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/ui/About.resx 2013-03-09 20:14:55.000000000 +0000 @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 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. diff -Nru libcec-2.0.4/src/LibCecTray/ui/AsyncForm.cs libcec-2.1.1/src/LibCecTray/ui/AsyncForm.cs --- libcec-2.0.4/src/LibCecTray/ui/AsyncForm.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/ui/AsyncForm.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/LibCecTray/ui/CECTray.cs libcec-2.1.1/src/LibCecTray/ui/CECTray.cs --- libcec-2.0.4/src/LibCecTray/ui/CECTray.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/ui/CECTray.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -63,7 +63,6 @@ { Text = Resources.app_name; InitializeComponent(); - _controller = new CECController(this); VisibleChanged += delegate { if (!Visible) @@ -81,7 +80,7 @@ private void CECTrayLoad(object sender, EventArgs e) { - _controller.Initialise(); + Controller.Initialise(); } protected override void Dispose(bool disposing) @@ -89,7 +88,7 @@ Hide(); if (disposing) { - _controller.Close(); + Controller.Close(); } if (disposing && (components != null)) { @@ -120,12 +119,12 @@ private void BSaveClick(object sender, EventArgs e) { - _controller.PersistSettings(); + Controller.PersistSettings(); } private void BReloadConfigClick(object sender, EventArgs e) { - _controller.ResetDefaultSettings(); + Controller.ResetDefaultSettings(); } #endregion @@ -170,22 +169,22 @@ private void BSendImageViewOnClick(object sender, EventArgs e) { - _controller.CECActions.SendImageViewOn(GetTargetDevice()); + Controller.CECActions.SendImageViewOn(GetTargetDevice()); } private void BStandbyClick(object sender, EventArgs e) { - _controller.CECActions.SendStandby(GetTargetDevice()); + Controller.CECActions.SendStandby(GetTargetDevice()); } private void BScanClick(object sender, EventArgs e) { - _controller.CECActions.ShowDeviceInfo(GetTargetDevice()); + Controller.CECActions.ShowDeviceInfo(GetTargetDevice()); } private void BActivateSourceClick(object sender, EventArgs e) { - _controller.CECActions.ActivateSource(GetTargetDevice()); + Controller.CECActions.ActivateSource(GetTargetDevice()); } private void CbCommandDestinationSelectedIndexChanged(object sender, EventArgs e) @@ -200,22 +199,22 @@ private void BVolUpClick(object sender, EventArgs e) { - _controller.Lib.VolumeUp(true); + Controller.Lib.VolumeUp(true); } private void BVolDownClick(object sender, EventArgs e) { - _controller.Lib.VolumeDown(true); + Controller.Lib.VolumeDown(true); } private void BMuteClick(object sender, EventArgs e) { - _controller.Lib.MuteAudio(true); + Controller.Lib.MuteAudio(true); } private void BRescanDevicesClick(object sender, EventArgs e) { - _controller.CECActions.RescanDevices(); + Controller.CECActions.RescanDevices(); } #endregion @@ -333,12 +332,12 @@ private void AboutToolStripMenuItemClick(object sender, EventArgs e) { - (new About(_controller.LibServerVersion, _controller.LibClientVersion, _controller.LibInfo)).ShowDialog(); + (new About(Controller.LibServerVersion, Controller.LibClientVersion, Controller.LibInfo)).ShowDialog(); } private void AdvancedModeToolStripMenuItemClick(object sender, EventArgs e) { - _controller.Settings.AdvancedMode.Value = !advancedModeToolStripMenuItem.Checked; + Controller.Settings.AdvancedMode.Value = !advancedModeToolStripMenuItem.Checked; ShowHideAdvanced(!advancedModeToolStripMenuItem.Checked); } @@ -372,12 +371,12 @@ { if (Visible && WindowState != FormWindowState.Minimized) { - _controller.Settings.StartHidden.Value = true; + Controller.Settings.StartHidden.Value = true; Hide(); } else { - _controller.Settings.StartHidden.Value = false; + Controller.Settings.StartHidden.Value = false; Show(); } } @@ -426,7 +425,7 @@ private void TsAdvancedClick(object sender, EventArgs e) { - _controller.Settings.AdvancedMode.Value = !tsAdvanced.Checked; + Controller.Settings.AdvancedMode.Value = !tsAdvanced.Checked; ShowHideAdvanced(!tsAdvanced.Checked); } @@ -482,10 +481,10 @@ #region Class members private ConfigTab _selectedTab = ConfigTab.Configuration; private string _log = string.Empty; - private readonly CECController _controller; + private CECController _controller; public CECController Controller { - get { return _controller; } + get { return _controller ?? (_controller = new CECController(this)); } } public Control.ControlCollection TabControls { @@ -499,8 +498,8 @@ private void AddNewApplicationToolStripMenuItemClick(object sender, EventArgs e) { - ConfigureApplication appConfig = new ConfigureApplication(_controller.Settings, _controller); - _controller.DisplayDialog(appConfig, false); + ConfigureApplication appConfig = new ConfigureApplication(Controller.Settings, Controller); + Controller.DisplayDialog(appConfig, false); } } } diff -Nru libcec-2.0.4/src/LibCecTray/ui/DeviceInformation.cs libcec-2.1.1/src/LibCecTray/ui/DeviceInformation.cs --- libcec-2.0.4/src/LibCecTray/ui/DeviceInformation.cs 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/LibCecTray/ui/DeviceInformation.cs 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/env.h libcec-2.1.1/src/env.h --- libcec-2.0.4/src/env.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/env.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/CECClient.cpp libcec-2.1.1/src/lib/CECClient.cpp --- libcec-2.0.4/src/lib/CECClient.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/CECClient.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -47,9 +47,6 @@ #define LIB_CEC m_processor->GetLib() #define ToString(x) CCECTypeUtils::ToString(x) -#define COMBO_KEY CEC_USER_CONTROL_CODE_STOP -#define COMBO_TIMEOUT_MS 1000 - CCECClient::CCECClient(CCECProcessor *processor, const libcec_configuration &configuration) : m_processor(processor), m_bInitialised(false), @@ -208,7 +205,7 @@ void CCECClient::ResetPhysicalAddress(void) { - SetPhysicalAddress(m_configuration); + SetPhysicalAddress(CEC_DEFAULT_PHYSICAL_ADDRESS); } void CCECClient::SetPhysicalAddress(const libcec_configuration &configuration) @@ -748,6 +745,45 @@ (uint8_t)CEC_AUDIO_VOLUME_STATUS_UNKNOWN; } +uint8_t CCECClient::AudioToggleMute(void) +{ + CCECBusDevice *device = GetPrimaryDevice(); + CCECAudioSystem *audio = m_processor->GetAudioSystem(); + + return device && audio && audio->IsPresent() ? + audio->MuteAudio(device->GetLogicalAddress()) : + (uint8_t)CEC_AUDIO_VOLUME_STATUS_UNKNOWN; +} + +uint8_t CCECClient::AudioMute(void) +{ + CCECBusDevice *device = GetPrimaryDevice(); + CCECAudioSystem *audio = m_processor->GetAudioSystem(); + uint8_t iStatus = device && audio && audio->IsPresent() ? audio->GetAudioStatus(device->GetLogicalAddress()) : (uint8_t)CEC_AUDIO_VOLUME_STATUS_UNKNOWN; + if ((iStatus & CEC_AUDIO_MUTE_STATUS_MASK) != CEC_AUDIO_MUTE_STATUS_MASK) + iStatus = audio->MuteAudio(device->GetLogicalAddress()); + + return iStatus; +} + +uint8_t CCECClient::AudioUnmute(void) +{ + CCECBusDevice *device = GetPrimaryDevice(); + CCECAudioSystem *audio = m_processor->GetAudioSystem(); + uint8_t iStatus = device && audio && audio->IsPresent() ? audio->GetAudioStatus(device->GetLogicalAddress()) : (uint8_t)CEC_AUDIO_VOLUME_STATUS_UNKNOWN; + if ((iStatus & CEC_AUDIO_MUTE_STATUS_MASK) == CEC_AUDIO_MUTE_STATUS_MASK) + iStatus = audio->MuteAudio(device->GetLogicalAddress()); + + return iStatus; +} + +uint8_t CCECClient::AudioStatus(void) +{ + CCECBusDevice *device = GetPrimaryDevice(); + CCECAudioSystem *audio = m_processor->GetAudioSystem(); + return device && audio && audio->IsPresent() ? audio->GetAudioStatus(device->GetLogicalAddress()) : (uint8_t)CEC_AUDIO_VOLUME_STATUS_UNKNOWN; +} + bool CCECClient::SendKeypress(const cec_logical_address iDestination, const cec_user_control_code key, bool bWait /* = true */) { CCECBusDevice *dest = m_processor->GetDevice(iDestination); @@ -786,6 +822,7 @@ configuration.wakeDevices = m_configuration.wakeDevices; configuration.powerOffDevices = m_configuration.powerOffDevices; configuration.bPowerOffScreensaver = m_configuration.bPowerOffScreensaver; + configuration.bPowerOnScreensaver = m_configuration.bPowerOnScreensaver; configuration.bPowerOffOnStandby = m_configuration.bPowerOffOnStandby; configuration.bSendInactiveSource = m_configuration.bSendInactiveSource; configuration.logicalAddresses = m_configuration.logicalAddresses; @@ -803,6 +840,7 @@ bool CCECClient::SetConfiguration(const libcec_configuration &configuration) { + libcec_configuration defaultSettings; bool bIsRunning(m_processor && m_processor->CECInitialised()); CCECBusDevice *primary = bIsRunning ? GetPrimaryDevice() : NULL; uint16_t iPA = primary ? primary->GetCurrentPhysicalAddress() : CEC_INVALID_PHYSICAL_ADDRESS; @@ -838,7 +876,24 @@ m_configuration.bMonitorOnly = configuration.bMonitorOnly; m_configuration.cecVersion = configuration.cecVersion; m_configuration.adapterType = configuration.adapterType; - m_configuration.deviceTypes.Add(CEC_DEVICE_TYPE_RECORDING_DEVICE); + m_configuration.iDoubleTapTimeoutMs = configuration.iDoubleTapTimeoutMs; + m_configuration.deviceTypes.Add(configuration.deviceTypes[0]); + + if (m_configuration.clientVersion >= CEC_CLIENT_VERSION_2_0_5) + { + m_configuration.comboKey = configuration.comboKey; + m_configuration.iComboKeyTimeoutMs = configuration.iComboKeyTimeoutMs; + } + else + { + m_configuration.comboKey = defaultSettings.comboKey; + m_configuration.iComboKeyTimeoutMs = defaultSettings.iComboKeyTimeoutMs; + } + + if (m_configuration.clientVersion >= CEC_CLIENT_VERSION_2_1_0) + m_configuration.bPowerOnScreensaver = configuration.bPowerOnScreensaver; + else + m_configuration.bPowerOnScreensaver = defaultSettings.bPowerOnScreensaver; } bool bNeedReinit(false); @@ -918,7 +973,10 @@ { key.duration = (unsigned int) (GetTimeMs() - m_buttontime); - if (key.duration > COMBO_TIMEOUT_MS || m_iCurrentButton != COMBO_KEY || bSendComboKey) + cec_user_control_code comboKey(m_configuration.comboKey); + uint32_t iTimeoutMs(m_configuration.iComboKeyTimeoutMs); + + if (key.duration > iTimeoutMs || m_iCurrentButton != comboKey || bSendComboKey) { key.keycode = m_iCurrentButton; @@ -937,18 +995,21 @@ void CCECClient::AddKey(const cec_keypress &key) { - // send back the previous key if there is one - AddKey(); - if (key.keycode > CEC_USER_CONTROL_CODE_MAX && key.keycode < CEC_USER_CONTROL_CODE_SELECT) + { + // send back the previous key if there is one + AddKey(); return; + } cec_keypress transmitKey(key); + cec_user_control_code comboKey(m_configuration.clientVersion >= CEC_CLIENT_VERSION_2_0_5 ? + m_configuration.comboKey : CEC_USER_CONTROL_CODE_STOP); { CLockObject lock(m_mutex); - if (m_iCurrentButton == COMBO_KEY && key.duration == 0) + if (m_iCurrentButton == comboKey && key.duration == 0) { // stop + ok -> exit if (key.keycode == CEC_USER_CONTROL_CODE_SELECT) @@ -964,14 +1025,22 @@ AddKey(true); } - if (key.duration == 0) + if (m_iCurrentButton == key.keycode) { - m_iCurrentButton = transmitKey.keycode; - m_buttontime = m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN || key.duration > 0 ? 0 : GetTimeMs(); + m_buttontime = GetTimeMs(); + } + else + { + AddKey(); + if (key.duration == 0) + { + m_iCurrentButton = transmitKey.keycode; + m_buttontime = m_iCurrentButton == CEC_USER_CONTROL_CODE_UNKNOWN || key.duration > 0 ? 0 : GetTimeMs(); + } } } - if (key.keycode != COMBO_KEY || key.duration > 0) + if (key.keycode != comboKey || key.duration > 0) { LIB_CEC->AddLog(CEC_LOG_DEBUG, "key pressed: %s (%1x)", ToString(transmitKey.keycode), transmitKey.keycode); CallbackAddKey(transmitKey); @@ -995,10 +1064,14 @@ { CLockObject lock(m_mutex); uint64_t iNow = GetTimeMs(); + cec_user_control_code comboKey(m_configuration.clientVersion >= CEC_CLIENT_VERSION_2_0_5 ? + m_configuration.comboKey : CEC_USER_CONTROL_CODE_STOP); + uint32_t iTimeoutMs(m_configuration.clientVersion >= CEC_CLIENT_VERSION_2_0_5 ? + m_configuration.iComboKeyTimeoutMs : CEC_DEFAULT_COMBO_TIMEOUT_MS); if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN && - ((m_iCurrentButton == COMBO_KEY && iNow - m_buttontime > COMBO_TIMEOUT_MS) || - (m_iCurrentButton != COMBO_KEY && iNow - m_buttontime > CEC_BUTTON_TIMEOUT))) + ((m_iCurrentButton == comboKey && iNow - m_buttontime > iTimeoutMs) || + (m_iCurrentButton != comboKey && iNow - m_buttontime > CEC_BUTTON_TIMEOUT))) { key.duration = (unsigned int) (iNow - m_buttontime); key.keycode = m_iCurrentButton; diff -Nru libcec-2.0.4/src/lib/CECClient.h libcec-2.1.1/src/lib/CECClient.h --- libcec-2.0.4/src/lib/CECClient.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/CECClient.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. @@ -152,6 +152,10 @@ virtual uint8_t SendVolumeUp(bool bSendRelease = true); virtual uint8_t SendVolumeDown(bool bSendRelease = true); virtual uint8_t SendMuteAudio(void); + virtual uint8_t AudioToggleMute(void); + virtual uint8_t AudioMute(void); + virtual uint8_t AudioUnmute(void); + virtual uint8_t AudioStatus(void); virtual bool SendKeypress(const cec_logical_address iDestination, const cec_user_control_code key, bool bWait = true); virtual bool SendKeyRelease(const cec_logical_address iDestination, bool bWait = true); virtual cec_osd_name GetDeviceOSDName(const cec_logical_address iAddress); diff -Nru libcec-2.0.4/src/lib/CECInputBuffer.h libcec-2.1.1/src/lib/CECInputBuffer.h --- libcec-2.0.4/src/lib/CECInputBuffer.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/CECInputBuffer.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/CECProcessor.cpp libcec-2.1.1/src/lib/CECProcessor.cpp --- libcec-2.0.4/src/lib/CECProcessor.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/CECProcessor.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -53,6 +53,7 @@ #define CEC_PROCESSOR_SIGNAL_WAIT_TIME 1000 #define ACTIVE_SOURCE_CHECK_INTERVAL 500 +#define TV_PRESENT_CHECK_INTERVAL 30000 #define ToString(x) CCECTypeUtils::ToString(x) @@ -216,6 +217,7 @@ cec_command command; command.Clear(); CTimeout activeSourceCheck(ACTIVE_SOURCE_CHECK_INTERVAL); + CTimeout tvPresentCheck(TV_PRESENT_CHECK_INTERVAL); // as long as we're not being stopped and the connection is open while (!IsStopped() && m_communication->IsOpen()) @@ -239,6 +241,19 @@ TransmitPendingActiveSourceCommands(); activeSourceCheck.Init(ACTIVE_SOURCE_CHECK_INTERVAL); } + + // check whether the TV is present and responding + if (tvPresentCheck.TimeLeft() == 0) + { + if (!m_busDevices->At(CECDEVICE_TV)->IsPresent()) + { + libcec_parameter param; + param.paramType = CEC_PARAMETER_TYPE_STRING; + param.paramData = (void*)"TV does not respond to CEC polls"; + GetPrimaryClient()->Alert(CEC_ALERT_TV_POLL_FAILED, param); + } + tvPresentCheck.Init(TV_PRESENT_CHECK_INTERVAL); + } } } @@ -623,6 +638,8 @@ config->iFirmwareBuildDate = m_communication->GetFirmwareBuildDate(); config->adapterType = m_communication->GetAdapterType(); + Close(); + return true; } @@ -839,6 +856,9 @@ GetTV()->MarkHandlerReady(); } + // report our OSD name to the TV, since some TVs don't request it + client->GetPrimaryDevice()->TransmitOSDName(CECDEVICE_TV, false); + // request the power status of the TV tv->RequestPowerStatus(sourceAddress, true); @@ -983,6 +1003,14 @@ } } +void CCECProcessor::HandlePhysicalAddressChanged(uint16_t iNewAddress) +{ + m_libcec->AddLog(CEC_LOG_NOTICE, "physical address changed to %04x", iNewAddress); + CCECClient* client = GetPrimaryClient(); + if (client) + client->SetPhysicalAddress(iNewAddress); +} + uint16_t CCECProcessor::GetAdapterVendorId(void) const { return m_communication ? m_communication->GetAdapterVendorId() : 0; diff -Nru libcec-2.0.4/src/lib/CECProcessor.h libcec-2.1.1/src/lib/CECProcessor.h --- libcec-2.0.4/src/lib/CECProcessor.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/CECProcessor.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. @@ -83,6 +83,7 @@ bool OnCommandReceived(const cec_command &command); void HandleLogicalAddressLost(cec_logical_address oldAddress); + void HandlePhysicalAddressChanged(uint16_t iNewAddress); CCECBusDevice * GetDevice(cec_logical_address address) const; CCECAudioSystem * GetAudioSystem(void) const; diff -Nru libcec-2.0.4/src/lib/CECTypeUtils.h libcec-2.1.1/src/lib/CECTypeUtils.h --- libcec-2.0.4/src/lib/CECTypeUtils.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/CECTypeUtils.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. @@ -512,6 +512,8 @@ return "Broadcom"; case CEC_VENDOR_LOEWE: return "Loewe"; + case CEC_VENDOR_DENON: + return "Denon"; default: return "Unknown"; } @@ -565,6 +567,12 @@ return "2.0.3"; case CEC_CLIENT_VERSION_2_0_4: return "2.0.4"; + case CEC_CLIENT_VERSION_2_0_5: + return "2.0.5"; + case CEC_CLIENT_VERSION_2_1_0: + return "2.1.0"; + case CEC_CLIENT_VERSION_2_1_1: + return "2.1.1"; default: return "Unknown"; } @@ -618,6 +626,12 @@ return "2.0.3"; case CEC_SERVER_VERSION_2_0_4: return "2.0.4"; + case CEC_SERVER_VERSION_2_0_5: + return "2.0.5"; + case CEC_SERVER_VERSION_2_1_0: + return "2.1.0"; + case CEC_SERVER_VERSION_2_1_1: + return "2.1.1"; default: return "Unknown"; } diff -Nru libcec-2.0.4/src/lib/LibCEC.cpp libcec-2.1.1/src/lib/LibCEC.cpp --- libcec-2.0.4/src/lib/LibCEC.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/LibCEC.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -280,6 +280,7 @@ uint8_t CLibCEC::MuteAudio(bool UNUSED(bSendRelease) /* = true */) { + AddLog(CEC_LOG_WARNING, "deprecated function called: %s", __FUNCTION__); return m_client ? m_client->SendMuteAudio() : (uint8_t)CEC_AUDIO_VOLUME_STATUS_UNKNOWN; } @@ -538,3 +539,41 @@ { return m_cec && m_cec->IsRunning() ? m_cec->GetAdapterProductId() : 0; } + +uint8_t CLibCEC::AudioToggleMute(void) +{ + return m_client ? m_client->AudioToggleMute() : (uint8_t)CEC_AUDIO_VOLUME_STATUS_UNKNOWN; +} + +uint8_t CLibCEC::AudioMute(void) +{ + return m_client ? m_client->AudioMute() : (uint8_t)CEC_AUDIO_VOLUME_STATUS_UNKNOWN; +} + +uint8_t CLibCEC::AudioUnmute(void) +{ + return m_client ? m_client->AudioUnmute() : (uint8_t)CEC_AUDIO_VOLUME_STATUS_UNKNOWN; +} + +uint8_t CLibCEC::AudioStatus(void) +{ + return m_client ? m_client->AudioStatus() : (uint8_t)CEC_AUDIO_VOLUME_STATUS_UNKNOWN; +} + +int8_t CLibCEC::DetectAdapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath /* = NULL */, bool bQuickScan /* = false */) +{ + int8_t iAdaptersFound = CAdapterFactory(this).DetectAdapters(deviceList, iBufSize, strDevicePath); + if (!bQuickScan) + { + for (int8_t iPtr = 0; iPtr < iAdaptersFound; iPtr++) + { + libcec_configuration config; + GetDeviceInformation(deviceList[iPtr].strComName, &config); + deviceList[iPtr].iFirmwareVersion = config.iFirmwareVersion; + deviceList[iPtr].iPhysicalAddress = config.iPhysicalAddress; + deviceList[iPtr].iFirmwareBuildDate = config.iFirmwareBuildDate; + deviceList[iPtr].adapterType = config.adapterType; + } + } + return iAdaptersFound; +} diff -Nru libcec-2.0.4/src/lib/LibCEC.h libcec-2.1.1/src/lib/LibCEC.h --- libcec-2.0.4/src/lib/LibCEC.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/LibCEC.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. @@ -52,6 +52,7 @@ void Close(void); bool EnableCallbacks(void *cbParam, ICECCallbacks *callbacks); int8_t FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath = NULL); + int8_t DetectAdapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath = NULL, bool bQuickScan = false); bool PingAdapter(void); bool StartBootloader(void); @@ -132,6 +133,11 @@ uint16_t GetAdapterVendorId(void) const; uint16_t GetAdapterProductId(void) const; + uint8_t AudioToggleMute(void); + uint8_t AudioMute(void); + uint8_t AudioUnmute(void); + uint8_t AudioStatus(void); + CCECProcessor * m_cec; protected: diff -Nru libcec-2.0.4/src/lib/LibCECC.cpp libcec-2.1.1/src/lib/LibCECC.cpp --- libcec-2.0.4/src/lib/LibCECC.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/LibCECC.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -388,4 +388,31 @@ 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; +} + //@} diff -Nru libcec-2.0.4/src/lib/LibCECDll.cpp libcec-2.1.1/src/lib/LibCECDll.cpp --- libcec-2.0.4/src/lib/LibCECDll.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/LibCECDll.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/adapter/AdapterCommunication.h libcec-2.1.1/src/lib/adapter/AdapterCommunication.h --- libcec-2.0.4/src/lib/adapter/AdapterCommunication.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/AdapterCommunication.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. @@ -81,6 +81,12 @@ */ virtual void HandleLogicalAddressLost(cec_logical_address oldAddress) = 0; + /*! + * @brief Callback method for IAdapterCommunication, called when the physical address changed. + * @param iNewAddress The new physical address. + */ + virtual void HandlePhysicalAddressChanged(uint16_t iNewAddress) = 0; + virtual CLibCEC *GetLib(void) const = 0; }; diff -Nru libcec-2.0.4/src/lib/adapter/AdapterFactory.cpp libcec-2.1.1/src/lib/adapter/AdapterFactory.cpp --- libcec-2.0.4/src/lib/adapter/AdapterFactory.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/AdapterFactory.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -57,6 +57,18 @@ int8_t CAdapterFactory::FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath /* = NULL */) { + cec_adapter_descriptor devices[50]; + int8_t iReturn = DetectAdapters(devices, iBufSize, strDevicePath); + for (int8_t iPtr = 0; iPtr < iReturn; iPtr++) + { + strncpy(deviceList[iPtr].comm, devices[iPtr].strComName, sizeof(deviceList[iPtr].comm)); + strncpy(deviceList[iPtr].path, devices[iPtr].strComPath, sizeof(deviceList[iPtr].path)); + } + return iReturn; +} + +int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath /* = NULL */) +{ int8_t iAdaptersFound(0); #if defined(HAVE_P8_USB) @@ -75,8 +87,12 @@ if (iAdaptersFound < iBufSize && CRPiCECAdapterDetection::FindAdapter() && (!strDevicePath || !strcmp(strDevicePath, CEC_RPI_VIRTUAL_COM))) { - snprintf(deviceList[iAdaptersFound].path, 1024, CEC_RPI_VIRTUAL_PATH); - snprintf(deviceList[iAdaptersFound++].comm, 1024, CEC_RPI_VIRTUAL_COM); + snprintf(deviceList[iAdaptersFound].strComPath, sizeof(deviceList[iAdaptersFound].strComPath), CEC_RPI_VIRTUAL_PATH); + snprintf(deviceList[iAdaptersFound].strComName, sizeof(deviceList[iAdaptersFound].strComName), CEC_RPI_VIRTUAL_COM); + deviceList[iAdaptersFound].iVendorId = RPI_ADAPTER_VID; + deviceList[iAdaptersFound].iProductId = RPI_ADAPTER_PID; + deviceList[iAdaptersFound].adapterType = ADAPTERTYPE_RPI; + iAdaptersFound++; } #endif @@ -84,8 +100,12 @@ if (iAdaptersFound < iBufSize && CTDA995xCECAdapterDetection::FindAdapter() && (!strDevicePath || !strcmp(strDevicePath, CEC_TDA995x_VIRTUAL_COM))) { - snprintf(deviceList[iAdaptersFound].path, 1024, CEC_TDA995x_PATH); - snprintf(deviceList[iAdaptersFound++].comm, 1024, CEC_TDA995x_VIRTUAL_COM); + snprintf(deviceList[iAdaptersFound].strComPath, sizeof(deviceList[iAdaptersFound].strComPath), CEC_TDA995x_PATH); + snprintf(deviceList[iAdaptersFound].strComName, sizeof(deviceList[iAdaptersFound].strComName), CEC_TDA995x_VIRTUAL_COM); + deviceList[iAdaptersFound].iVendorId = TDA995X_ADAPTER_VID; + deviceList[iAdaptersFound].iProductId = TDA995X_ADAPTER_PID; + deviceList[iAdaptersFound].adapterType = ADAPTERTYPE_TDA995x; + iAdaptersFound++; } #endif diff -Nru libcec-2.0.4/src/lib/adapter/AdapterFactory.h libcec-2.1.1/src/lib/adapter/AdapterFactory.h --- libcec-2.0.4/src/lib/adapter/AdapterFactory.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/AdapterFactory.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. @@ -47,6 +47,7 @@ virtual ~CAdapterFactory(void) {}; int8_t FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath = NULL); + int8_t DetectAdapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath = NULL); IAdapterCommunication *GetInstance(const char *strPort, uint16_t iBaudRate = CEC_SERIAL_DEFAULT_BAUDRATE); static void InitVideoStandalone(void); diff -Nru libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterCommands.cpp libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterCommands.cpp --- libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterCommands.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterCommands.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterCommands.h libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterCommands.h --- libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterCommands.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterCommands.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp --- libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -54,10 +54,10 @@ #define CEC_ADAPTER_EEPROM_WRITE_INTERVAL 30000 #define CEC_ADAPTER_EEPROM_WRITE_RETRY 5000 -// firmware version 2 -#define CEC_LATEST_ADAPTER_FW_VERSION 2 -// firmware date Thu Aug 2 08:31:24 UTC 2012 -#define CEC_LATEST_ADAPTER_FW_DATE 0x501a4b0c +// firmware version 3 +#define CEC_LATEST_ADAPTER_FW_VERSION 3 +// firmware date Thu Nov 15 11:09:45 2012 +#define CEC_LATEST_ADAPTER_FW_DATE 0x50a4cd79 #define CEC_FW_DATE_EXTENDED_RESPONSE 0x501a4b0c #define CEC_FW_DATE_DESCRIPTOR2 0x5045dbf5 diff -Nru libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.h libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.h --- libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp --- libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -202,7 +202,7 @@ } #endif -uint8_t CUSBCECAdapterDetection::FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath /* = NULL */) +uint8_t CUSBCECAdapterDetection::FindAdapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath /* = NULL */) { uint8_t iFound(0); @@ -262,10 +262,13 @@ if (!strDevicePath || !strcmp(bsdPath, strDevicePath)) { // on darwin, the device path is the same as the comm path. - if (iFound == 0 || strcmp(deviceList[iFound-1].comm, bsdPath)) + if (iFound == 0 || strcmp(deviceList[iFound-1].strComName, bsdPath)) { - snprintf(deviceList[iFound].path, sizeof(deviceList[iFound].path), "%s", bsdPath); - snprintf(deviceList[iFound].comm, sizeof(deviceList[iFound].path), "%s", bsdPath); + snprintf(deviceList[iFound].strComPath, sizeof(deviceList[iFound].strComPath), "%s", bsdPath); + snprintf(deviceList[iFound].strComName, sizeof(deviceList[iFound].strComName), "%s", bsdPath); + deviceList[iFound].iVendorId = iVendor; + deviceList[iFound].iProductId = iProduct; + deviceList[iFound].adapterType = ADAPTERTYPE_P8_EXTERNAL; // will be overridden when not doing a "quick scan" by the actual type iFound++; } } @@ -312,10 +315,13 @@ if (!strDevicePath || !strcmp(strPath.c_str(), strDevicePath)) { CStdString strComm(strPath); - if (FindComPort(strComm) && (iFound == 0 || strcmp(deviceList[iFound-1].comm, strComm.c_str()))) + if (FindComPort(strComm) && (iFound == 0 || strcmp(deviceList[iFound-1].strComName, strComm.c_str()))) { - snprintf(deviceList[iFound].path, sizeof(deviceList[iFound].path), "%s", strPath.c_str()); - snprintf(deviceList[iFound].comm, sizeof(deviceList[iFound].path), "%s", strComm.c_str()); + snprintf(deviceList[iFound].strComPath, sizeof(deviceList[iFound].strComPath), "%s", strPath.c_str()); + snprintf(deviceList[iFound].strComName, sizeof(deviceList[iFound].strComName), "%s", strComm.c_str()); + deviceList[iFound].iVendorId = iVendor; + deviceList[iFound].iProductId = iProduct; + deviceList[iFound].adapterType = ADAPTERTYPE_P8_EXTERNAL; // will be overridden when not doing a "quick scan" by the actual type iFound++; } } @@ -408,15 +414,21 @@ // the 1002 pid indicates a composite device, that needs special treatment char strId[512]; CM_Get_Device_ID(devInfoData.DevInst, strId, 512, 0); - if (FindComPortForComposite(strId, deviceList[iFound].comm, sizeof(deviceList[iFound].comm))) + if (FindComPortForComposite(strId, deviceList[iFound].strComName, sizeof(deviceList[iFound].strComName))) { - snprintf(deviceList[iFound].path, sizeof(deviceList[iFound].path), "%s", devicedetailData->DevicePath); + snprintf(deviceList[iFound].strComPath, sizeof(deviceList[iFound].strComPath), "%s", devicedetailData->DevicePath); + deviceList[iFound].iVendorId = (uint16_t)iVendor; + deviceList[iFound].iProductId = (uint16_t)iProduct; + deviceList[iFound].adapterType = ADAPTERTYPE_P8_EXTERNAL; // will be overridden when not doing a "quick scan" by the actual type iFound++; } } - else if (GetComPortFromHandle(hDevHandle, &devInfoData, deviceList[iFound].comm, sizeof(deviceList[iFound].comm))) + else if (GetComPortFromHandle(hDevHandle, &devInfoData, deviceList[iFound].strComName, sizeof(deviceList[iFound].strComName))) { - snprintf(deviceList[iFound].path, sizeof(deviceList[iFound].path), "%s", devicedetailData->DevicePath); + snprintf(deviceList[iFound].strComPath, sizeof(deviceList[iFound].strComPath), "%s", devicedetailData->DevicePath); + deviceList[iFound].iVendorId = (uint16_t)iVendor; + deviceList[iFound].iProductId = (uint16_t)iProduct; + deviceList[iFound].adapterType = ADAPTERTYPE_P8_EXTERNAL; // will be overridden when not doing a "quick scan" by the actual type iFound++; } } @@ -431,8 +443,11 @@ continue; if (!access(devicePath, 0)) { - snprintf(deviceList[iFound].path, sizeof(deviceList[iFound].path), "%s", devicePath); - snprintf(deviceList[iFound].comm, sizeof(deviceList[iFound].path), "%s", devicePath); + snprintf(deviceList[iFound].strComPath, sizeof(deviceList[iFound].strComPath), "%s", devicePath); + snprintf(deviceList[iFound].strComName, sizeof(deviceList[iFound].strComName), "%s", devicePath); + deviceList[iFound].iVendorId = CEC_VID; + deviceList[iFound].iProductId = CEC_VID; + deviceList[iFound].adapterType = ADAPTERTYPE_P8_EXTERNAL; // will be overridden when not doing a "quick scan" by the actual type iFound++; } } diff -Nru libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.h libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.h --- libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. @@ -40,7 +40,7 @@ class CUSBCECAdapterDetection { public: - static uint8_t FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath = NULL); + static uint8_t FindAdapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath = NULL); static bool CanAutodetect(void); }; }; diff -Nru libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterMessage.cpp libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterMessage.cpp --- libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterMessage.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterMessage.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterMessage.h libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterMessage.h --- libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterMessage.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterMessage.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterMessageQueue.cpp libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterMessageQueue.cpp --- libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterMessageQueue.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterMessageQueue.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -169,10 +169,7 @@ return thisMsgCode == msgResponse; if (!m_message->IsTranmission()) - { - m_queue->m_com->m_callback->GetLib()->AddLog(CEC_LOG_WARNING, "FIXME! not a transmission: %s", msg.ToString().c_str()); return false; - } return ((msgCode == MSGCODE_COMMAND_ACCEPTED || msgCode == MSGCODE_COMMAND_REJECTED) && (msgResponse == MSGCODE_TRANSMIT_ACK_POLARITY || msgResponse == MSGCODE_TRANSMIT || msgResponse == MSGCODE_TRANSMIT_EOM)) || diff -Nru libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterMessageQueue.h libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterMessageQueue.h --- libcec-2.0.4/src/lib/adapter/Pulse-Eight/USBCECAdapterMessageQueue.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/Pulse-Eight/USBCECAdapterMessageQueue.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/adapter/RPi/RPiCECAdapterCommunication.cpp libcec-2.1.1/src/lib/adapter/RPi/RPiCECAdapterCommunication.cpp --- libcec-2.0.4/src/lib/adapter/RPi/RPiCECAdapterCommunication.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/RPi/RPiCECAdapterCommunication.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -58,11 +58,19 @@ static_cast(callback_data)->OnDataReceived(p0, p1, p2, p3, p4); } +// callback for the TV service +void rpi_tv_callback(void *callback_data, uint32_t reason, uint32_t p0, uint32_t p1) +{ + if (callback_data) + static_cast(callback_data)->OnTVServiceCallback(reason, p0, p1); +} + CRPiCECAdapterCommunication::CRPiCECAdapterCommunication(IAdapterCommunicationCallback *callback) : IAdapterCommunication(callback), m_logicalAddress(CECDEVICE_UNKNOWN), m_bLogicalAddressChanged(false), - m_previousLogicalAddress(CECDEVICE_FREEUSE) + m_previousLogicalAddress(CECDEVICE_FREEUSE), + m_bLogicalAddressRegistered(false) { m_queue = new CRPiCECAdapterMessageQueue(this); } @@ -106,6 +114,28 @@ return m_bInitialised; } +void CRPiCECAdapterCommunication::OnTVServiceCallback(uint32_t reason, uint32_t UNUSED(p0), uint32_t UNUSED(p1)) +{ + switch(reason) + { + case VC_HDMI_ATTACHED: + { + uint16_t iNewAddress = GetPhysicalAddress(); + m_callback->HandlePhysicalAddressChanged(iNewAddress); + break; + } + case VC_HDMI_UNPLUGGED: + case VC_HDMI_DVI: + case VC_HDMI_HDMI: + case VC_HDMI_HDCP_UNAUTH: + case VC_HDMI_HDCP_AUTH: + case VC_HDMI_HDCP_KEY_DOWNLOAD: + case VC_HDMI_HDCP_SRM_DOWNLOAD: + default: + break; + } +} + void CRPiCECAdapterCommunication::OnDataReceived(uint32_t header, uint32_t p0, uint32_t p1, uint32_t p2, uint32_t p3) { VC_CEC_NOTIFY_T reason = (VC_CEC_NOTIFY_T)CEC_CB_REASON(header); @@ -199,7 +229,12 @@ m_logicalAddress = CECDEVICE_UNKNOWN; // notify libCEC that we lost our LA when the connection was initialised - if (m_bInitialised) + bool bNotify(false); + { + CLockObject lock(m_mutex); + bNotify = m_bInitialised && m_bLogicalAddressRegistered; + } + if (bNotify) m_callback->HandleLogicalAddressLost(previousAddress); } break; @@ -266,8 +301,9 @@ // enable passive mode vc_cec_set_passive(true); - // register the callback - vc_cec_register_callback(((CECSERVICE_CALLBACK_T)rpi_cec_callback), (void*)this); + // register the callbacks + vc_cec_register_callback(rpi_cec_callback, (void*)this); + vc_tv_register_callback(rpi_tv_callback, (void*)this); // release previous LA vc_cec_release_logical_address(); @@ -317,6 +353,8 @@ else return; } + vc_tv_unregister_callback(rpi_tv_callback); + UnregisterLogicalAddress(); // disable passive mode @@ -379,7 +417,11 @@ return true; LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s - releasing previous logical address", __FUNCTION__); - m_bLogicalAddressChanged = false; + { + CLockObject lock(m_mutex); + m_bLogicalAddressRegistered = false; + m_bLogicalAddressChanged = false; + } vc_cec_release_logical_address(); @@ -411,7 +453,12 @@ return false; } - return m_logicalAddressCondition.Wait(m_mutex, m_bLogicalAddressChanged); + if (m_logicalAddressCondition.Wait(m_mutex, m_bLogicalAddressChanged)) + { + m_bLogicalAddressRegistered = true; + return true; + } + return false; } cec_logical_addresses CRPiCECAdapterCommunication::GetLogicalAddresses(void) diff -Nru libcec-2.0.4/src/lib/adapter/RPi/RPiCECAdapterCommunication.h libcec-2.1.1/src/lib/adapter/RPi/RPiCECAdapterCommunication.h --- libcec-2.0.4/src/lib/adapter/RPi/RPiCECAdapterCommunication.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/RPi/RPiCECAdapterCommunication.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. @@ -90,6 +90,7 @@ bool IsInitialised(void); void OnDataReceived(uint32_t p0, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4); + void OnTVServiceCallback(uint32_t reason, uint32_t p0, uint32_t p1); static void InitHost(void); @@ -110,6 +111,7 @@ VCHI_INSTANCE_T m_vchi_instance; VCHI_CONNECTION_T * m_vchi_connection; cec_logical_address m_previousLogicalAddress; + bool m_bLogicalAddressRegistered; }; }; diff -Nru libcec-2.0.4/src/lib/adapter/RPi/RPiCECAdapterDetection.cpp libcec-2.1.1/src/lib/adapter/RPi/RPiCECAdapterDetection.cpp --- libcec-2.0.4/src/lib/adapter/RPi/RPiCECAdapterDetection.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/RPi/RPiCECAdapterDetection.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/adapter/RPi/RPiCECAdapterDetection.h libcec-2.1.1/src/lib/adapter/RPi/RPiCECAdapterDetection.h --- libcec-2.0.4/src/lib/adapter/RPi/RPiCECAdapterDetection.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/RPi/RPiCECAdapterDetection.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/adapter/RPi/RPiCECAdapterMessageQueue.cpp libcec-2.1.1/src/lib/adapter/RPi/RPiCECAdapterMessageQueue.cpp --- libcec-2.0.4/src/lib/adapter/RPi/RPiCECAdapterMessageQueue.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/RPi/RPiCECAdapterMessageQueue.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/adapter/RPi/RPiCECAdapterMessageQueue.h libcec-2.1.1/src/lib/adapter/RPi/RPiCECAdapterMessageQueue.h --- libcec-2.0.4/src/lib/adapter/RPi/RPiCECAdapterMessageQueue.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/RPi/RPiCECAdapterMessageQueue.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/adapter/TDA995x/AdapterMessageQueue.h libcec-2.1.1/src/lib/adapter/TDA995x/AdapterMessageQueue.h --- libcec-2.0.4/src/lib/adapter/TDA995x/AdapterMessageQueue.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/TDA995x/AdapterMessageQueue.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/adapter/TDA995x/TDA995xCECAdapterCommunication.cpp libcec-2.1.1/src/lib/adapter/TDA995x/TDA995xCECAdapterCommunication.cpp --- libcec-2.0.4/src/lib/adapter/TDA995x/TDA995xCECAdapterCommunication.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/TDA995x/TDA995xCECAdapterCommunication.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/adapter/TDA995x/TDA995xCECAdapterCommunication.h libcec-2.1.1/src/lib/adapter/TDA995x/TDA995xCECAdapterCommunication.h --- libcec-2.0.4/src/lib/adapter/TDA995x/TDA995xCECAdapterCommunication.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/TDA995x/TDA995xCECAdapterCommunication.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/adapter/TDA995x/TDA995xCECAdapterDetection.cpp libcec-2.1.1/src/lib/adapter/TDA995x/TDA995xCECAdapterDetection.cpp --- libcec-2.0.4/src/lib/adapter/TDA995x/TDA995xCECAdapterDetection.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/TDA995x/TDA995xCECAdapterDetection.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/adapter/TDA995x/TDA995xCECAdapterDetection.h libcec-2.1.1/src/lib/adapter/TDA995x/TDA995xCECAdapterDetection.h --- libcec-2.0.4/src/lib/adapter/TDA995x/TDA995xCECAdapterDetection.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/adapter/TDA995x/TDA995xCECAdapterDetection.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/devices/CECAudioSystem.cpp libcec-2.1.1/src/lib/devices/CECAudioSystem.cpp --- libcec-2.0.4/src/lib/devices/CECAudioSystem.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/devices/CECAudioSystem.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -47,7 +47,7 @@ CCECAudioSystem::CCECAudioSystem(CCECProcessor *processor, cec_logical_address address, uint16_t iPhysicalAddress /* = CEC_INVALID_PHYSICAL_ADDRESS */) : CCECBusDevice(processor, address, iPhysicalAddress), m_systemAudioStatus(CEC_SYSTEM_AUDIO_STATUS_ON), - m_audioStatus(CEC_AUDIO_MUTE_STATUS_MASK) + m_audioStatus(CEC_AUDIO_VOLUME_STATUS_UNKNOWN) { m_type = CEC_DEVICE_TYPE_AUDIO_SYSTEM; } @@ -139,6 +139,40 @@ TransmitKeypress(source, CEC_USER_CONTROL_CODE_MUTE); TransmitKeyRelease(source); + return GetAudioStatus(source, true); +} + +bool CCECAudioSystem::RequestAudioStatus(const cec_logical_address initiator, bool bWaitForResponse /* = true */) +{ + bool bReturn(false); + + if (!IsHandledByLibCEC() && + !IsUnsupportedFeature(CEC_OPCODE_GIVE_AUDIO_STATUS)) + { + MarkBusy(); + LIB_CEC->AddLog(CEC_LOG_DEBUG, "<< requesting audio status of '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress); + bReturn = m_handler->TransmitRequestAudioStatus(initiator, m_iLogicalAddress, bWaitForResponse); + MarkReady(); + } + return bReturn; +} + +uint8_t CCECAudioSystem::GetAudioStatus(const cec_logical_address initiator, bool bUpdate /* = false */) +{ + bool bIsPresent(GetStatus() == CEC_DEVICE_STATUS_PRESENT); + bool bRequestUpdate(false); + { + CLockObject lock(m_mutex); + bRequestUpdate = bIsPresent && + (bUpdate || m_audioStatus == CEC_AUDIO_VOLUME_STATUS_UNKNOWN); + } + + if (bRequestUpdate) + { + CheckVendorIdRequested(initiator); + RequestAudioStatus(initiator); + } + CLockObject lock(m_mutex); return m_audioStatus; } diff -Nru libcec-2.0.4/src/lib/devices/CECAudioSystem.h libcec-2.1.1/src/lib/devices/CECAudioSystem.h --- libcec-2.0.4/src/lib/devices/CECAudioSystem.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/devices/CECAudioSystem.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. @@ -50,10 +50,13 @@ uint8_t VolumeUp(const cec_logical_address source, bool bSendRelease = true); uint8_t VolumeDown(const cec_logical_address source, bool bSendRelease = true); uint8_t MuteAudio(const cec_logical_address source); + uint8_t GetAudioStatus(const cec_logical_address initiator, bool bUpdate = false); bool TransmitActiveSource(void) { return false; } protected: + bool RequestAudioStatus(const cec_logical_address initiator, bool bWaitForResponse = true); + cec_system_audio_status m_systemAudioStatus; uint8_t m_audioStatus; }; diff -Nru libcec-2.0.4/src/lib/devices/CECBusDevice.cpp libcec-2.1.1/src/lib/devices/CECBusDevice.cpp --- libcec-2.0.4/src/lib/devices/CECBusDevice.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/devices/CECBusDevice.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -186,7 +186,7 @@ bHandled = m_handler->HandleCommand(command); /* change status to present */ - if (bHandled && GetLogicalAddress() != CECDEVICE_BROADCAST) + if (bHandled && GetLogicalAddress() != CECDEVICE_BROADCAST && command.opcode_set == 1) { CLockObject lock(m_mutex); if (m_deviceStatus != CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC) @@ -227,7 +227,9 @@ opcode == CEC_OPCODE_VENDOR_REMOTE_BUTTON_UP || opcode == CEC_OPCODE_ABORT || opcode == CEC_OPCODE_FEATURE_ABORT || - opcode == CEC_OPCODE_NONE) + opcode == CEC_OPCODE_NONE || + opcode == CEC_OPCODE_USER_CONTROL_PRESSED || + opcode == CEC_OPCODE_USER_CONTROL_RELEASE) return; { @@ -391,12 +393,13 @@ language = m_menuLanguage; } - char lang[3]; + char lang[4]; { CLockObject lock(m_mutex); lang[0] = language.language[0]; lang[1] = language.language[1]; lang[2] = language.language[2]; + lang[3] = (char)0; } MarkBusy(); @@ -748,7 +751,7 @@ else { LIB_CEC->AddLog(CEC_LOG_DEBUG, "<< %s (%X) -> %s (%X): vendor id %s (%x)", GetLogicalAddressName(), m_iLogicalAddress, ToString(destination), destination, ToString((cec_vendor_id)iVendorId), iVendorId); - bReturn = m_handler->TransmitVendorID(m_iLogicalAddress, iVendorId, bIsReply); + bReturn = m_handler->TransmitVendorID(m_iLogicalAddress, destination, iVendorId, bIsReply); } MarkReady(); return bReturn; @@ -778,7 +781,7 @@ if (bNeedsPoll) { bool bPollAcked(false); - if (bNeedsPoll && NeedsPoll()) + if (bNeedsPoll) bPollAcked = m_processor->PollDevice(m_iLogicalAddress); status = bPollAcked ? CEC_DEVICE_STATUS_PRESENT : CEC_DEVICE_STATUS_NOT_PRESENT; @@ -1131,21 +1134,14 @@ return; CCECBusDevice* newRoute = m_processor->GetDeviceByPhysicalAddress(iRoute, true); - if (newRoute && newRoute->IsHandledByLibCEC()) + if (newRoute) { - newRoute->ActivateSource(); - return; - } - - CECDEVICEVEC devices; - m_processor->GetDevices()->GetChildrenOf(devices, this); - - for (CECDEVICEVEC::iterator it = devices.begin(); it != devices.end(); it++) - { - if ((*it)->GetCurrentPhysicalAddress() == iRoute && (*it)->IsHandledByLibCEC()) - (*it)->ActivateSource(); - else if (!CCECTypeUtils::PhysicalAddressIsIncluded(iRoute, (*it)->GetCurrentPhysicalAddress())) - (*it)->MarkAsInactiveSource(); + // we were made the active source, send notification + if (newRoute->IsHandledByLibCEC()) + newRoute->ActivateSource(); + // another device was made active + else + newRoute->MarkAsActiveSource(); } } diff -Nru libcec-2.0.4/src/lib/devices/CECBusDevice.h libcec-2.1.1/src/lib/devices/CECBusDevice.h --- libcec-2.0.4/src/lib/devices/CECBusDevice.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/devices/CECBusDevice.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/devices/CECDeviceMap.cpp libcec-2.1.1/src/lib/devices/CECDeviceMap.cpp --- libcec-2.0.4/src/lib/devices/CECDeviceMap.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/devices/CECDeviceMap.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/devices/CECDeviceMap.h libcec-2.1.1/src/lib/devices/CECDeviceMap.h --- libcec-2.0.4/src/lib/devices/CECDeviceMap.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/devices/CECDeviceMap.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/devices/CECPlaybackDevice.cpp libcec-2.1.1/src/lib/devices/CECPlaybackDevice.cpp --- libcec-2.0.4/src/lib/devices/CECPlaybackDevice.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/devices/CECPlaybackDevice.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/devices/CECPlaybackDevice.h libcec-2.1.1/src/lib/devices/CECPlaybackDevice.h --- libcec-2.0.4/src/lib/devices/CECPlaybackDevice.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/devices/CECPlaybackDevice.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/devices/CECRecordingDevice.cpp libcec-2.1.1/src/lib/devices/CECRecordingDevice.cpp --- libcec-2.0.4/src/lib/devices/CECRecordingDevice.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/devices/CECRecordingDevice.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/devices/CECRecordingDevice.h libcec-2.1.1/src/lib/devices/CECRecordingDevice.h --- libcec-2.0.4/src/lib/devices/CECRecordingDevice.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/devices/CECRecordingDevice.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/devices/CECTV.cpp libcec-2.1.1/src/lib/devices/CECTV.cpp --- libcec-2.0.4/src/lib/devices/CECTV.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/devices/CECTV.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/devices/CECTV.h libcec-2.1.1/src/lib/devices/CECTV.h --- libcec-2.0.4/src/lib/devices/CECTV.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/devices/CECTV.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/devices/CECTuner.cpp libcec-2.1.1/src/lib/devices/CECTuner.cpp --- libcec-2.0.4/src/lib/devices/CECTuner.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/devices/CECTuner.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/devices/CECTuner.h libcec-2.1.1/src/lib/devices/CECTuner.h --- libcec-2.0.4/src/lib/devices/CECTuner.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/devices/CECTuner.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/implementations/ANCommandHandler.cpp libcec-2.1.1/src/lib/implementations/ANCommandHandler.cpp --- libcec-2.0.4/src/lib/implementations/ANCommandHandler.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/implementations/ANCommandHandler.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/implementations/ANCommandHandler.h libcec-2.1.1/src/lib/implementations/ANCommandHandler.h --- libcec-2.0.4/src/lib/implementations/ANCommandHandler.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/implementations/ANCommandHandler.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/implementations/CECCommandHandler.cpp libcec-2.1.1/src/lib/implementations/CECCommandHandler.cpp --- libcec-2.0.4/src/lib/implementations/CECCommandHandler.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/implementations/CECCommandHandler.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -577,7 +577,7 @@ CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamAddress); if (device) { - if (device->IsHandledByLibCEC()) + if (device->IsHandledByLibCEC() && !device->IsActiveSource()) device->ActivateSource(); else device->MarkAsActiveSource(); @@ -816,13 +816,17 @@ if (device) device->SetPhysicalAddress(iNewAddress); else - { LIB_CEC->AddLog(CEC_LOG_DEBUG, "device with logical address %X not found", iAddress); - } /* another device reported the same physical address as ours */ if (client) + { + libcec_parameter param; + param.paramType = CEC_PARAMETER_TYPE_STRING; + param.paramData = (void*)"Physical address in use by another device. Please verify your settings"; + client->Alert(CEC_ALERT_PHYSICAL_ADDRESS_ERROR, param); client->ResetPhysicalAddress(); + } } else { @@ -894,6 +898,14 @@ return Transmit(command, !bWaitForResponse, false); } +bool CCECCommandHandler::TransmitRequestAudioStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWaitForResponse /* = true */) +{ + cec_command command; + cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_GIVE_AUDIO_STATUS); + + return Transmit(command, !bWaitForResponse, false); +} + bool CCECCommandHandler::TransmitRequestPhysicalAddress(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWaitForResponse /* = true */) { cec_command command; @@ -1002,7 +1014,7 @@ return Transmit(command, false, bIsReply); } -bool CCECCommandHandler::TransmitSetMenuLanguage(const cec_logical_address iInitiator, const char lang[3], bool bIsReply) +bool CCECCommandHandler::TransmitSetMenuLanguage(const cec_logical_address iInitiator, const char lang[4], bool bIsReply) { cec_command command; command.Format(command, iInitiator, CECDEVICE_BROADCAST, CEC_OPCODE_SET_MENU_LANGUAGE); @@ -1030,7 +1042,7 @@ return Transmit(command, false, bIsReply); } -bool CCECCommandHandler::TransmitVendorID(const cec_logical_address iInitiator, uint64_t iVendorId, bool bIsReply) +bool CCECCommandHandler::TransmitVendorID(const cec_logical_address iInitiator, const cec_logical_address UNUSED(iDestination), uint64_t iVendorId, bool bIsReply) { cec_command command; cec_command::Format(command, iInitiator, CECDEVICE_BROADCAST, CEC_OPCODE_DEVICE_VENDOR_ID); @@ -1138,11 +1150,15 @@ LIB_CEC->AddLog(CEC_LOG_DEBUG, "not sending command '%s': destination device '%s' marked as handled by libCEC", ToString(command.opcode),ToString(command.destination)); return bReturn; } + else if (destinationDevice->IsUnsupportedFeature(command.opcode)) + { + return true; + } } { - uint8_t iTries(0), iMaxTries(!command.opcode_set ? 1 : m_iTransmitRetries + 1); - while (!bReturn && ++iTries <= iMaxTries && !m_busDevice->IsUnsupportedFeature(command.opcode)) + uint8_t iTries(0), iMaxTries(m_iTransmitRetries + 1); + while (!bReturn && ++iTries <= iMaxTries) { if ((bReturn = m_processor->Transmit(command, bIsReply)) == true) { diff -Nru libcec-2.0.4/src/lib/implementations/CECCommandHandler.h libcec-2.1.1/src/lib/implementations/CECCommandHandler.h --- libcec-2.0.4/src/lib/implementations/CECCommandHandler.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/implementations/CECCommandHandler.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. @@ -70,6 +70,7 @@ virtual bool TransmitRequestCecVersion(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWaitForResponse = true); virtual bool TransmitRequestMenuLanguage(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWaitForResponse = true); virtual bool TransmitRequestOSDName(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWaitForResponse = true); + virtual bool TransmitRequestAudioStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWaitForResponse = true); virtual bool TransmitRequestPhysicalAddress(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWaitForResponse = true); virtual bool TransmitRequestPowerStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWaitForResponse = true); virtual bool TransmitRequestVendorId(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWaitForResponse = true); @@ -80,10 +81,10 @@ virtual bool TransmitOSDName(const cec_logical_address iInitiator, const cec_logical_address iDestination, std::string strDeviceName, bool bIsReply); virtual bool TransmitOSDString(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_display_control duration, const char *strMessage, bool bIsReply); virtual bool TransmitPhysicalAddress(const cec_logical_address iInitiator, uint16_t iPhysicalAddress, cec_device_type type, bool bIsReply); - virtual bool TransmitSetMenuLanguage(const cec_logical_address iInitiator, const char lang[3], bool bIsReply); + virtual bool TransmitSetMenuLanguage(const cec_logical_address iInitiator, const char lang[4], bool bIsReply); virtual bool TransmitPoll(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bIsReply); virtual bool TransmitPowerState(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_power_status state, bool bIsReply); - virtual bool TransmitVendorID(const cec_logical_address iInitiator, uint64_t iVendorId, bool bIsReply); + virtual bool TransmitVendorID(const cec_logical_address iInitiator, const cec_logical_address iDestination, uint64_t iVendorId, bool bIsReply); virtual bool TransmitAudioStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, uint8_t state, bool bIsReply); virtual bool TransmitSetSystemAudioMode(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_system_audio_status state, bool bIsReply); virtual bool TransmitSystemAudioModeStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_system_audio_status state, bool bIsReply); diff -Nru libcec-2.0.4/src/lib/implementations/PHCommandHandler.cpp libcec-2.1.1/src/lib/implementations/PHCommandHandler.cpp --- libcec-2.0.4/src/lib/implementations/PHCommandHandler.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/implementations/PHCommandHandler.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -86,6 +86,7 @@ { m_imageViewOnCheck = new CImageViewOnCheck(this); m_vendorId = CEC_VENDOR_PHILIPS; + m_bOPTSendDeckStatusUpdateOnActiveSource = false; } CPHCommandHandler::~CPHCommandHandler(void) @@ -121,7 +122,7 @@ { // tv sometimes ignores image view on. check the power status of the tv in 5 seconds, and retry when it failed to power up if (m_imageViewOnCheck && !m_imageViewOnCheck->IsRunning()) - m_imageViewOnCheck->CreateThread(false); + return m_imageViewOnCheck->CreateThread(false); } return CCECCommandHandler::ActivateSource(bTransmitDelayedCommandsOnly); @@ -151,9 +152,9 @@ return CCECCommandHandler::HandleDeviceVendorId(command); } -int CPHCommandHandler::HandleGiveDeviceVendorId(const cec_command& command) +bool CPHCommandHandler::TransmitVendorID(const cec_logical_address iInitiator, const cec_logical_address iDestination, uint64_t UNUSED(iVendorId), bool UNUSED(bIsReply)) { - LIB_CEC->AddLog(CEC_LOG_DEBUG, "<< %s (%X) -> %s (%X): vendor id feature abort", ToString(command.destination), command.destination, ToString(command.initiator), command.initiator); - m_processor->TransmitAbort(command.destination, command.initiator, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID); - return COMMAND_HANDLED; + LIB_CEC->AddLog(CEC_LOG_DEBUG, "<< %s (%X) -> %s (%X): vendor id feature abort", ToString(iInitiator), iInitiator, ToString(iDestination), iDestination); + m_processor->TransmitAbort(iInitiator, iDestination, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID); + return true; } diff -Nru libcec-2.0.4/src/lib/implementations/PHCommandHandler.h libcec-2.1.1/src/lib/implementations/PHCommandHandler.h --- libcec-2.0.4/src/lib/implementations/PHCommandHandler.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/implementations/PHCommandHandler.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. @@ -69,8 +69,9 @@ virtual bool ActivateSource(bool bTransmitDelayedCommandsOnly = false); virtual int HandleUserControlPressed(const cec_command& command); virtual int HandleUserControlRelease(const cec_command& command); - virtual int HandleGiveDeviceVendorId(const cec_command& command); + virtual bool TransmitVendorID(const cec_logical_address iInitiator, const cec_logical_address iDestination, uint64_t iVendorId, bool bIsReply); virtual int HandleDeviceVendorId(const cec_command& command); + virtual int HandleVendorRemoteButtonUp(const cec_command & command) { return HandleUserControlRelease(command); } uint8_t m_iLastKeyCode; CImageViewOnCheck* m_imageViewOnCheck; }; diff -Nru libcec-2.0.4/src/lib/implementations/RLCommandHandler.cpp libcec-2.1.1/src/lib/implementations/RLCommandHandler.cpp --- libcec-2.0.4/src/lib/implementations/RLCommandHandler.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/implementations/RLCommandHandler.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/implementations/RLCommandHandler.h libcec-2.1.1/src/lib/implementations/RLCommandHandler.h --- libcec-2.0.4/src/lib/implementations/RLCommandHandler.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/implementations/RLCommandHandler.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/implementations/SLCommandHandler.cpp libcec-2.1.1/src/lib/implementations/SLCommandHandler.cpp --- libcec-2.0.4/src/lib/implementations/SLCommandHandler.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/implementations/SLCommandHandler.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -194,6 +194,10 @@ { m_processor->GetPrimaryDevice()->SetPowerStatus(CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON); TransmitVendorCommand0205(command.destination, command.initiator); + + CCECBusDevice* dev = m_processor->GetDevice(command.destination); + if (dev && dev->IsHandledByLibCEC() && dev->IsActiveSource()) + dev->TransmitActiveSource(false); } void CSLCommandHandler::TransmitVendorCommand0205(const cec_logical_address iSource, const cec_logical_address iDestination) @@ -204,6 +208,7 @@ response.PushBack(SL_COMMAND_TYPE_HDDRECORDER); Transmit(response, false, true); + SetSLInitialised(); } void CSLCommandHandler::HandleVendorCommandPowerOn(const cec_command &command) @@ -403,7 +408,7 @@ cec_command command; if (!m_bSLEnabled) - TransmitVendorID(CECDEVICE_TV, CEC_VENDOR_LG, false); + TransmitVendorID(CECDEVICE_TV, iDestination, CEC_VENDOR_LG, false); cec_command::Format(command, CECDEVICE_TV, iDestination, CEC_OPCODE_VENDOR_COMMAND); command.PushBack(SL_COMMAND_POWER_ON); diff -Nru libcec-2.0.4/src/lib/implementations/SLCommandHandler.h libcec-2.1.1/src/lib/implementations/SLCommandHandler.h --- libcec-2.0.4/src/lib/implementations/SLCommandHandler.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/implementations/SLCommandHandler.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/implementations/VLCommandHandler.cpp libcec-2.1.1/src/lib/implementations/VLCommandHandler.cpp --- libcec-2.0.4/src/lib/implementations/VLCommandHandler.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/implementations/VLCommandHandler.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/implementations/VLCommandHandler.h libcec-2.1.1/src/lib/implementations/VLCommandHandler.h --- libcec-2.0.4/src/lib/implementations/VLCommandHandler.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/implementations/VLCommandHandler.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/adl/adl-edid.cpp libcec-2.1.1/src/lib/platform/adl/adl-edid.cpp --- libcec-2.0.4/src/lib/platform/adl/adl-edid.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/adl/adl-edid.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/platform/adl/adl-edid.h libcec-2.1.1/src/lib/platform/adl/adl-edid.h --- libcec-2.0.4/src/lib/platform/adl/adl-edid.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/adl/adl-edid.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/nvidia/nv-edid.cpp libcec-2.1.1/src/lib/platform/nvidia/nv-edid.cpp --- libcec-2.0.4/src/lib/platform/nvidia/nv-edid.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/nvidia/nv-edid.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/platform/nvidia/nv-edid.h libcec-2.1.1/src/lib/platform/nvidia/nv-edid.h --- libcec-2.0.4/src/lib/platform/nvidia/nv-edid.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/nvidia/nv-edid.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/os.h libcec-2.1.1/src/lib/platform/os.h --- libcec-2.0.4/src/lib/platform/os.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/os.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/posix/os-edid.cpp libcec-2.1.1/src/lib/platform/posix/os-edid.cpp --- libcec-2.0.4/src/lib/platform/posix/os-edid.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/posix/os-edid.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/platform/posix/os-socket.h libcec-2.1.1/src/lib/platform/posix/os-socket.h --- libcec-2.0.4/src/lib/platform/posix/os-socket.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/posix/os-socket.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/posix/os-threads.h libcec-2.1.1/src/lib/platform/posix/os-threads.h --- libcec-2.0.4/src/lib/platform/posix/os-threads.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/posix/os-threads.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/posix/os-types.h libcec-2.1.1/src/lib/platform/posix/os-types.h --- libcec-2.0.4/src/lib/platform/posix/os-types.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/posix/os-types.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/posix/serialport.cpp libcec-2.1.1/src/lib/platform/posix/serialport.cpp --- libcec-2.0.4/src/lib/platform/posix/serialport.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/posix/serialport.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -48,15 +48,17 @@ #define IUCLC 0 #endif #else +#ifdef HAVE_LOCKDEV #include #endif +#endif using namespace std; using namespace PLATFORM; inline bool RemoveLock(const char *strDeviceName) { - #if !defined(__APPLE__) && !defined(__FreeBSD__) + #if !defined(__APPLE__) && !defined(__FreeBSD__) && defined(HAVE_LOCKDEV) return dev_unlock(strDeviceName, 0) == 0; #else void *tmp = (void*)strDeviceName; // silence unused warning @@ -125,7 +127,7 @@ return false; } - #if !defined(__APPLE__) && !defined(__FreeBSD__) + #if !defined(__APPLE__) && !defined(__FreeBSD__) && defined(HAVE_LOCKDEV) if (dev_lock(m_strName.c_str()) != 0) { m_strError = "Couldn't lock the serial port"; diff -Nru libcec-2.0.4/src/lib/platform/posix/serversocket.cpp libcec-2.1.1/src/lib/platform/posix/serversocket.cpp --- libcec-2.0.4/src/lib/platform/posix/serversocket.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/posix/serversocket.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/platform/sockets/cdevsocket.h libcec-2.1.1/src/lib/platform/sockets/cdevsocket.h --- libcec-2.0.4/src/lib/platform/sockets/cdevsocket.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/sockets/cdevsocket.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/sockets/serialport.h libcec-2.1.1/src/lib/platform/sockets/serialport.h --- libcec-2.0.4/src/lib/platform/sockets/serialport.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/sockets/serialport.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/sockets/serversocket.h libcec-2.1.1/src/lib/platform/sockets/serversocket.h --- libcec-2.0.4/src/lib/platform/sockets/serversocket.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/sockets/serversocket.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/sockets/socket.h libcec-2.1.1/src/lib/platform/sockets/socket.h --- libcec-2.0.4/src/lib/platform/sockets/socket.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/sockets/socket.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/sockets/tcp.h libcec-2.1.1/src/lib/platform/sockets/tcp.h --- libcec-2.0.4/src/lib/platform/sockets/tcp.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/sockets/tcp.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/threads/mutex.h libcec-2.1.1/src/lib/platform/threads/mutex.h --- libcec-2.0.4/src/lib/platform/threads/mutex.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/threads/mutex.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/threads/threads.h libcec-2.1.1/src/lib/platform/threads/threads.h --- libcec-2.0.4/src/lib/platform/threads/threads.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/threads/threads.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/util/baudrate.h libcec-2.1.1/src/lib/platform/util/baudrate.h --- libcec-2.0.4/src/lib/platform/util/baudrate.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/util/baudrate.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/util/buffer.h libcec-2.1.1/src/lib/platform/util/buffer.h --- libcec-2.0.4/src/lib/platform/util/buffer.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/util/buffer.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/util/edid.h libcec-2.1.1/src/lib/platform/util/edid.h --- libcec-2.0.4/src/lib/platform/util/edid.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/util/edid.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/util/timeutils.h libcec-2.1.1/src/lib/platform/util/timeutils.h --- libcec-2.0.4/src/lib/platform/util/timeutils.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/util/timeutils.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/util/util.h libcec-2.1.1/src/lib/platform/util/util.h --- libcec-2.0.4/src/lib/platform/util/util.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/util/util.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/windows/os-edid.cpp libcec-2.1.1/src/lib/platform/windows/os-edid.cpp --- libcec-2.0.4/src/lib/platform/windows/os-edid.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/windows/os-edid.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/platform/windows/os-socket.h libcec-2.1.1/src/lib/platform/windows/os-socket.h --- libcec-2.0.4/src/lib/platform/windows/os-socket.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/windows/os-socket.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/windows/os-threads.cpp libcec-2.1.1/src/lib/platform/windows/os-threads.cpp --- libcec-2.0.4/src/lib/platform/windows/os-threads.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/windows/os-threads.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/lib/platform/windows/os-threads.h libcec-2.1.1/src/lib/platform/windows/os-threads.h --- libcec-2.0.4/src/lib/platform/windows/os-threads.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/windows/os-threads.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/windows/os-types.h libcec-2.1.1/src/lib/platform/windows/os-types.h --- libcec-2.0.4/src/lib/platform/windows/os-types.h 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/windows/os-types.h 2013-03-09 20:14:55.000000000 +0000 @@ -2,7 +2,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. diff -Nru libcec-2.0.4/src/lib/platform/windows/serialport.cpp libcec-2.1.1/src/lib/platform/windows/serialport.cpp --- libcec-2.0.4/src/lib/platform/windows/serialport.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/lib/platform/windows/serialport.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. diff -Nru libcec-2.0.4/src/testclient/main.cpp libcec-2.1.1/src/testclient/main.cpp --- libcec-2.0.4/src/testclient/main.cpp 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/src/testclient/main.cpp 2013-03-09 20:14:55.000000000 +0000 @@ -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. @@ -197,45 +197,41 @@ void ListDevices(ICECAdapter *parser) { - cec_adapter *devices = new cec_adapter[10]; - int8_t iDevicesFound = parser->FindAdapters(devices, 10, NULL); + cec_adapter_descriptor devices[10]; + int8_t iDevicesFound = parser->DetectAdapters(devices, 10, NULL); if (iDevicesFound <= 0) { PrintToStdOut("Found devices: NONE"); } else { - CStdString strDeviceInfo; - strDeviceInfo.Format("Found devices: %d\n\n", iDevicesFound); + PrintToStdOut("Found devices: %d\n", iDevicesFound); for (int8_t iDevicePtr = 0; iDevicePtr < iDevicesFound; iDevicePtr++) { - strDeviceInfo.AppendFormat("device: %d\ncom port: %s\n", iDevicePtr + 1, devices[iDevicePtr].comm); - libcec_configuration config; - config.Clear(); + PrintToStdOut("device: %d", iDevicePtr + 1); + PrintToStdOut("com port: %s", devices[iDevicePtr].strComName); + PrintToStdOut("vendor id: %04x", devices[iDevicePtr].iVendorId); + PrintToStdOut("product id: %04x", devices[iDevicePtr].iProductId); + PrintToStdOut("firmware version: %d", devices[iDevicePtr].iFirmwareVersion); - if (!parser->GetDeviceInformation(devices[iDevicePtr].comm, &config)) - PrintToStdOut("WARNING: unable to open the device on port %s", devices[iDevicePtr].comm); - else + if (devices[iDevicePtr].iFirmwareBuildDate != CEC_FW_BUILD_UNKNOWN) { - strDeviceInfo.AppendFormat("firmware version: %d\n", config.iFirmwareVersion); - - if (config.iFirmwareBuildDate != CEC_FW_BUILD_UNKNOWN) - { - time_t buildTime = (time_t)config.iFirmwareBuildDate; - strDeviceInfo.AppendFormat("firmware build date: %s", asctime(gmtime(&buildTime))); - strDeviceInfo = strDeviceInfo.Left(strDeviceInfo.length() > 1 ? (unsigned)(strDeviceInfo.length() - 1) : 0); // strip \n added by asctime - strDeviceInfo.append(" +0000\n"); - } + time_t buildTime = (time_t)devices[iDevicePtr].iFirmwareBuildDate; + CStdString strDeviceInfo; + strDeviceInfo.AppendFormat("firmware build date: %s", asctime(gmtime(&buildTime))); + strDeviceInfo = strDeviceInfo.Left(strDeviceInfo.length() > 1 ? (unsigned)(strDeviceInfo.length() - 1) : 0); // strip \n added by asctime + strDeviceInfo.append(" +0000"); + PrintToStdOut(strDeviceInfo.c_str()); + } - if (config.adapterType != ADAPTERTYPE_UNKNOWN) - { - strDeviceInfo.AppendFormat("type: %s\n", parser->ToString(config.adapterType)); - } + if (devices[iDevicePtr].adapterType != ADAPTERTYPE_UNKNOWN) + { + PrintToStdOut("type: %s", parser->ToString(devices[iDevicePtr].adapterType)); } - strDeviceInfo.append("\n"); + + PrintToStdOut(""); } - PrintToStdOut(strDeviceInfo.c_str()); } } diff -Nru libcec-2.0.4/support/cec-test-device.sh libcec-2.1.1/support/cec-test-device.sh --- libcec-2.0.4/support/cec-test-device.sh 2012-11-15 13:45:24.000000000 +0000 +++ libcec-2.1.1/support/cec-test-device.sh 2013-03-09 20:14:55.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/bash ## Tests whether the USB-CEC adapter can be accessed correctly -## Copyright (C) 2011 Pulse-Eight Ltd. +## Copyright (C) 2011-2013 Pulse-Eight Ltd. check_lsusb() {