Permalink
Browse files

Change how we configure multi-channels LPCM. From reading user questi…

…ons, it is obviously a setting that has been mainly misunderstood and confusing. As such, we now assume that multi-channels LPCM is supported by default and restrict its use to digital audio only. We move the LPCM settings to the advanced configuration and inverse its meaning while clarifying the help text. It now pretty much means that no matter the audio source, multi-channels audio will only be transmitted as AC3 or DTS. The new screen leaves space for having flags for E-AC3, DTS-HD etc. in the future

git-svn-id: http://svn.mythtv.org/svn/trunk@27318 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information...
1 parent 9741adc commit 18fdd004ee8c0e7b2bb4b5099c0f515c2b6637a2 @jyavenard jyavenard committed Nov 22, 2010
@@ -299,16 +299,16 @@ AudioOutputSettings* AudioOutputSettings::GetUsers(bool newcopy)
int cur_channels = gCoreContext->GetNumSetting("MaxChannels", 2);
int max_channels = aosettings->BestSupportedChannels();
- bool bForceDigital = gCoreContext->GetNumSetting("AdvancedAudioSettings", false) &&
+ bool bAdv = gCoreContext->GetNumSetting("AdvancedAudioSettings", false);
+ bool bForceDigital = bAdv &&
gCoreContext->GetNumSetting("PassThruDeviceOverride", false);
-
bool bAC3 = (aosettings->m_AC3 || bForceDigital) &&
gCoreContext->GetNumSetting("AC3PassThru", false);
bool bDTS = (aosettings->m_DTS || bForceDigital) &&
gCoreContext->GetNumSetting("DTSPassThru", false);
bool bLPCM = aosettings->m_LPCM &&
(aosettings->m_passthrough == -1 ||
- gCoreContext->GetNumSetting("MultiChannelPCM", false));
+ (bAdv && !gCoreContext->GetNumSetting("MultiChannelPCM", false)));
if (max_channels > 2 && !bLPCM)
max_channels = 2;
@@ -145,30 +145,22 @@ AudioConfigSettings::AudioConfigSettings() :
devices.append(*adc);
delete adc;
- m_triggerAC3 = new TransCheckBoxSetting();
- m_AC3PassThrough = AC3PassThrough();
- TriggeredItem *subAC3 = new TriggeredItem(m_triggerAC3, m_AC3PassThrough);
-
- m_triggerDTS = new TransCheckBoxSetting();
- m_DTSPassThrough = DTSPassThrough();
- TriggeredItem *subDTS = new TriggeredItem(m_triggerDTS, m_DTSPassThrough);
-
- m_triggerMPCM = new TransCheckBoxSetting();
- m_MPCM = MPCM();
- TriggeredItem *subMPCM = new TriggeredItem(m_triggerMPCM, m_MPCM);
-
ConfigurationGroup *maingroup = new VerticalConfigurationGroup(false,
false);
addChild(maingroup);
+ m_triggerDigital = new TransCheckBoxSetting();
+ m_AC3PassThrough = AC3PassThrough();
+ m_DTSPassThrough = DTSPassThrough();
+
m_cgsettings = new HorizontalConfigurationGroup();
- m_cgsettings->setLabel(QObject::tr("Audio Capabilities"));
+ m_cgsettings->setLabel(QObject::tr("Digital Audio Capabilities"));
+ m_cgsettings->addChild(m_AC3PassThrough);
+ m_cgsettings->addChild(m_DTSPassThrough);
- m_cgsettings->addChild(subMPCM);
- m_cgsettings->addChild(subAC3);
- m_cgsettings->addChild(subDTS);
+ TriggeredItem *sub1 = new TriggeredItem(m_triggerDigital, m_cgsettings);
- maingroup->addChild(m_cgsettings);
+ maingroup->addChild(sub1);
maingroup->addChild((m_MaxAudioChannels = MaxAudioChannels()));
maingroup->addChild((m_AudioUpmix = AudioUpmix()));
@@ -204,9 +196,18 @@ AudioConfigSettings::AudioConfigSettings() :
new HorizontalConfigurationGroup(false, false);
settings5->addChild(Audio48kOverride());
+ m_triggerMPCM = new TransCheckBoxSetting();
+ m_MPCM = MPCM();
+ TriggeredItem *subMPCM = new TriggeredItem(m_triggerMPCM, m_MPCM);
+
+ ConfigurationGroup *settings6 =
+ new HorizontalConfigurationGroup(false, false);
+ settings6->addChild(subMPCM);
+
group2->addChild(settings4);
group2->addChild(settings5);
group2->addChild(settings3);
+ group2->addChild(settings6);
// Set slots
connect(m_MaxAudioChannels, SIGNAL(valueChanged(const QString&)),
@@ -278,13 +279,12 @@ void AudioConfigSettings::UpdateCapabilities(const QString &device)
{
int max_speakers = 8;
bool invalid = false;
- int passthrough = 0;
AudioOutputSettings settings;
// Test if everything is set yet
- if (!m_OutputDevice || !m_MaxAudioChannels ||
+ if (!m_OutputDevice || !m_MaxAudioChannels || !m_AdvancedAudioSettings ||
!m_AC3PassThrough || !m_DTSPassThrough || !m_MPCM ||
- !m_AdvancedAudioSettings || !m_PassThroughOverride)
+ !m_PassThroughOverride)
return;
if (!slotlock.tryLock()) // Doing a rescan of channels
@@ -310,48 +310,19 @@ void AudioConfigSettings::UpdateCapabilities(const QString &device)
bool bDTS = (settings.canDTS() || bForceDigital) &&
m_DTSPassThrough->boolValue();
bool bLPCM = settings.canPassthrough() == -1 ||
- (settings.canLPCM() && m_MPCM->boolValue());
+ (settings.canLPCM() &&
+ m_AdvancedAudioSettings->boolValue() && !m_MPCM->boolValue());
if (max_speakers > 2 && !bLPCM)
max_speakers = 2;
if (max_speakers == 2 && (bAC3 || bDTS))
max_speakers = 6;
- passthrough = settings.canPassthrough();
}
- m_triggerAC3->setValue(invalid || settings.canAC3() || bForceDigital);
- m_triggerDTS->setValue(invalid || settings.canDTS() || bForceDigital);
-
- m_MPCM->setEnabled(invalid || (settings.canLPCM() &&
- settings.canPassthrough() >= 0));
- switch (passthrough)
- {
- case -1:
- if (bForceDigital)
- {
- m_MPCM->setLabel(QString());
- }
- else
- {
- m_MPCM->setLabel(QObject::tr("No digital passthrough"));
- }
- break;
- case 1:
- m_MPCM->setLabel(QObject::tr("LPCM"));
- m_MPCM->setHelpText(QObject::tr(
- "Enable if your amplifier or TV supports "
- "multi-channel LPCM. If unchecked Dolby Digital "
- "support is required for multi-channel audio"));
- break;
- default:
- m_MPCM->setLabel(QObject::tr("Analog or LPCM"));
- m_MPCM->setHelpText(QObject::tr(
- "Enable if analog output or if your amplifier "
- "or TV supports multi-channel LPCM. "
- "If unchecked with digital output, Dolby Digital "
- "support is required for multi-channel audio"));
- break;
- }
+ m_triggerDigital->setValue(invalid || bForceDigital ||
+ settings.canAC3() || settings.canDTS());
+ m_triggerMPCM->setValue(invalid || (settings.canLPCM() &&
+ settings.canPassthrough() >= 0));
int cur_speakers = m_MaxAudioChannels->getValue().toInt();
@@ -450,7 +421,12 @@ HostCheckBox *AudioConfigSettings::DTSPassThrough()
HostCheckBox *AudioConfigSettings::MPCM()
{
HostCheckBox *gc = new HostCheckBox("MultiChannelPCM");
+ gc->setLabel(QObject::tr("Stereo PCM"));
gc->setValue(false);
+ gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder "
+ "only supports 2 channels PCM (typically an old HDMI 1.0 "
+ "device). Multi-channels audio will be re-encoded to AC3 "
+ "when required"));
return gc;
}
@@ -51,8 +51,7 @@ class AudioConfigSettings : public VerticalConfigurationGroup
HostComboBox *m_MaxAudioChannels;
HostCheckBox *m_AudioUpmix;
HostComboBox *m_AudioUpmixType;
- TransCheckBoxSetting *m_triggerAC3;
- TransCheckBoxSetting *m_triggerDTS;
+ TransCheckBoxSetting *m_triggerDigital;
TransCheckBoxSetting *m_triggerMPCM;
HostCheckBox *m_AC3PassThrough;
HostCheckBox *m_DTSPassThrough;

0 comments on commit 18fdd00

Please sign in to comment.