From: Mark Kendall Date: Tue, 24 Apr 2012 09:35:12 +0000 (+0100) Subject: LibCecSharp: Update for 1.6.2 X-Git-Tag: upstream/2.2.0~1^2~29^2^2~53 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=92da1117ccc9567075c90df5b701f40863392874;p=deb_libcec.git LibCecSharp: Update for 1.6.2 bugzid: 699 bugzid: 660 --- diff --git a/src/LibCecSharp/CecSharpTypes.h b/src/LibCecSharp/CecSharpTypes.h index 1e80819..1463019 100644 --- a/src/LibCecSharp/CecSharpTypes.h +++ b/src/LibCecSharp/CecSharpTypes.h @@ -582,10 +582,13 @@ namespace CecSharp PowerOffScreensaver = CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER == 1; PowerOffOnStandby = CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY == 1; - SendInactiveSource = CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE == 1; - LogicalAddresses = gcnew CecLogicalAddresses(); - FirmwareVersion = 1; - PowerOffDevicesOnStandby = CEC_DEFAULT_SETTING_POWER_OFF_DEVICES_STANDBY == 1; + + SendInactiveSource = CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE == 1; + LogicalAddresses = gcnew CecLogicalAddresses(); + FirmwareVersion = 1; + PowerOffDevicesOnStandby = CEC_DEFAULT_SETTING_POWER_OFF_DEVICES_STANDBY == 1; + ShutdownOnStandby = CEC_DEFAULT_SETTING_SHUTDOWN_ON_STANDBY == 1; + DeviceLanguage = ""; } void SetCallbacks(CecCallbackMethods ^callbacks) @@ -626,22 +629,26 @@ namespace CecSharp PowerOffScreensaver = config.bPowerOffScreensaver == 1; PowerOffOnStandby = config.bPowerOffOnStandby == 1; - if (ServerVersion >= CecServerVersion::Version1_5_1) - SendInactiveSource = config.bSendInactiveSource == 1; + if (ServerVersion >= CecServerVersion::Version1_5_1) + SendInactiveSource = config.bSendInactiveSource == 1; - if (ServerVersion >= CecServerVersion::Version1_5_3) - { - LogicalAddresses->Clear(); - for (uint8_t iPtr = 0; iPtr <= 16; iPtr++) - if (config.logicalAddresses[iPtr]) - LogicalAddresses->Set((CecLogicalAddress)iPtr); - } + if (ServerVersion >= CecServerVersion::Version1_5_3) + { + LogicalAddresses->Clear(); + for (uint8_t iPtr = 0; iPtr <= 16; iPtr++) + if (config.logicalAddresses[iPtr]) + LogicalAddresses->Set((CecLogicalAddress)iPtr); + } - if (ServerVersion >= CecServerVersion::Version1_6_0) - { - FirmwareVersion = config.iFirmwareVersion; - PowerOffDevicesOnStandby = config.bPowerOffDevicesOnStandby == 1; - } + if (ServerVersion >= CecServerVersion::Version1_6_0) + { + FirmwareVersion = config.iFirmwareVersion; + PowerOffDevicesOnStandby = config.bPowerOffDevicesOnStandby == 1; + ShutdownOnStandby = config.bShutdownOnStandby == 1; + } + + if (ServerVersion >= CecServerVersion::Version1_6_2) + DeviceLanguage = gcnew System::String(config.strDeviceLanguage); } property System::String ^ DeviceName; @@ -662,11 +669,12 @@ namespace CecSharp property CecLogicalAddresses ^PowerOffDevices; property bool PowerOffScreensaver; property bool PowerOffOnStandby; - property bool SendInactiveSource; - property CecLogicalAddresses ^LogicalAddresses; - property uint16_t FirmwareVersion; - property bool PowerOffDevicesOnStandby; - + property bool SendInactiveSource; + property CecLogicalAddresses ^LogicalAddresses; + property uint16_t FirmwareVersion; + property bool PowerOffDevicesOnStandby; + property bool ShutdownOnStandby; + property System::String ^ DeviceLanguage; property CecCallbackMethods ^ Callbacks; }; diff --git a/src/LibCecSharp/LibCecSharp.cpp b/src/LibCecSharp/LibCecSharp.cpp index 2338671..680ccfb 100644 --- a/src/LibCecSharp/LibCecSharp.cpp +++ b/src/LibCecSharp/LibCecSharp.cpp @@ -118,11 +118,17 @@ namespace CecSharp config.bPowerOffScreensaver = netConfig->PowerOffScreensaver ? 1 : 0; config.bPowerOffOnStandby = netConfig->PowerOffOnStandby ? 1 : 0; - if (netConfig->ServerVersion >= CecServerVersion::Version1_5_1) - config.bSendInactiveSource = netConfig->SendInactiveSource ? 1 : 0; + if (netConfig->ServerVersion >= CecServerVersion::Version1_5_1) + config.bSendInactiveSource = netConfig->SendInactiveSource ? 1 : 0; - if (netConfig->ServerVersion >= CecServerVersion::Version1_6_0) - config.bPowerOffDevicesOnStandby = netConfig->PowerOffDevicesOnStandby ? 1 : 0; + if (netConfig->ServerVersion >= CecServerVersion::Version1_6_0) + { + config.bPowerOffDevicesOnStandby = netConfig->PowerOffDevicesOnStandby ? 1 : 0; + config.bShutdownOnStandby = netConfig->ShutdownOnStandby ? 1 : 0; + } + + if (netConfig->ServerVersion >= CecServerVersion::Version1_6_2) + _snprintf_s(config.strDeviceLanguage, 3, context->marshal_as(netConfig->DeviceLanguage)); config.callbacks = &g_cecCallbacks; }