diff options
author | Lars Op den Kamp <lars@opdenkamp.eu> | 2012-10-09 02:02:38 +0200 |
---|---|---|
committer | Lars Op den Kamp <lars@opdenkamp.eu> | 2012-10-09 02:02:38 +0200 |
commit | 0549eb20abad8d7c05471d5c80785e028d6bed0c (patch) | |
tree | 41b1bad5a6ecc646128e7bc0d364b18ca2d9a108 | |
parent | b45b9a47c13719ad0b57f2776a1789e558d63325 (diff) |
[cec] simplify settings - use an enum instead of logical addresses for the 'connected_device' setting
-rw-r--r-- | language/English/strings.po | 12 | ||||
-rw-r--r-- | system/peripherals.xml | 4 | ||||
-rw-r--r-- | xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 12 |
3 files changed, 21 insertions, 7 deletions
diff --git a/language/English/strings.po b/language/English/strings.po index fb5abf8327..fc23d6bff8 100644 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -10876,7 +10876,7 @@ msgid "Product ID" msgstr "" #empty strings from id 35505 to 35999 - +#: xbmc/peripherals/devices/PeripheralCecAdapter.cpp msgctxt "#36000" msgid "Pulse-Eight CEC adapter" msgstr "" @@ -11023,3 +11023,13 @@ msgstr "" msgctxt "#36036" msgid "On start/stop" msgstr "" + +#: xbmc/peripherals/devices/PeripheralCecAdapter.cpp +msgctxt "#36037" +msgid "TV" +msgstr "" + +msgctxt "#36038" +msgid "Amplifier / AVR device" +msgstr "" + diff --git a/system/peripherals.xml b/system/peripherals.xml index 8abd07faae..26c3494b19 100644 --- a/system/peripherals.xml +++ b/system/peripherals.xml @@ -40,9 +40,9 @@ <setting key="send_inactive_source" type="bool" value="1" label="36025" order="8" /> <setting key="use_tv_menu_language" type="bool" value="1" label="36018" order="9" /> <setting key="pause_playback_on_deactivate" type="bool" value="1" label="36033" order="10" /> - <setting key="physical_address" type="string" label="36021" value="0" order="11" /> + <setting key="connected_device" type="enum" label="36019" value="36037" lvalues="36037|36038" order="11" /> <setting key="cec_hdmi_port" type="int" value="1" min="1" max="15" label="36015" order="12" /> - <setting key="connected_device" type="int" label="36019" value="0" min="0" max="15" step="1" order="13" /> + <setting key="physical_address" type="string" label="36021" value="0" order="13" /> <setting key="port" type="string" value="" label="36022" order="14" /> <setting key="tv_vendor" type="int" value="0" configurable="0" /> diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp index 4d510d4983..6f20476267 100644 --- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp +++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp @@ -51,6 +51,9 @@ using namespace std; #define VOLUME_CHANGE_TIMEOUT 250 #define VOLUME_REFRESH_TIMEOUT 100 +#define LOCALISED_ID_TV 36037 +#define LOCALISED_ID_AVR 36038 + class DllLibCECInterface { public: @@ -1226,7 +1229,7 @@ void CPeripheralCecAdapter::SetConfigurationFromLibCEC(const CEC::libcec_configu // set the connected device m_configuration.baseDevice = config.baseDevice; - bChanged |= SetSetting("connected_device", (int)config.baseDevice); + bChanged |= SetSetting("connected_device", config.baseDevice == CECDEVICE_AUDIOSYSTEM ? LOCALISED_ID_AVR : LOCALISED_ID_TV); // set the HDMI port number m_configuration.iHDMIPort = config.iHDMIPort; @@ -1328,9 +1331,10 @@ void CPeripheralCecAdapter::SetConfigurationFromSettings(void) // set the connected device int iConnectedDevice = GetSettingInt("connected_device"); - if (iConnectedDevice == CECDEVICE_TV || - iConnectedDevice == CECDEVICE_AUDIOSYSTEM) - m_configuration.baseDevice = (cec_logical_address)iConnectedDevice; + if (iConnectedDevice == LOCALISED_ID_AVR) + m_configuration.baseDevice = CECDEVICE_AUDIOSYSTEM; + else if (iConnectedDevice == LOCALISED_ID_TV) + m_configuration.baseDevice = CECDEVICE_TV; // set the HDMI port number int iHDMIPort = GetSettingInt("cec_hdmi_port"); |