Skip to content

Commit

Permalink
[cec] Add settings for configuring button repeats
Browse files Browse the repository at this point in the history
  • Loading branch information
popcornmix committed Feb 9, 2018
1 parent db9a0b4 commit 3ad773b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
15 changes: 15 additions & 0 deletions addons/resource.language.en_gb/resources/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -21542,3 +21542,18 @@ msgstr ""
msgctxt "#39109"
msgid "Select Program"
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 ""
4 changes: 3 additions & 1 deletion system/peripherals.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
11 changes: 11 additions & 0 deletions xbmc/peripherals/devices/PeripheralCecAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,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;
Expand Down Expand Up @@ -1398,6 +1407,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"))
{
Expand Down

0 comments on commit 3ad773b

Please sign in to comment.