diff options
-rw-r--r-- | addons/resource.language.en_gb/resources/strings.po | 28 | ||||
-rw-r--r-- | system/peripherals.xml | 2 | ||||
-rw-r--r-- | xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 22 |
3 files changed, 43 insertions, 9 deletions
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po index 034987ac90..54caadff4e 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -18615,7 +18615,13 @@ msgctxt "#36012" msgid "Couldn't initialise the CEC adapter. Please check your settings." msgstr "" -#empty strings from id 36013 to 36014 +#. CEC adapter setting to set the type of device that libCEC reports to the TV (Recording, Playback or Tuner Device) +#: system/peripherals.xml +msgctxt "#36013" +msgid "CEC client device mode" +msgstr "" + +#empty strings from id 36014 to 36014 #: system/peripherals.xml msgctxt "#36015" @@ -18813,7 +18819,25 @@ msgctxt "#36050" msgid "On start" msgstr "" -#empty strings from id 36051 to 36097 +#. Item list value of setting with label #36013 "CEC client device mode" +#: system/peripherals.xml +msgctxt "#36051" +msgid "Recording Device" +msgstr "" + +#. Item list value of setting with label #36013 "CEC client device mode" +#: system/peripherals.xml +msgctxt "#36052" +msgid "Playback Device" +msgstr "" + +#. Item list value of setting with label #36013 "CEC client device mode" +#: system/peripherals.xml +msgctxt "#36053" +msgid "Tuner Device" +msgstr "" + +#empty strings from id 36054 to 36097 #. Label of setting "System / Display / Use 10 bit for SDR" #: system/settings/settings.xml diff --git a/system/peripherals.xml b/system/peripherals.xml index 1fbb4bc924..db3d2187ff 100644 --- a/system/peripherals.xml +++ b/system/peripherals.xml @@ -28,12 +28,12 @@ <setting key="tv_vendor" type="int" value="0" configurable="0" /> <setting key="device_name" type="string" value="Kodi" configurable="0" /> - <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="50" max="1000" step="50" value="300" label="36047" order="16" /> <setting key="button_repeat_rate_ms" type="int" min="0" max="250" step="10" value="0" label="36048" order="17" /> <setting key="button_release_delay_ms" type="int" min="0" max="500" step="50" value="0" label="36049" order="18" /> + <setting key="device_type" type="enum" value="36051" label="36013" lvalues="36051|36052|36053" order="19" /> </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 e1274422e9..aba700be7f 100644 --- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp +++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp @@ -50,6 +50,9 @@ using namespace std::chrono_literals; #define LOCALISED_ID_HIBERNATE 13010 #define LOCALISED_ID_QUIT 13009 #define LOCALISED_ID_IGNORE 36028 +#define LOCALISED_ID_RECORDING_DEVICE 36051 +#define LOCALISED_ID_PLAYBACK_DEVICE 36052 +#define LOCALISED_ID_TUNER_DEVICE 36053 #define LOCALISED_ID_NONE 231 @@ -1345,12 +1348,19 @@ void CPeripheralCecAdapter::SetConfigurationFromSettings(void) // set the primary device type m_configuration.deviceTypes.Clear(); - int iDeviceType = GetSettingInt("device_type"); - if (iDeviceType != (int)CEC_DEVICE_TYPE_RECORDING_DEVICE && - iDeviceType != (int)CEC_DEVICE_TYPE_PLAYBACK_DEVICE && - iDeviceType != (int)CEC_DEVICE_TYPE_TUNER) - iDeviceType = (int)CEC_DEVICE_TYPE_RECORDING_DEVICE; - m_configuration.deviceTypes.Add((cec_device_type)iDeviceType); + switch (GetSettingInt("device_type")) + { + case LOCALISED_ID_PLAYBACK_DEVICE: + m_configuration.deviceTypes.Add(CEC_DEVICE_TYPE_PLAYBACK_DEVICE); + break; + case LOCALISED_ID_TUNER_DEVICE: + m_configuration.deviceTypes.Add(CEC_DEVICE_TYPE_TUNER); + break; + case LOCALISED_ID_RECORDING_DEVICE: + default: + m_configuration.deviceTypes.Add(CEC_DEVICE_TYPE_RECORDING_DEVICE); + break; + } // always try to autodetect the address. // when the firmware supports this, it will override the physical address, connected device and |