aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Op den Kamp <lars@opdenkamp.eu>2012-07-24 17:01:47 +0200
committerLars Op den Kamp <lars@opdenkamp.eu>2012-07-24 17:29:15 +0200
commit5cea3da9f4d8ba578d6ecc15f09e17112efcbf36 (patch)
tree0de953c9a255ff310c1c4989342221926cd2293e
parent6dd20c01a6dc9e779785bd5ae6f415c39421d354 (diff)
cec: wake the screensaver when XBMC was made the active source.
-rw-r--r--xbmc/peripherals/devices/PeripheralCecAdapter.cpp8
-rw-r--r--xbmc/peripherals/devices/PeripheralCecAdapter.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
index c0878b94b3..130bb93e17 100644
--- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
+++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
@@ -186,6 +186,7 @@ bool CPeripheralCecAdapter::InitialiseFeature(const PeripheralFeature feature)
m_callbacks.CBCecCommand = &CecCommand;
m_callbacks.CBCecConfigurationChanged = &CecConfiguration;
m_callbacks.CBCecAlert = &CecAlert;
+ m_callbacks.CBCecSourceActivated = &CecSourceActivated;
m_configuration.callbackParam = this;
m_configuration.callbacks = &m_callbacks;
@@ -1126,6 +1127,13 @@ void CPeripheralCecAdapter::OnSettingChanged(const CStdString &strChangedSetting
}
}
+void CPeripheralCecAdapter::CecSourceActivated(void *param, const CEC::cec_logical_address address, const uint8_t activated)
+{
+ // wake up the screensaver, so the user doesn't switch to a black screen
+ if (activated == 1)
+ g_application.WakeUpScreenSaverAndDPMS();
+}
+
int CPeripheralCecAdapter::CecLogMessage(void *cbParam, const cec_log_message &message)
{
CPeripheralCecAdapter *adapter = (CPeripheralCecAdapter *)cbParam;
diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.h b/xbmc/peripherals/devices/PeripheralCecAdapter.h
index 152e50b3d4..b8ec1f2b7b 100644
--- a/xbmc/peripherals/devices/PeripheralCecAdapter.h
+++ b/xbmc/peripherals/devices/PeripheralCecAdapter.h
@@ -123,6 +123,7 @@ namespace PERIPHERALS
static int CecCommand(void *cbParam, const CEC::cec_command &command);
static int CecConfiguration(void *cbParam, const CEC::libcec_configuration &config);
static int CecAlert(void *cbParam, const CEC::libcec_alert alert, const CEC::libcec_parameter &data);
+ static void CecSourceActivated(void *param, const CEC::cec_logical_address address, const uint8_t activated);
bool IsRunning(void) const;
void ReopenConnection(void);