mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
[kodi] Add settings for libcec repeating key
This commit is contained in:
parent
0d7a451214
commit
b3a16af579
@ -0,0 +1,83 @@
|
||||
From 486c88dcd90bbbadb5fb5f69a697872adf12c43a Mon Sep 17 00:00:00 2001
|
||||
From: popcornmix <popcornmix@gmail.com>
|
||||
Date: Tue, 28 Oct 2014 00:19: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 | 16 ++++++++++++++++
|
||||
3 files changed, 34 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po
|
||||
index bedbd87..6db61ed 100644
|
||||
--- a/addons/resource.language.en_gb/resources/strings.po
|
||||
+++ b/addons/resource.language.en_gb/resources/strings.po
|
||||
@@ -16687,3 +16687,18 @@ msgstr ""
|
||||
msgctxt "#38009"
|
||||
msgid "%i dB"
|
||||
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 a67dc2f..6841bda 100644
|
||||
--- a/system/peripherals.xml
|
||||
+++ b/system/peripherals.xml
|
||||
@@ -30,7 +30,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 ea702e5..b5ff693 100644
|
||||
--- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
|
||||
+++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
|
||||
@@ -1267,6 +1267,20 @@ void CPeripheralCecAdapter::SetConfigurationFromLibCEC(const CEC::libcec_configu
|
||||
m_configuration.bSendInactiveSource = config.bSendInactiveSource;
|
||||
bChanged |= SetSetting("send_inactive_source", m_configuration.bSendInactiveSource == 1);
|
||||
|
||||
+#if defined(CEC_DOUBLE_TAP_TIMEOUT_MS_OLD)
|
||||
+ m_configuration.iDoubleTapTimeout50Ms = config.iDoubleTapTimeout50Ms;
|
||||
+ bChanged |= SetSetting("double_tap_timeout_ms", (int)m_configuration.iDoubleTapTimeout50Ms * 50);
|
||||
+#else
|
||||
+ m_configuration.iDoubleTapTimeoutMs = config.iDoubleTapTimeoutMs;
|
||||
+ bChanged |= SetSetting("double_tap_timeout_ms", (int)m_configuration.iDoubleTapTimeoutMs;
|
||||
+#endif
|
||||
+
|
||||
+ 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.iFirmwareVersion = config.iFirmwareVersion;
|
||||
m_configuration.bShutdownOnStandby = config.bShutdownOnStandby;
|
||||
|
||||
@@ -1371,6 +1385,8 @@ void CPeripheralCecAdapter::SetConfigurationFromSettings(void)
|
||||
// backwards compatibility. will be removed once the next major release of libCEC is out
|
||||
m_configuration.iDoubleTapTimeoutMs = GetSettingInt("double_tap_timeout_ms");
|
||||
#endif
|
||||
+ m_configuration.iButtonRepeatRateMs = GetSettingInt("button_repeat_rate_ms");
|
||||
+ m_configuration.iButtonReleaseDelayMs = GetSettingInt("button_release_delay_ms");
|
||||
}
|
||||
|
||||
void CPeripheralCecAdapter::ReadLogicalAddresses(const std::string &strString, cec_logical_addresses &addresses)
|
Loading…
x
Reference in New Issue
Block a user