X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2FLibCecSharp%2FCecSharpTypes.h;h=2de94bf015800c2b3680b65d605ba2e025d560c4;hb=7cb1f563b6f5568953064b8e9bd7e63f0ad874ab;hp=adef54d314768e550e0084e5970018d7a79d9582;hpb=8438c41fc8c7ee216ccc774005f862f42cf7f0df;p=deb_libcec.git diff --git a/src/LibCecSharp/CecSharpTypes.h b/src/LibCecSharp/CecSharpTypes.h index adef54d..2de94bf 100644 --- a/src/LibCecSharp/CecSharpTypes.h +++ b/src/LibCecSharp/CecSharpTypes.h @@ -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. @@ -39,6 +39,10 @@ #using +/// +/// LibCecSharp namespace +/// +/// namespace CecSharp { /// @@ -196,7 +200,27 @@ namespace CecSharp /// The device needs servicing. This is set when the firmware can be upgraded, or when a problem with the firmware is detected. /// The latest firmware flash tool can be downloaded from http://packages.pulse-eight.net/ /// - ServiceDevice = 1 + ServiceDevice = 0, + /// + /// The connection to the adapter was lost, probably because the device got unplugged. + /// + ConnectionLost, + /// + /// No permission from the OS to access the adapter. + /// + PermissionError, + /// + /// The device is being used by another program. + /// + PortBusy, + /// + /// The physical address that is assigned to the adapter is already being used. + /// + PhysicalAddressError, + /// + /// The TV does not respond to polls. + /// + TVPollFailed }; /// @@ -425,7 +449,7 @@ namespace CecSharp /// /// User control code, the key code when the user presses or releases a button on the remote. - /// Used by SendKeypress() and the CecKeyPress() callback. + /// Used by SendKeypress() and the CecKey callback. /// public enum class CecUserControlCode { @@ -760,23 +784,31 @@ namespace CecSharp /// public enum class CecVendorId { - Samsung = 0x0000F0, - LG = 0x00E091, - Panasonic = 0x008045, - Pioneer = 0x00E036, - Onkyo = 0x0009B0, - Yamaha = 0x00A0DE, - Philips = 0x00903E, - Sony = 0x080046, - Toshiba = 0x000039, - Akai = 0x0020C7, - Benq = 0x8065E9, - Daewoo = 0x009053, - Grundig = 0x00D0D5, - Medion = 0x000CB8, - Sharp = 0x08001F, - Vizio = 0x6B746D, - Unknown = 0 + Toshiba = 0x000039, + Samsung = 0x0000F0, + Denon = 0x0005CD, + Marantz = 0x000678, + Loewe = 0x000982, + Onkyo = 0x0009B0, + Medion = 0x000CB8, + Toshiba2 = 0x000CE7, + PulseEight = 0x001582, + Akai = 0x0020C7, + AOC = 0x002467, + Panasonic = 0x008045, + Philips = 0x00903E, + Daewoo = 0x009053, + Yamaha = 0x00A0DE, + Grundig = 0x00D0D5, + Pioneer = 0x00E036, + LG = 0x00E091, + Sharp = 0x08001F, + Sony = 0x080046, + Broadcom = 0x18C086, + Vizio = 0x6B746D, + Benq = 0x8065E9, + HarmanKardon = 0x9C645E, + Unknown = 0 }; /// @@ -913,6 +945,7 @@ namespace CecSharp GivePhysicalAddress = 0x83, /// /// Request language code of the menu language of a device + /// 3 character ISO 639-2 country code. see http://http://www.loc.gov/standards/iso639-2/ /// GetMenuLanguage = 0x91, /// @@ -921,6 +954,7 @@ namespace CecSharp ReportPhysicalAddress = 0x84, /// /// Report the language code of the menu language + /// 3 character ISO 639-2 country code. see http://http://www.loc.gov/standards/iso639-2/ /// SetMenuLanguage = 0x32, /// @@ -1149,7 +1183,59 @@ namespace CecSharp /// /// v1.9.0 /// - Version1_9_0 = 0x1900 + Version1_9_0 = 0x1900, + /// + /// v2.0.0-pre + /// + Version1_99_0 = 0x1990, + /// + /// v2.0.0 + /// + Version2_0_0 = 0x2000, + /// + /// v2.0.1 + /// + Version2_0_1 = 0x2001, + /// + /// v2.0.2 + /// + Version2_0_2 = 0x2002, + /// + /// v2.0.3 + /// + Version2_0_3 = 0x2003, + /// + /// v2.0.4 + /// + 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, + /// + /// v2.1.2 + /// + Version2_1_2 = 0x2102, + /// + /// v2.1.3 + /// + Version2_1_3 = 0x2103, + /// + /// v2.1.4 + /// + Version2_1_4 = 0x2104, + /// + /// The current version + /// + CurrentVersion = 0x2104 }; /// @@ -1220,7 +1306,59 @@ namespace CecSharp /// /// v1.9.0 /// - Version1_9_0 = 0x1900 + Version1_9_0 = 0x1900, + /// + /// v2.0.0-pre + /// + Version1_99_0 = 0x1990, + /// + /// v2.0.0 + /// + Version2_0_0 = 0x2000, + /// + /// v2.0.1 + /// + Version2_0_1 = 0x2001, + /// + /// v2.0.2 + /// + Version2_0_2 = 0x2002, + /// + /// v2.0.3 + /// + Version2_0_3 = 0x2003, + /// + /// v2.0.4 + /// + 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, + /// + /// v2.1.2 + /// + Version2_1_2 = 0x2102, + /// + /// v2.1.3 + /// + Version2_1_3 = 0x2103, + /// + /// v2.1.4 + /// + Version2_1_4 = 0x2104, + /// + /// The current version + /// + CurrentVersion = 0x2104 }; /// @@ -1243,7 +1381,11 @@ namespace CecSharp /// /// Raspberry Pi /// - RaspberryPi = 0x100 + RaspberryPi = 0x100, + /// + /// TDA995x + /// + TDA995x = 0x200 }; /// @@ -1607,8 +1749,8 @@ namespace CecSharp 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::CurrentVersion; + ServerVersion = CecServerVersion::CurrentVersion; TvVendor = CecVendorId::Unknown; GetSettingsFromROM = false; @@ -1716,6 +1858,9 @@ namespace CecSharp if (ServerVersion >= CecServerVersion::Version1_8_2) AdapterType = (CecAdapterType)config.adapterType; + + if (ServerVersion >= CecServerVersion::Version2_1_0) + PowerOnScreensaver = config.bPowerOnScreensaver == 1; } /// @@ -1729,22 +1874,22 @@ namespace CecSharp property CecDeviceTypeList ^ DeviceTypes; /// - /// True to try to autodetect the physical address, false otherwise + /// (read only) set to true by libCEC when the physical address was autodetected /// property bool AutodetectAddress; /// - /// The physical address that libCEC uses on the CEC bus + /// The physical address of the CEC adapter /// property uint16_t PhysicalAddress; /// - /// The logical address of the device to which the CEC adapter is connected, only used when PhysicalAddress isn't set + /// The logical address of the device to which the adapter is connected. Only used when PhysicalAddress = 0 or when the adapter doesn't support autodetection /// property CecLogicalAddress BaseDevice; /// - /// The hdmi port number on the device to which the CEC adapter is connected, only used when PhysicalAddress isn't set + /// The HDMI port to which the adapter is connected. Only used when iPhysicalAddress = 0 or when the adapter doesn't support autodetection /// property uint8_t HDMIPort; @@ -1759,7 +1904,7 @@ namespace CecSharp property CecServerVersion ServerVersion; /// - /// Override the vendor ID of the TV when set (for quirks mode) + /// Override the vendor ID of the TV. Leave this untouched to autodetect /// property CecVendorId TvVendor; @@ -1770,6 +1915,7 @@ namespace CecSharp /// /// Use the language setting of the TV in the client application. Must be implemented by the client application. + /// 3 character ISO 639-2 country code. see http://http://www.loc.gov/standards/iso639-2/ /// property bool UseTVMenuLanguage; @@ -1779,12 +1925,12 @@ namespace CecSharp property bool ActivateSource; /// - /// List of devices to send a power on command to when starting the client application + /// List of devices to wake when initialising libCEC or when calling PowerOnDevices() without any parameter. /// property CecLogicalAddresses ^WakeDevices; /// - /// List of devices to send a standby command to when exiting the client application + /// List of devices to power off when calling StandbyDevices() without any parameter. /// property CecLogicalAddresses ^PowerOffDevices; @@ -1817,6 +1963,10 @@ namespace CecSharp /// Send standby commands when the client application activates standby mode (S3). Must be implemented by the client application. /// property bool PowerOffDevicesOnStandby; + + /// + /// Shutdown this PC when the TV is switched off. only used when PowerOffOnStandby = false + /// property bool ShutdownOnStandby; /// @@ -1826,6 +1976,7 @@ namespace CecSharp /// /// The language code of the menu language that libCEC reports to other devices. + /// 3 character ISO 639-2 country code. see http://http://www.loc.gov/standards/iso639-2/ /// property System::String ^ DeviceLanguage; @@ -1848,6 +1999,11 @@ namespace CecSharp /// 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 @@ -1906,7 +2062,7 @@ namespace CecSharp /// Pointer to the callback struct /// The log message /// 1 when handled, 0 otherwise - int CecLogMessageCB(void *cbParam, const CEC::cec_log_message &message) + int CecLogMessageCB(void *cbParam, const CEC::cec_log_message message) { if (cbParam) { @@ -1924,7 +2080,7 @@ namespace CecSharp /// Pointer to the callback struct /// The key press command that libCEC received /// 1 when handled, 0 otherwise - int CecKeyPressCB(void *cbParam, const CEC::cec_keypress &key) + int CecKeyPressCB(void *cbParam, const CEC::cec_keypress key) { if (cbParam) { @@ -1942,7 +2098,7 @@ namespace CecSharp /// Pointer to the callback struct /// The raw CEC data /// 1 when handled, 0 otherwise - int CecCommandCB(void *cbParam, const CEC::cec_command &command) + int CecCommandCB(void *cbParam, const CEC::cec_command command) { if (cbParam) { @@ -1960,7 +2116,7 @@ namespace CecSharp /// Pointer to the callback struct /// The new configuration /// 1 when handled, 0 otherwise - int CecConfigCB(void *cbParam, const CEC::libcec_configuration &config) + int CecConfigCB(void *cbParam, const CEC::libcec_configuration config) { if (cbParam) { @@ -1978,7 +2134,7 @@ namespace CecSharp /// Pointer to the callback struct /// The alert message /// 1 when handled, 0 otherwise - int CecAlertCB(void *cbParam, const CEC::libcec_alert alert, const CEC::libcec_parameter &data) + int CecAlertCB(void *cbParam, const CEC::libcec_alert alert, const CEC::libcec_parameter data) { if (cbParam) { @@ -2026,14 +2182,34 @@ namespace CecSharp } #pragma managed - // delegates for the unmanaged callback methods + /// + /// Delegate method for the CecLogMessageCB callback in CecCallbackMethods + /// public delegate int CecLogMessageManagedDelegate(const CEC::cec_log_message &); + /// + /// Delegate method for the CecKeyPressCB callback in CecCallbackMethods + /// public delegate int CecKeyPressManagedDelegate(const CEC::cec_keypress &); + /// + /// Delegate method for the CecCommandCB callback in CecCallbackMethods + /// public delegate int CecCommandManagedDelegate(const CEC::cec_command &); + /// + /// Delegate method for the CecConfigCB callback in CecCallbackMethods + /// public delegate int CecConfigManagedDelegate(const CEC::libcec_configuration &); + /// + /// Delegate method for the CecAlertCB callback in CecCallbackMethods + /// public delegate int CecAlertManagedDelegate(const CEC::libcec_alert, const CEC::libcec_parameter &); - public delegate int CecMenuManagedDelegate(const CEC::cec_menu_state newVal); - public delegate void CecSourceActivatedManagedDelegate(const CEC::cec_logical_address logicalAddress, const uint8_t bActivated); + /// + /// Delegate method for the CecMenuCB callback in CecCallbackMethods + /// + public delegate int CecMenuManagedDelegate(const CEC::cec_menu_state); + /// + /// Delegate method for the CecSourceActivatedCB callback in CecCallbackMethods + /// + public delegate void CecSourceActivatedManagedDelegate(const CEC::cec_logical_address, const uint8_t); /// /// Assign the callback methods in the g_cecCallbacks struct @@ -2237,7 +2413,7 @@ namespace CecSharp CecParameterType newType = (CecParameterType)data.paramType; if (newType == CecParameterType::ParameterTypeString) { - System::String ^ newData = gcnew System::String((const char *)data.paramData, 0, 128); + System::String ^ newData = gcnew System::String(data.paramData ? (const char *)data.paramData : "", 0, 128); CecParameter ^ newParam = gcnew CecParameter(newType, newData); iReturn = m_callbacks->ReceiveAlert((CecAlert)alert, newParam); }