Permalink
Browse files

[AE] Added back the OSTAS setting and renamed to the more correct "St…

…ereo upmix"
  • Loading branch information...
1 parent 777f93d commit 9ce382d213c50a6cc6181930768ca31385cdcf8c @gnif gnif committed Apr 14, 2012
@@ -220,7 +220,7 @@
<string id="249">Music</string>
<string id="250">Visualization</string>
<string id="251">Select destination directory</string>
- <string id="252">Output stereo to all speakers</string>
+ <string id="252">Enable stereo upmix</string>
<string id="253">Number of channels</string>
<string id="254">- DTS capable receiver</string>
<string id="255">CDDB</string>
@@ -179,7 +179,7 @@ bool CSoftAE::OpenSink()
AEAudioFormat newFormat;
newFormat.m_dataFormat = AE_FMT_FLOAT;
newFormat.m_sampleRate = 44100;
- newFormat.m_channelLayout = AE_CH_LAYOUT_2_0;
+ newFormat.m_channelLayout = m_stereoUpmix ? m_stdChLayout : AE_CH_LAYOUT_2_0;
CSingleLock streamLock(m_streamLock);
CSoftAEStream *masterStream = GetMasterStream();
@@ -199,7 +199,11 @@ bool CSoftAE::OpenSink()
else
{
if (!m_transcode)
- newFormat.m_channelLayout.ResolveChannels(m_stdChLayout);
+ {
+ /* only resolve the channels if we are not going to upmix */
+ if (!m_stereoUpmix)
+ newFormat.m_channelLayout.ResolveChannels(m_stdChLayout);
+ }
else
{
if (masterStream->m_initChannelLayout == AE_CH_LAYOUT_2_0)
@@ -446,7 +450,8 @@ void CSoftAE::OnSettingsChange(std::string setting)
setting == "audiooutput.dtspassthrough" ||
setting == "audiooutput.channellayout" ||
setting == "audiooutput.useexclusivemode" ||
- setting == "audiooutput.multichannellpcm")
+ setting == "audiooutput.multichannellpcm" ||
+ setting == "audiooutput.stereoupmix")
{
m_reOpen = true;
}
@@ -458,6 +463,10 @@ void CSoftAE::LoadSettings()
if (m_audiophile)
CLog::Log(LOGINFO, "CSoftAE::LoadSettings - Audiophile switch enabled");
+ m_stereoUpmix = g_guiSettings.GetBool("audiooutput.stereoupmix");
+ if (m_stereoUpmix)
+ CLog::Log(LOGINFO, "CSoftAE::LoadSettings - Stereo upmix is enabled");
+
/* load the configuration */
m_stdChLayout = AE_CH_LAYOUT_2_0;
switch(g_guiSettings.GetInt("audiooutput.channellayout"))
@@ -126,6 +126,7 @@ class CSoftAE : public IThreadedAE
std::string m_device;
std::string m_passthroughDevice;
bool m_audiophile;
+ bool m_stereoUpmix;
/* internal vars */
bool m_running, m_reOpen, m_reOpened;
@@ -627,10 +627,8 @@ void CAESinkALSA::GenSoundLabel(AEDeviceList& devices, std::string sink, std::st
devices.push_back(AEDevice(readableCard + " " + sink, "alsa:" + deviceString));
}
-void CAESinkALSA::EnumerateDevicesEx()
+void CAESinkALSA::EnumerateDevicesEx(AEDeviceInfoList &list)
{
- AEDeviceInfoList list;
-
snd_ctl_t *ctlhandle;
snd_pcm_t *pcmhandle;
@@ -50,7 +50,7 @@ class CAESinkALSA : public IAESink
virtual void Drain ();
static void EnumerateDevices(AEDeviceList &devices, bool passthrough);
- static void EnumerateDevicesEx();
+ static void EnumerateDevicesEx(AEDeviceInfoList &list);
private:
CAEChannelInfo GetChannelLayout(AEAudioFormat format);
std::string GetDeviceUse (const AEAudioFormat format, std::string device, bool passthrough);
@@ -132,22 +132,21 @@ CAEChannelInfo& CAEChannelInfo::operator=(const enum AEChannel* rhs)
if(rhs == NULL)
return *this;
- /* count the channels */
- m_channelCount = 0;
while(m_channelCount < AE_CH_MAX && rhs[m_channelCount] != AE_CH_NULL)
{
m_channels[m_channelCount] = rhs[m_channelCount];
++m_channelCount;
}
- ASSERT(m_channelCount < AE_CH_MAX);
+ /* the last entry should be NULL, if not we were passed a non null terminated list */
+ ASSERT(rhs[m_channelCount] == AE_CH_NULL);
return *this;
}
CAEChannelInfo& CAEChannelInfo::operator=(const enum AEStdChLayout rhs)
{
- ASSERT(rhs >= 0 && rhs < AE_CH_LAYOUT_MAX);
+ ASSERT(rhs > AE_CH_LAYOUT_INVALID && rhs < AE_CH_LAYOUT_MAX);
static enum AEChannel layouts[AE_CH_LAYOUT_MAX][9] = {
{AE_CH_FC, AE_CH_NULL},
@@ -450,6 +450,7 @@ void CGUISettings::Initialize()
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(__APPLE__) && defined(__arm__))
CSettingsCategory* aocat = g_sysinfo.IsAppleTV2() ? ao : NULL;

0 comments on commit 9ce382d

Please sign in to comment.