+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 <packaging@pulse-eight.com> Tue, 26 Feb 2013 23:06:00 +0100
+
libcec (2.0.5-1) unstable; urgency=low
* changed:
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])
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],
+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 <packaging@pulse-eight.com> Tue, 26 Feb 2013 23:06:00 +0100
+
libcec (2.0.5-1) unstable; urgency=low
* changed:
/*
* 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.
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.
* @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;
+
};
};
/*
* 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.
extern DECLSPEC uint8_t cec_audio_unmute(void);
-extern DECLSPEC uint8_t cec_audio_status(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
};
/*
* 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.
/*
* 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.
*/
#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"
*/
/*!
* libCEC's minor version number
*/
-#define CEC_LIB_VERSION_MINOR 0
+#define CEC_LIB_VERSION_MINOR 1
#define MSGSTART 0xFF
#define MSGEND 0xFE
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;
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 */
CEC_CLIENT_VERSION_2_0_3 = 0x2003,
CEC_CLIENT_VERSION_2_0_4 = 0x2004,
CEC_CLIENT_VERSION_2_0_5 = 0x2005,
- CEC_CLIENT_VERSION_CURRENT = 0x2005
+ CEC_CLIENT_VERSION_2_1_0 = 0x2100,
+ CEC_CLIENT_VERSION_CURRENT = 0x2100
} cec_client_version;
typedef enum cec_server_version
CEC_SERVER_VERSION_2_0_3 = 0x2003,
CEC_SERVER_VERSION_2_0_4 = 0x2004,
CEC_SERVER_VERSION_2_0_5 = 0x2005,
- CEC_SERVER_VERSION_CURRENT = 0x2005
+ CEC_SERVER_VERSION_2_1_0 = 0x2100,
+ CEC_SERVER_VERSION_CURRENT = 0x2100
} cec_server_version;
struct libcec_configuration
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 */
cecVersion == other.cecVersion &&
adapterType == other.adapterType &&
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_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
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;
;libCEC installer
-;Copyright (C) 2012 Pulse-Eight Ltd.
+;Copyright (C) 2011-2013 Pulse-Eight Ltd.
;http://www.pulse-eight.com/
!include "MUI2.nsh"
!include "LogicLib.nsh"
!include "x64.nsh"
-Name "Pulse-Eight libCEC version 2.0.5"
+Name "Pulse-Eight libCEC version 2.1.0"
OutFile "..\build\libCEC-installer.exe"
XPStyle on
;p8-usbcec-driver installer
-;Copyright (C) 2012 Pulse-Eight Ltd.
+;Copyright (C) 2011-2013 Pulse-Eight Ltd.
;http://www.pulse-eight.com/
!include "MUI2.nsh"
/*
* 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.
Config = new LibCECConfiguration();
Config.DeviceTypes.Types[0] = CecDeviceType.RecordingDevice;
Config.DeviceName = "CEC Tester";
- Config.ClientVersion = CecClientVersion.Version2_0_5;
+ Config.ClientVersion = CecClientVersion.Version2_1_0;
Config.SetCallbacks(this);
LogLevel = (int)CecLogLevel.All;
[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("")]
// 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.5.0")]
-[assembly: AssemblyFileVersion("2.0.5.0")]
+[assembly: AssemblyVersion("2.1.0.0")]
+[assembly: AssemblyFileVersion("2.1.0.0")]
[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.5.0")];
+[assembly:AssemblyVersionAttribute("2.1.0.0")];
[assembly:ComVisible(false)];
[assembly:CLSCompliantAttribute(true)];
/*
* 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.
/// </summary>
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
};
/// <summary>
/// v2.0.5
/// </summary>
- Version2_0_5 = 0x2005
+ Version2_0_5 = 0x2005,
+ /// <summary>
+ /// v2.1.0
+ /// </summary>
+ Version2_1_0 = 0x2100
};
/// <summary>
/// <summary>
/// v2.0.5
/// </summary>
- Version2_0_5 = 0x2005
+ Version2_0_5 = 0x2005,
+ /// <summary>
+ /// v2.1.0
+ /// </summary>
+ Version2_1_0 = 0x2100
};
/// <summary>
/// <summary>
/// Raspberry Pi
/// </summary>
- RaspberryPi = 0x100
+ RaspberryPi = 0x100,
+ /// <summary>
+ /// TDA995x
+ /// </summary>
+ TDA995x = 0x200
};
/// <summary>
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_0;
+ ServerVersion = CecServerVersion::Version2_1_0;
TvVendor = CecVendorId::Unknown;
GetSettingsFromROM = false;
if (ServerVersion >= CecServerVersion::Version1_8_2)
AdapterType = (CecAdapterType)config.adapterType;
+
+ if (ServerVersion >= CecServerVersion::Version2_1_0)
+ PowerOnScreensaver = config.bPowerOnScreensaver == 1;
}
/// <summary>
/// The type of adapter that libCEC is connected to.
/// </summary>
property CecAdapterType AdapterType;
+
+ /// <summary>
+ /// True to power on when quitting the screensaver.
+ /// </summary>
+ property bool PowerOnScreensaver;
};
// the callback methods are called by unmanaged code, so we need some delegates for this
/*
* 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.
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;
}
/*
* 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.
[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("")]
// 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.5.0")]
-[assembly: AssemblyFileVersion("2.0.5.0")]
+[assembly: AssemblyVersion("2.1.0.0")]
+[assembly: AssemblyFileVersion("2.1.0.0")]
/*
* 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.
/*
* 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.
{
if (_config == null)
{
- _config = new LibCECConfiguration { DeviceName = "CEC Tray", ClientVersion = CecClientVersion.Version2_0_5 };
+ _config = new LibCECConfiguration { DeviceName = "CEC Tray", ClientVersion = CecClientVersion.Version2_1_0 };
_config.DeviceTypes.Types[0] = CecDeviceType.RecordingDevice;
_config.SetCallbacks(this);
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
+/*
+ * 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 <license@pulse-eight.com>
+ * http://www.pulse-eight.com/
+ * http://www.pulse-eight.net/
+ */
+
using CecSharp;
using LibCECTray.Properties;
using LibCECTray.ui;
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
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)
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;
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
{
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;
}
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;
}
{
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++;
private readonly List<WindowsAPI.Input> _input = new List<WindowsAPI.Input>();
}
-}
\ No newline at end of file
+}
/*
* 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.
return null;
}
}
-}
\ No newline at end of file
+}
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
+/*
+ * 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 <license@pulse-eight.com>
+ * http://www.pulse-eight.com/
+ * http://www.pulse-eight.net/
+ */
+
using System.Windows.Forms;
using CecSharp;
using LibCECTray.Properties;
/*
* 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.
/*
* 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.
/*
* 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.
+/*
+ * 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 <license@pulse-eight.com>
+ * http://www.pulse-eight.com/
+ * http://www.pulse-eight.net/
+ */
+
using System.Globalization;
using System.Windows.Forms;
/*
* 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.
/*
* 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.
/*
* 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.
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="label1.Text" xml:space="preserve">
- <value>libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited. All rights reserved.
+ <value>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 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.
/*
* 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.
{
Text = Resources.app_name;
InitializeComponent();
- _controller = new CECController(this);
VisibleChanged += delegate
{
if (!Visible)
private void CECTrayLoad(object sender, EventArgs e)
{
- _controller.Initialise();
+ Controller.Initialise();
}
protected override void Dispose(bool disposing)
Hide();
if (disposing)
{
- _controller.Close();
+ Controller.Close();
}
if (disposing && (components != null))
{
private void BSaveClick(object sender, EventArgs e)
{
- _controller.PersistSettings();
+ Controller.PersistSettings();
}
private void BReloadConfigClick(object sender, EventArgs e)
{
- _controller.ResetDefaultSettings();
+ Controller.ResetDefaultSettings();
}
#endregion
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)
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
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);
}
{
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();
}
}
private void TsAdvancedClick(object sender, EventArgs e)
{
- _controller.Settings.AdvancedMode.Value = !tsAdvanced.Checked;
+ Controller.Settings.AdvancedMode.Value = !tsAdvanced.Checked;
ShowHideAdvanced(!tsAdvanced.Checked);
}
#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
{
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);
}
}
}
/*
* 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.
/*
* 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.
/*
* 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.
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;
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);
/*
* 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.
/*
* 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.
/*
* 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.
config->iFirmwareBuildDate = m_communication->GetFirmwareBuildDate();
config->adapterType = m_communication->GetAdapterType();
+ Close();
+
return true;
}
}
}
+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;
/*
* 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.
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;
/*
* 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.
return "Broadcom";
case CEC_VENDOR_LOEWE:
return "Loewe";
+ case CEC_VENDOR_DENON:
+ return "Denon";
default:
return "Unknown";
}
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";
default:
return "Unknown";
}
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";
default:
return "Unknown";
}
/*
* 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.
{
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;
+}
/*
* 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.
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);
/*
* 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.
return cec_parser ? cec_parser->AudioUnmute() : (uint8_t)CEC_AUDIO_VOLUME_STATUS_UNKNOWN;
}
-uint8_t cec_audio_status(void)
+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;
+}
+
//@}
/*
* 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.
/*
* 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.
*/
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;
};
/*
* 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.
using namespace CEC;
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 (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
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
/*
* 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.
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);
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
}
#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);
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++;
}
}
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++;
}
}
// 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++;
}
}
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++;
}
}
/*
* 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.
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);
};
};
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
static_cast<CRPiCECAdapterCommunication *>(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<CRPiCECAdapterCommunication *>(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);
}
return m_bInitialised;
}
+void CRPiCECAdapterCommunication::OnTVServiceCallback(uint32_t reason, uint32_t UNUSED(p0), uint32_t UNUSED(p1))
+{
+ switch(reason)
+ {
+ case VC_HDMI_UNPLUGGED:
+ {
+ m_callback->HandlePhysicalAddressChanged(0x1000);
+ break;
+ }
+ case VC_HDMI_ATTACHED:
+ {
+ uint16_t iNewAddress = GetPhysicalAddress();
+ m_callback->HandlePhysicalAddressChanged(iNewAddress);
+ break;
+ }
+ 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);
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;
// 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();
else
return;
}
+ vc_tv_unregister_callback(rpi_tv_callback);
+
UnregisterLogicalAddress();
// disable passive mode
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();
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)
/*
* 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.
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);
VCHI_INSTANCE_T m_vchi_instance;
VCHI_CONNECTION_T * m_vchi_connection;
cec_logical_address m_previousLogicalAddress;
+ bool m_bLogicalAddressRegistered;
};
};
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
return;
CCECBusDevice* newRoute = m_processor->GetDeviceByPhysicalAddress(iRoute, true);
- if (newRoute && newRoute->IsHandledByLibCEC())
- newRoute->ActivateSource();
+ if (newRoute)
+ {
+ // we were made the active source, send notification
+ if (newRoute->IsHandledByLibCEC())
+ newRoute->ActivateSource();
+ // another device was made active
+ else
+ newRoute->MarkAsActiveSource();
+ }
+ else
+ {
+ // get the current active source and it's physical address
+ CCECBusDevice *device = m_processor->GetDevices()->GetActiveSource();
+ uint16_t iPhysicalAddress(device ? device->GetCurrentPhysicalAddress() : CEC_INVALID_PHYSICAL_ADDRESS);
+
+ // check whether the route below the device changed
+ if (CLibCEC::IsValidPhysicalAddress(iPhysicalAddress) &&
+ !CCECTypeUtils::PhysicalAddressIsIncluded(iPhysicalAddress, iRoute))
+ device->MarkAsInactiveSource();
+ }
}
void CCECBusDevice::SetStreamPath(uint16_t iNewAddress, uint16_t iOldAddress /* = CEC_INVALID_PHYSICAL_ADDRESS */)
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
{
m_imageViewOnCheck = new CImageViewOnCheck(this);
m_vendorId = CEC_VENDOR_PHILIPS;
+ m_bOPTSendDeckStatusUpdateOnActiveSource = false;
}
CPHCommandHandler::~CPHCommandHandler(void)
{
// 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);
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
/*
* 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.
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());
}
}
#!/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()
{