Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From ae0e1e2e0545137daf868cb6cf86dd4dc72ffa51 Mon Sep 17 00:00:00 2001
- From: popcornmix <popcornmix@gmail.com>
- Date: Mon, 19 Dec 2016 14:21:40 +0000
- Subject: [PATCH] [cec] Drop CEC_DOUBLE_TAP_TIMEOUT_MS_OLD code
- Kodi won't even build with libcec 3, so supporting a libcec 2.2 setting is of no value
- ---
- xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 7 +------
- 1 file changed, 1 insertion(+), 6 deletions(-)
- diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
- index 54dc37e..73872e3 100644
- --- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
- +++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
- @@ -1391,13 +1391,8 @@ void CPeripheralCecAdapter::SetConfigurationFromSettings(void)
- m_configuration.bPowerOffOnStandby = iStandbyAction == LOCALISED_ID_SUSPEND ? 1 : 0;
- m_bShutdownOnStandby = iStandbyAction == LOCALISED_ID_POWEROFF;
- -#if defined(CEC_DOUBLE_TAP_TIMEOUT_MS_OLD)
- - // double tap prevention timeout in ms. libCEC uses 50ms units for this in 2.2.0, so divide by 50
- - m_configuration.iDoubleTapTimeout50Ms = GetSettingInt("double_tap_timeout_ms") / 50;
- -#else
- - // backwards compatibility. will be removed once the next major release of libCEC is out
- + // double tap prevention timeout in ms
- m_configuration.iDoubleTapTimeoutMs = GetSettingInt("double_tap_timeout_ms");
- -#endif
- if (GetSettingBool("pause_playback_on_deactivate"))
- {
- From 621b8ae48c61791ad74a44f57387ad4ac5c5feca Mon Sep 17 00:00:00 2001
- From: popcornmix <popcornmix@gmail.com>
- Date: Mon, 19 Dec 2016 14:21:40 +0000
- Subject: [PATCH] [cec] Add settings for configuring button repeats
- ---
- addons/resource.language.en_gb/resources/strings.po | 15 +++++++++++++++
- system/peripherals.xml | 4 +++-
- xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 11 +++++++++++
- 3 files changed, 29 insertions(+), 1 deletion(-)
- diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po
- index 490ac35..dad7905 100644
- --- a/addons/resource.language.en_gb/resources/strings.po
- +++ b/addons/resource.language.en_gb/resources/strings.po
- @@ -20424,3 +20424,18 @@ msgstr ""
- msgctxt "#39014"
- msgid "Would you also like to remove all related data (e.g. settings) of this add-on?"
- msgstr ""
- +
- +#: system/peripherals.xml
- +msgctxt "#38050"
- +msgid "Remote button press delay before repeating (ms)"
- +msgstr ""
- +
- +#: system/peripherals.xml
- +msgctxt "#38051"
- +msgid "Remote button press repeat rate (ms)"
- +msgstr ""
- +
- +#: system/peripherals.xml
- +msgctxt "#38052"
- +msgid "Remote button press release time (ms)"
- +msgstr ""
- diff --git a/system/peripherals.xml b/system/peripherals.xml
- index d5704b2..02b1a9e 100644
- --- a/system/peripherals.xml
- +++ b/system/peripherals.xml
- @@ -31,7 +31,9 @@
- <setting key="device_type" type="int" value="1" configurable="0" />
- <setting key="wake_devices_advanced" type="string" value="" configurable="0" />
- <setting key="standby_devices_advanced" type="string" value="" configurable="0" />
- - <setting key="double_tap_timeout_ms" type="int" min="0" value="300" configurable="0" />
- + <setting key="double_tap_timeout_ms" type="int" min="50" max="1000" step="50" value="300" label="38050" order="16" />
- + <setting key="button_repeat_rate_ms" type="int" min="0" max="250" step="10" value="0" label="38051" order="17" />
- + <setting key="button_release_delay_ms" type="int" min="0" max="500" step="50" value="0" label="38052" order="18" />
- </peripheral>
- <peripheral vendor_product="2548:1001,2548:1002" bus="usb" name="Pulse-Eight CEC Adapter" mapTo="cec">
- diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
- index 73872e3..92c901e 100644
- --- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
- +++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
- @@ -1296,6 +1296,15 @@ void CPeripheralCecAdapter::SetConfigurationFromLibCEC(const CEC::libcec_configu
- m_configuration.bActivateSource = config.bActivateSource;
- bChanged |= SetSetting("activate_source", m_configuration.bActivateSource == 1);
- + m_configuration.iDoubleTapTimeoutMs = config.iDoubleTapTimeoutMs;
- + bChanged |= SetSetting("double_tap_timeout_ms", (int)m_configuration.iDoubleTapTimeoutMs);
- +
- + m_configuration.iButtonRepeatRateMs = config.iButtonRepeatRateMs;
- + bChanged |= SetSetting("button_repeat_rate_ms", (int)m_configuration.iButtonRepeatRateMs);
- +
- + m_configuration.iButtonReleaseDelayMs = config.iButtonReleaseDelayMs;
- + bChanged |= SetSetting("button_release_delay_ms", (int)m_configuration.iButtonReleaseDelayMs);
- +
- m_configuration.bPowerOffOnStandby = config.bPowerOffOnStandby;
- m_configuration.iFirmwareVersion = config.iFirmwareVersion;
- @@ -1393,6 +1402,8 @@ void CPeripheralCecAdapter::SetConfigurationFromSettings(void)
- // double tap prevention timeout in ms
- m_configuration.iDoubleTapTimeoutMs = GetSettingInt("double_tap_timeout_ms");
- + m_configuration.iButtonRepeatRateMs = GetSettingInt("button_repeat_rate_ms");
- + m_configuration.iButtonReleaseDelayMs = GetSettingInt("button_release_delay_ms");
- if (GetSettingBool("pause_playback_on_deactivate"))
- {
- From 2309e7d697eb3c25bf29c629b51977a308484bfb Mon Sep 17 00:00:00 2001
- From: popcornmix <popcornmix@gmail.com>
- Date: Mon, 19 Dec 2016 14:21:40 +0000
- Subject: [PATCH] [cec] Don't discard buttons when repeat mode is enabled
- ---
- xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
- diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
- index 92c901e..da99db9 100644
- --- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
- +++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
- @@ -803,7 +803,10 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key)
- CLog::Log(LOGDEBUG, "%s - received key %2x duration %d", __FUNCTION__, key.iButton, key.iDuration);
- CSingleLock lock(m_critSection);
- - if (key.iDuration > 0)
- + // avoid the queue getting too long
- + if (m_configuration.iButtonRepeatRateMs && m_buttonQueue.size() > 5)
- + return;
- + if (m_configuration.iButtonRepeatRateMs == 0 && key.iDuration > 0)
- {
- if (m_currentButton.iButton == key.iButton && m_currentButton.iDuration == 0)
- {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement