Add bShutdownOnStandby to libcec_configuration. bugzid: 660
authorMark Kendall <mkendall@mythtv.org>
Thu, 12 Apr 2012 14:13:48 +0000 (15:13 +0100)
committerMark Kendall <mkendall@mythtv.org>
Thu, 12 Apr 2012 14:13:48 +0000 (15:13 +0100)
This setting tells the client to shutdown when the TV switches off and
is complimentary to bPowerOffOnStandby, which tells the PC to suspend.

They are kept separate to maintain backwards compatability.

include/cectypes.h
src/lib/CECProcessor.cpp

index 88eeabbd4b8afd1a9f89d6ea1070dad2f73655fd..62b7b602f51e1ad56c9721933941ea46122eaf74 100644 (file)
@@ -79,6 +79,7 @@ namespace CEC {
 #define CEC_DEFAULT_SETTING_POWER_OFF_SHUTDOWN    1
 #define CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER 1
 #define CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY  1
 #define CEC_DEFAULT_SETTING_POWER_OFF_SHUTDOWN    1
 #define CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER 1
 #define CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY  1
+#define CEC_DEFAULT_SETTING_SHUTDOWN_ON_STANDBY   0
 #define CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE  1
 #define CEC_DEFAULT_SETTING_POWER_OFF_DEVICES_STANDBY 1
 
 #define CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE  1
 #define CEC_DEFAULT_SETTING_POWER_OFF_DEVICES_STANDBY 1
 
@@ -1026,7 +1027,7 @@ typedef 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               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               bPowerOffOnStandby;   /*!< put this PC in standby mode when the TV is switched off */
+  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 */
 
   void *                callbackParam;        /*!< the object to pass along with a call of the callback methods. NULL to ignore */
   uint8_t               bSendInactiveSource;  /*!< send an 'inactive source' message when stopping the player. added in 1.5.1 */
 
   void *                callbackParam;        /*!< the object to pass along with a call of the callback methods. NULL to ignore */
@@ -1035,6 +1036,7 @@ typedef struct libcec_configuration
   cec_logical_addresses logicalAddresses;     /*!< the current logical addresses. read-only. added in 1.5.3 */
   uint16_t              iFirmwareVersion;     /*!< the firmware version of the adapter. added in 1.6.0 */
   uint8_t               bPowerOffDevicesOnStandby; /*!< put devices in standby when the PC/player is put in standby. added in 1.6.0 */
   cec_logical_addresses logicalAddresses;     /*!< the current logical addresses. read-only. added in 1.5.3 */
   uint16_t              iFirmwareVersion;     /*!< the firmware version of the adapter. added in 1.6.0 */
   uint8_t               bPowerOffDevicesOnStandby; /*!< put devices in standby when the PC/player is put in standby. added in 1.6.0 */
+  uint8_t               bShutdownOnStandby;   /*!< shutdown this PC when the TV is switched off. only used when bPowerOffOnStandby = 0. added in 1.6.0 */
 
 #ifdef __cplusplus
   void Clear(void)
 
 #ifdef __cplusplus
   void Clear(void)
@@ -1062,6 +1064,7 @@ typedef struct libcec_configuration
     #endif
     bPowerOffScreensaver = CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER;
     bPowerOffOnStandby   = CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY;
     #endif
     bPowerOffScreensaver = CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER;
     bPowerOffOnStandby   = CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY;
+    bShutdownOnStandby   = CEC_DEFAULT_SETTING_SHUTDOWN_ON_STANDBY;
     bSendInactiveSource  = CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE;
     logicalAddresses.Clear();
     iFirmwareVersion = 0;
     bSendInactiveSource  = CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE;
     logicalAddresses.Clear();
     iFirmwareVersion = 0;
index ee95cce720490d3fac40b013b077a7c2620e293a..9b44d3b1da22c2a2f78a04e1ac345878e15c2c9a 100644 (file)
@@ -1628,7 +1628,10 @@ bool CCECProcessor::SetConfiguration(const libcec_configuration *configuration)
 
   // client version 1.6.0
   if (configuration->clientVersion >= CEC_CLIENT_VERSION_1_6_0)
 
   // client version 1.6.0
   if (configuration->clientVersion >= CEC_CLIENT_VERSION_1_6_0)
+  {
     m_configuration.bPowerOffDevicesOnStandby = configuration->bPowerOffDevicesOnStandby;
     m_configuration.bPowerOffDevicesOnStandby = configuration->bPowerOffDevicesOnStandby;
+    m_configuration.bShutdownOnStandby        = configuration->bShutdownOnStandby;
+  }
 
   // ensure that there is at least 1 device type set
   if (m_configuration.deviceTypes.IsEmpty())
 
   // ensure that there is at least 1 device type set
   if (m_configuration.deviceTypes.IsEmpty())
@@ -1686,6 +1689,7 @@ bool CCECProcessor::GetCurrentConfiguration(libcec_configuration *configuration)
   {
     configuration->iFirmwareVersion          = m_configuration.iFirmwareVersion;
     configuration->bPowerOffDevicesOnStandby = m_configuration.bPowerOffDevicesOnStandby;
   {
     configuration->iFirmwareVersion          = m_configuration.iFirmwareVersion;
     configuration->bPowerOffDevicesOnStandby = m_configuration.bPowerOffDevicesOnStandby;
+    configuration->bShutdownOnStandby        = m_configuration.bShutdownOnStandby;
   }
 
   return true;
   }
 
   return true;