LibCecSharp: Update for 1.6.2
authorMark Kendall <mark.kendall@gmail.com>
Tue, 24 Apr 2012 09:35:12 +0000 (10:35 +0100)
committerMark Kendall <mark.kendall@gmail.com>
Tue, 24 Apr 2012 09:35:12 +0000 (10:35 +0100)
bugzid: 699 bugzid: 660

src/LibCecSharp/CecSharpTypes.h
src/LibCecSharp/LibCecSharp.cpp

index 1e808196a881de53bdc045d21a81be02a1f5dd10..14630197f51a561227d005175519552b23ea502f 100644 (file)
@@ -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;
        };
 
index 2338671d577dfa53448185aacfd58abafc89a753..680ccfba6f2ffa51b549e145c202c1c78cb3a97f 100644 (file)
@@ -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<const char*>(netConfig->DeviceLanguage));
 
                        config.callbacks            = &g_cecCallbacks;
                }