Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[AE] settings: Add new settings for AE and reorganise code

  • Loading branch information...
commit 5eda08f67eb70cd020744ed31d12dcb2b96add9e 1 parent f35d6d2
Geoffrey McRae gnif authored Jonathan Marshall committed
37 language/English/strings.po
View
@@ -1278,7 +1278,17 @@ msgstr ""
msgid "Boost volume level on downmix"
msgstr ""
-#empty strings from id 347 to 349
+#: id:347
+msgid "- DTS-HD capable receiver"
+msgstr ""
+
+#: id:348
+msgid "- Multichannel LPCM capable receiver"
+msgstr ""
+
+#: id:349
+msgid "- TrueHD capable receiver"
+msgstr ""
#: id:350
msgctxt "Auto context with id 350"
@@ -1520,7 +1530,7 @@ msgstr ""
msgid "Humidity"
msgstr ""
-#empty strings from id 407 to 408
+#empty strings from 407 to 408
#: id:409
msgid "Defaults"
@@ -9343,8 +9353,27 @@ msgstr ""
msgid "7.1"
msgstr ""
-#34112-34200 reserved for future use
-#empty strings from id 34111 to 34200
+#34111-34119 reserved for future use
+#empty strings from id 34111 to 34119
+
+#: id:34120
+msgid "Play GUI sounds"
+msgstr ""
+
+#: id:34121
+msgid "Only when playback stopped"
+msgstr ""
+
+#: id:34122
+msgid "Always"
+msgstr ""
+
+#: id:34123
+msgid "Never"
+msgstr ""
+
+#34124-34200 reserved for future use
+#empty strings from id 34124 to 34200
#: id:34201
msgid "Can't find a next item to play"
4 language/English/strings.xml
View
@@ -309,6 +309,9 @@
<string id="344">Actors</string>
<string id="345">Year</string>
<string id="346">Boost volume level on downmix</string>
+ <string id="347">Use exclusive mode</string>
+ <string id="348">- Multichannel LPCM capable receiver</string>
+ <string id="349">- TrueHD capable receiver</string>
<string id="350">Programs</string>
<string id="351">Off</string>
<string id="352">Dim</string>
@@ -366,6 +369,7 @@
<string id="404">Wind</string>
<string id="405">Dew point</string>
<string id="406">Humidity</string>
+ <string id="407">- DTS-HD capable receiver</string>
<string id="409">Defaults</string>
<string id="410">Accessing weather service</string>
60 xbmc/settings/GUISettings.cpp
View
@@ -38,13 +38,17 @@
#include "windowing/WindowingFactory.h"
#include "powermanagement/PowerManager.h"
#include "cores/dvdplayer/DVDCodecs/Video/CrystalHD.h"
-#include "utils/PCMRemap.h"
+#include "cores/AudioEngine/AEFactory.h"
+#include "cores/AudioEngine/AEAudioFormat.h"
#include "guilib/GUIFont.h" // for FONT_STYLE_* definitions
+#if defined(TARGET_DARWIN_OSX)
+ #include "CoreAudioAEHALOSX.h"
+#endif
#include "guilib/GUIFontManager.h"
#include "utils/Weather.h"
#include "LangInfo.h"
#include "utils/XMLUtils.h"
-#if defined(__APPLE__)
+#if defined(TARGET_DARWIN)
#include "osx/DarwinUtils.h"
#endif
@@ -446,27 +450,47 @@ void CGUISettings::Initialize()
AddInt(ao, "audiooutput.mode", 337, AUDIO_ANALOG, audiomode, SPIN_CONTROL_TEXT);
map<int,int> channelLayout;
- for(int layout = 0; layout < PCM_MAX_LAYOUT; ++layout)
- channelLayout.insert(make_pair(34101+layout, layout));
- AddInt(ao, "audiooutput.channellayout", 34100, PCM_LAYOUT_2_0, channelLayout, SPIN_CONTROL_TEXT);
+ for(int layout = AE_CH_LAYOUT_2_0; layout < AE_CH_LAYOUT_MAX; ++layout)
+ channelLayout.insert(make_pair(34100+layout, layout));
+ AddInt(ao, "audiooutput.channellayout", 34100, AE_CH_LAYOUT_2_0, channelLayout, SPIN_CONTROL_TEXT);
AddBool(ao, "audiooutput.dontnormalizelevels", 346, true);
+ AddBool(ao, "audiooutput.stereoupmix", 252, false);
+
+#if defined(TARGET_DARWIN_IOS)
+ CSettingsCategory* aocat = g_sysinfo.IsAppleTV2() ? ao : NULL;
+#else
+ CSettingsCategory* aocat = ao;
+#endif
- AddBool(ao, "audiooutput.ac3passthrough", 364, true);
- AddBool(ao, "audiooutput.dtspassthrough", 254, true);
- AddBool(NULL, "audiooutput.passthroughaac", 299, false);
+ AddBool(aocat, "audiooutput.ac3passthrough" , 364, true);
+ AddBool(aocat, "audiooutput.dtspassthrough" , 254, true);
-#ifdef __APPLE__
- AddString(ao, "audiooutput.audiodevice", 545, "Default", SPIN_CONTROL_TEXT);
-#elif defined(_LINUX)
+
+#if !defined(TARGET_DARWIN)
+ AddBool(aocat, "audiooutput.passthroughaac" , 299, false);
+#endif
+#if !defined(TARGET_DARWIN_IOS)
+ AddBool(aocat, "audiooutput.multichannellpcm" , 348, true );
+#endif
+#if !defined(TARGET_DARWIN)
+ AddBool(aocat, "audiooutput.truehdpassthrough", 349, true );
+ AddBool(aocat, "audiooutput.dtshdpassthrough" , 407, true );
+#endif
+
+#if defined(TARGET_DARWIN)
+ #if defined(TARGET_DARWIN_IOS)
+ CStdString defaultDeviceName = "Default";
+ #else
+ CStdString defaultDeviceName;
+ CCoreAudioHardware::GetOutputDeviceName(defaultDeviceName);
+ #endif
+ AddString(ao, "audiooutput.audiodevice", 545, defaultDeviceName.c_str(), SPIN_CONTROL_TEXT);
+ AddString(NULL, "audiooutput.passthroughdevice", 546, defaultDeviceName.c_str(), SPIN_CONTROL_TEXT);
+#else
AddSeparator(ao, "audiooutput.sep1");
- AddString(ao, "audiooutput.audiodevice", 545, "default", SPIN_CONTROL_TEXT);
- AddString(ao, "audiooutput.customdevice", 1300, "", EDIT_CONTROL_INPUT);
+ AddString (ao, "audiooutput.audiodevice" , 545, CStdString(CAEFactory::AE->GetDefaultDevice(false)), SPIN_CONTROL_TEXT);
+ AddString (ao, "audiooutput.passthroughdevice", 546, CStdString(CAEFactory::AE->GetDefaultDevice(true )), SPIN_CONTROL_TEXT);
AddSeparator(ao, "audiooutput.sep2");
- AddString(ao, "audiooutput.passthroughdevice", 546, "iec958", SPIN_CONTROL_TEXT);
- AddString(ao, "audiooutput.custompassthrough", 1301, "", EDIT_CONTROL_INPUT);
- AddSeparator(ao, "audiooutput.sep3");
-#elif defined(_WIN32)
- AddString(ao, "audiooutput.audiodevice", 545, "Default", SPIN_CONTROL_TEXT);
#endif
map<int,int> guimode;
167 xbmc/settings/GUIWindowSettingsCategory.cpp
View
@@ -41,7 +41,6 @@
#include "PlayListPlayer.h"
#include "addons/Skin.h"
#include "guilib/GUIAudioManager.h"
-#include "guilib/AudioContext.h"
#include "network/libscrobbler/lastfmscrobbler.h"
#include "network/libscrobbler/librefmscrobbler.h"
#include "GUIPassword.h"
@@ -64,25 +63,17 @@
#include "guilib/GUIControlGroupList.h"
#include "guilib/GUIWindowManager.h"
#include "guilib/GUIFontManager.h"
+#include "cores/AudioEngine/AEFactory.h"
#ifdef _LINUX
#include "LinuxTimezone.h"
#include <dlfcn.h>
-#include "cores/AudioRenderers/AudioRendererFactory.h"
-#if defined(USE_ALSA)
-#include "cores/AudioRenderers/ALSADirectSound.h"
-#endif
#ifdef HAS_HAL
#include "HALManager.h"
#endif
#endif
-#if defined(__APPLE__)
-#if defined(__arm__)
-#include "IOSCoreAudio.h"
-#else
-#include "CoreAudio.h"
+#if defined(TARGET_DARWIN_OSX)
#include "XBMCHelper.h"
#endif
-#endif
#include "network/GUIDialogAccessPoints.h"
#include "filesystem/Directory.h"
@@ -96,7 +87,6 @@
#ifdef _WIN32
#include "WIN32Util.h"
-#include "cores/AudioRenderers/AudioRendererFactory.h"
#endif
#include <map>
#include "Settings.h"
@@ -106,6 +96,7 @@
#include "LangInfo.h"
#include "utils/StringUtils.h"
#include "utils/URIUtils.h"
+#include "utils/SystemInfo.h"
#include "windowing/WindowingFactory.h"
#if defined(HAVE_LIBCRYSTALHD)
@@ -714,6 +705,24 @@ void CGUIWindowSettingsCategory::UpdateSettings()
CGUIControl *pControl = (CGUIControl *)GetControl(pSettingControl->GetID());
if (pControl) pControl->SetEnabled(AUDIO_IS_BITSTREAM(g_guiSettings.GetInt("audiooutput.mode")));
}
+ else if (
+ strSetting.Equals("audiooutput.multichannellpcm" ) ||
+ strSetting.Equals("audiooutput.truehdpassthrough") ||
+ strSetting.Equals("audiooutput.dtshdpassthrough" ))
+ {
+ CGUIControl *pControl = (CGUIControl *)GetControl(pSettingControl->GetID());
+ if (pControl)
+ {
+ if (strSetting.Equals("audiooutput.dtshdpassthrough") && !g_guiSettings.GetBool("audiooutput.dtspassthrough"))
+ pControl->SetEnabled(false);
+ else
+ pControl->SetEnabled(g_guiSettings.GetInt("audiooutput.mode") == AUDIO_HDMI);
+ }
+ }
+ else if (strSetting.Equals("audiooutput.guisoundmode"))
+ {
+ CAEFactory::AE->SetSoundMode(g_guiSettings.GetInt("audiooutput.guisoundmode"));
+ }
else if (strSetting.Equals("musicplayer.crossfade"))
{
CGUIControl *pControl = (CGUIControl *)GetControl(pSettingControl->GetID());
@@ -947,25 +956,6 @@ void CGUIWindowSettingsCategory::UpdateSettings()
if (pControl)
pControl->SetEnabled(g_peripherals.GetNumberOfPeripherals() > 0);
}
-#if defined(_LINUX) && !defined(__APPLE__)
- else if (strSetting.Equals("audiooutput.custompassthrough"))
- {
- CGUIControl *pControl = (CGUIControl *)GetControl(pSettingControl->GetID());
- if (AUDIO_IS_BITSTREAM(g_guiSettings.GetInt("audiooutput.mode")))
- {
- if (pControl) pControl->SetEnabled(g_guiSettings.GetString("audiooutput.passthroughdevice").Equals("custom"));
- }
- else
- {
- if (pControl) pControl->SetEnabled(false);
- }
- }
- else if (strSetting.Equals("audiooutput.customdevice"))
- {
- CGUIControl *pControl = (CGUIControl *)GetControl(pSettingControl->GetID());
- if (pControl) pControl->SetEnabled(g_guiSettings.GetString("audiooutput.audiodevice").Equals("custom"));
- }
-#endif
}
}
@@ -1216,26 +1206,6 @@ void CGUIWindowSettingsCategory::OnSettingChanged(CBaseSettingControl *pSettingC
g_guiSettings.m_replayGain.iNoGainPreAmp = g_guiSettings.GetInt("musicplayer.replaygainnogainpreamp");
g_guiSettings.m_replayGain.bAvoidClipping = g_guiSettings.GetBool("musicplayer.replaygainavoidclipping");
}
- else if (strSetting.Equals("audiooutput.audiodevice"))
- {
- CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(pSettingControl->GetID());
-#if !defined(__APPLE__)
- g_guiSettings.SetString("audiooutput.audiodevice", m_AnalogAudioSinkMap[pControl->GetCurrentLabel()]);
-#else
- g_guiSettings.SetString("audiooutput.audiodevice", pControl->GetCurrentLabel());
-#endif
- }
-#if defined(_LINUX)
- else if (strSetting.Equals("audiooutput.passthroughdevice"))
- {
- CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(pSettingControl->GetID());
-#if defined(_LINUX) && !defined(__APPLE__)
- g_guiSettings.SetString("audiooutput.passthroughdevice", m_DigitalAudioSinkMap[pControl->GetCurrentLabel()]);
-#elif !defined(__arm__)
- g_guiSettings.SetString("audiooutput.passthroughdevice", pControl->GetCurrentLabel());
-#endif
- }
-#endif
#ifdef HAS_LCD
else if (strSetting.Equals("videoscreen.haslcd"))
{
@@ -1868,6 +1838,27 @@ void CGUIWindowSettingsCategory::OnSettingChanged(CBaseSettingControl *pSettingC
{
CUtil::DeleteVideoDatabaseDirectoryCache();
}
+ else if (strSetting.compare(0, 12, "audiooutput.") == 0)
+ {
+ if (strSetting.Equals("audiooutput.audiodevice"))
+ {
+ CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(pSettingControl->GetID());
+#if defined(TARGET_DARWIN)
+ g_guiSettings.SetString("audiooutput.audiodevice", pControl->GetCurrentLabel());
+#else
+ g_guiSettings.SetString("audiooutput.audiodevice", m_AnalogAudioSinkMap[pControl->GetCurrentLabel()]);
+#endif
+ }
+#if !defined(TARGET_DARWIN)
+ else if (strSetting.Equals("audiooutput.passthroughdevice"))
+ {
+ CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(pSettingControl->GetID());
+ g_guiSettings.SetString("audiooutput.passthroughdevice", m_DigitalAudioSinkMap[pControl->GetCurrentLabel()]);
+ }
+#endif
+
+ CAEFactory::AE->OnSettingsChange(strSetting);
+ }
UpdateSettings();
}
@@ -2698,62 +2689,6 @@ void CGUIWindowSettingsCategory::FillInNetworkInterfaces(CSetting *pSetting, flo
void CGUIWindowSettingsCategory::FillInAudioDevices(CSetting* pSetting, bool Passthrough)
{
-#if defined(__APPLE__)
- #if defined(__arm__)
- if (Passthrough)
- return;
- CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(GetSetting(pSetting->GetSetting())->GetID());
- pControl->Clear();
-
- IOSCoreAudioDeviceList deviceList;
- CIOSCoreAudioHardware::GetOutputDevices(&deviceList);
-
- // This will cause FindAudioDevice to fall back to the system default as configured in 'System Preferences'
- if (CIOSCoreAudioHardware::GetDefaultOutputDevice())
- pControl->AddLabel("Default Output Device", 0);
-
- int activeDevice = 0;
- CStdString deviceName;
- for (int i = pControl->GetMaximum(); !deviceList.empty(); i++)
- {
- CIOSCoreAudioDevice device(deviceList.front());
- pControl->AddLabel(device.GetName(deviceName), i);
-
- // Tag this one
- if (g_guiSettings.GetString("audiooutput.audiodevice").Equals(deviceName))
- activeDevice = i;
-
- deviceList.pop_front();
- }
- pControl->SetValue(activeDevice);
- #else
- if (Passthrough)
- return;
- CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(GetSetting(pSetting->GetSetting())->GetID());
- pControl->Clear();
-
- CoreAudioDeviceList deviceList;
- CCoreAudioHardware::GetOutputDevices(&deviceList);
-
- // This will cause FindAudioDevice to fall back to the system default as configured in 'System Preferences'
- if (CCoreAudioHardware::GetDefaultOutputDevice())
- pControl->AddLabel("Default Output Device", 0);
-
- int activeDevice = 0;
- CStdString deviceName;
- for (int i = pControl->GetMaximum(); !deviceList.empty(); i++)
- {
- CCoreAudioDevice device(deviceList.front());
- pControl->AddLabel(device.GetName(deviceName), i);
-
- if (g_guiSettings.GetString("audiooutput.audiodevice").Equals(deviceName))
- activeDevice = i; // Tag this one
-
- deviceList.pop_front();
- }
- pControl->SetValue(activeDevice);
- #endif
-#else
CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(GetSetting(pSetting->GetSetting())->GetID());
pControl->Clear();
@@ -2763,20 +2698,19 @@ void CGUIWindowSettingsCategory::FillInAudioDevices(CSetting* pSetting, bool Pas
{
m_DigitalAudioSinkMap.clear();
m_DigitalAudioSinkMap["Error - no devices found"] = "null:";
- m_DigitalAudioSinkMap[g_localizeStrings.Get(636)] = "custom";
}
else
{
m_AnalogAudioSinkMap.clear();
m_AnalogAudioSinkMap["Error - no devices found"] = "null:";
- m_AnalogAudioSinkMap[g_localizeStrings.Get(636)] = "custom";
}
int numberSinks = 0;
int selectedValue = -1;
- AudioSinkList sinkList;
- CAudioRendererFactory::EnumerateAudioSinks(sinkList, Passthrough);
+ AEDeviceList sinkList;
+ CAEFactory::AE->EnumerateOutputDevices(sinkList, Passthrough);
+#if !defined(TARGET_DARWIN)
if (sinkList.size()==0)
{
pControl->AddLabel("Error - no devices found", 0);
@@ -2785,7 +2719,8 @@ void CGUIWindowSettingsCategory::FillInAudioDevices(CSetting* pSetting, bool Pas
}
else
{
- AudioSinkList::const_iterator iter = sinkList.begin();
+#endif
+ AEDeviceList::const_iterator iter = sinkList.begin();
for (int i=0; iter != sinkList.end(); iter++)
{
CStdString label = (*iter).first;
@@ -2804,13 +2739,8 @@ void CGUIWindowSettingsCategory::FillInAudioDevices(CSetting* pSetting, bool Pas
}
numberSinks = sinkList.size();
+#if !defined(TARGET_DARWIN)
}
-
-#ifdef _LINUX
- if (currentDevice.Equals("custom"))
- selectedValue = numberSinks;
-
- pControl->AddLabel(g_localizeStrings.Get(636), numberSinks++);
#endif
if (selectedValue < 0)
@@ -2821,7 +2751,6 @@ void CGUIWindowSettingsCategory::FillInAudioDevices(CSetting* pSetting, bool Pas
}
else
pControl->SetValue(selectedValue);
-#endif
}
void CGUIWindowSettingsCategory::NetworkInterfaceChanged(void)
Please sign in to comment.
Something went wrong with that request. Please try again.