summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Yves Avenard <jyavenard@mythtv.org>2010-11-14 11:38:02 (GMT)
committer Jean-Yves Avenard <jyavenard@mythtv.org>2010-11-14 11:38:02 (GMT)
commit472678b60283a5453bac85b7a6d211cffb69a26f (patch)
treed04739d5a7fd588bd987ec01d725d013241c78ce
parent215cdb2f905069e4d764dcde941ccf85e1c23903 (diff)
Change the behaviour of overriding the digital passthrough device. If set, we assume AC3 and DTS passthrough option are always available no matter what the main audio device reports. This allow to set-up a different audio device between plain stereo/lpcm and digital passthrough
git-svn-id: http://svn.mythtv.org/svn/trunk@27216 7dbf422c-18fa-0310-86e9-fd20926502f2
-rw-r--r--mythtv/libs/libmyth/audiooutputsettings.cpp7
-rw-r--r--mythtv/programs/mythfrontend/globalsettings.cpp49
-rw-r--r--mythtv/programs/mythfrontend/globalsettings.h2
3 files changed, 41 insertions, 17 deletions
diff --git a/mythtv/libs/libmyth/audiooutputsettings.cpp b/mythtv/libs/libmyth/audiooutputsettings.cpp
index bcfdd04..42235e9 100644
--- a/mythtv/libs/libmyth/audiooutputsettings.cpp
+++ b/mythtv/libs/libmyth/audiooutputsettings.cpp
@@ -299,9 +299,12 @@ AudioOutputSettings* AudioOutputSettings::GetUsers(bool newcopy)
int cur_channels = gCoreContext->GetNumSetting("MaxChannels", 2);
int max_channels = aosettings->BestSupportedChannels();
- bool bAC3 = aosettings->m_AC3 &&
+ bool bForceDigital = gCoreContext->GetNumSetting("AdvancedAudioSettings", false) &&
+ gCoreContext->GetNumSetting("PassThruDeviceOverride", false);
+
+ bool bAC3 = (aosettings->m_AC3 || bForceDigital) &&
gCoreContext->GetNumSetting("AC3PassThru", false);
- bool bDTS = aosettings->m_DTS &&
+ bool bDTS = (aosettings->m_DTS || bForceDigital) &&
gCoreContext->GetNumSetting("DTSPassThru", false);
bool bLPCM = aosettings->m_LPCM &&
(aosettings->m_passthrough == -1 ||
diff --git a/mythtv/programs/mythfrontend/globalsettings.cpp b/mythtv/programs/mythfrontend/globalsettings.cpp
index f6fc628..278b19f 100644
--- a/mythtv/programs/mythfrontend/globalsettings.cpp
+++ b/mythtv/programs/mythfrontend/globalsettings.cpp
@@ -118,7 +118,8 @@ AudioConfigSettings::AudioConfigSettings() :
VerticalConfigurationGroup(false, true, false, false),
m_OutputDevice(NULL), m_MaxAudioChannels(NULL),
m_AudioUpmix(NULL), m_AudioUpmixType(NULL),
- m_AC3PassThrough(NULL), m_DTSPassThrough(NULL), m_MPCM(NULL)
+ m_AC3PassThrough(NULL), m_DTSPassThrough(NULL), m_MPCM(NULL),
+ m_AdvancedAudioSettings(NULL), m_PassThroughOverride(NULL)
{
setLabel(QObject::tr("Audio System"));
setUseLabel(false);
@@ -173,22 +174,22 @@ AudioConfigSettings::AudioConfigSettings() :
maingroup->addChild((m_AudioUpmix = AudioUpmix()));
maingroup->addChild((m_AudioUpmixType = AudioUpmixType()));
- Setting *advancedsettings = AdvancedAudioSettings();
- addChild(advancedsettings);
+ m_AdvancedAudioSettings = AdvancedAudioSettings();
+ addChild(m_AdvancedAudioSettings);
ConfigurationGroup *group2 =
new VerticalConfigurationGroup(false);
- TriggeredItem *sub2 = new TriggeredItem(advancedsettings, group2);
+ TriggeredItem *sub2 = new TriggeredItem(m_AdvancedAudioSettings, group2);
addChild(sub2);
ConfigurationGroup *settings3 =
new HorizontalConfigurationGroup(false, false);
- Setting *passthroughoverride = PassThroughOverride();
+ m_PassThroughOverride = PassThroughOverride();
TriggeredItem *sub3 =
- new TriggeredItem(passthroughoverride, PassThroughOutputDevice());
- settings3->addChild(passthroughoverride);
+ new TriggeredItem(m_PassThroughOverride, PassThroughOutputDevice());
+ settings3->addChild(m_PassThroughOverride);
settings3->addChild(sub3);
ConfigurationGroup *settings4 =
@@ -218,6 +219,10 @@ AudioConfigSettings::AudioConfigSettings() :
this, SLOT(UpdateCapabilities(const QString&)));
connect(m_MPCM, SIGNAL(valueChanged(const QString&)),
this, SLOT(UpdateCapabilities(const QString&)));
+ connect(m_PassThroughOverride, SIGNAL(valueChanged(const QString&)),
+ this, SLOT(UpdateCapabilities(const QString&)));
+ connect(m_AdvancedAudioSettings, SIGNAL(valueChanged(const QString&)),
+ this, SLOT(UpdateCapabilities(const QString&)));
}
void AudioConfigSettings::AudioRescan()
@@ -271,19 +276,23 @@ void AudioConfigSettings::UpdateVisibility(const QString &device)
void AudioConfigSettings::UpdateCapabilities(const QString &device)
{
- int max_speakers = 8;
+ int max_speakers = 8;
bool invalid = false;
int passthrough = 0;
AudioOutputSettings settings;
// Test if everything is set yet
if (!m_OutputDevice || !m_MaxAudioChannels ||
- !m_AC3PassThrough || !m_DTSPassThrough || !m_MPCM)
+ !m_AC3PassThrough || !m_DTSPassThrough || !m_MPCM ||
+ !m_AdvancedAudioSettings || !m_PassThroughOverride)
return;
if (!slotlock.tryLock()) // Doing a rescan of channels
return;
+ bool bForceDigital = (m_AdvancedAudioSettings->boolValue() &&
+ m_PassThroughOverride->boolValue());
+
QString out = m_OutputDevice->getValue();
if (!audiodevs.contains(out))
{
@@ -296,8 +305,10 @@ void AudioConfigSettings::UpdateCapabilities(const QString &device)
max_speakers = settings.BestSupportedChannels();
- bool bAC3 = settings.canAC3() && m_AC3PassThrough->boolValue();
- bool bDTS = settings.canDTS() && m_DTSPassThrough->boolValue();
+ bool bAC3 = (settings.canAC3() || bForceDigital) &&
+ m_AC3PassThrough->boolValue();
+ bool bDTS = (settings.canDTS() || bForceDigital) &&
+ m_DTSPassThrough->boolValue();
bool bLPCM = settings.canPassthrough() == -1 ||
(settings.canLPCM() && m_MPCM->boolValue());
@@ -308,15 +319,22 @@ void AudioConfigSettings::UpdateCapabilities(const QString &device)
passthrough = settings.canPassthrough();
}
- m_triggerAC3->setValue(invalid || settings.canAC3());
- m_triggerDTS->setValue(invalid || settings.canDTS());
+ 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:
- m_MPCM->setLabel(QObject::tr("No digital passthrough"));
+ if (bForceDigital)
+ {
+ m_MPCM->setLabel(QString());
+ }
+ else
+ {
+ m_MPCM->setLabel(QObject::tr("No digital passthrough"));
+ }
break;
case 1:
m_MPCM->setLabel(QObject::tr("LPCM"));
@@ -348,7 +366,8 @@ void AudioConfigSettings::UpdateCapabilities(const QString &device)
m_MaxAudioChannels->resetMaxCount(3);
for (int i = 1; i <= max_speakers; i++)
{
- if (invalid || settings.IsSupportedChannels(i))
+ if (invalid || settings.IsSupportedChannels(i) ||
+ (bForceDigital && (i == 2 || i == 6)))
{
QString txt;
diff --git a/mythtv/programs/mythfrontend/globalsettings.h b/mythtv/programs/mythfrontend/globalsettings.h
index b924284..856bf56 100644
--- a/mythtv/programs/mythfrontend/globalsettings.h
+++ b/mythtv/programs/mythfrontend/globalsettings.h
@@ -57,6 +57,8 @@ class AudioConfigSettings : public VerticalConfigurationGroup
HostCheckBox *m_AC3PassThrough;
HostCheckBox *m_DTSPassThrough;
HostCheckBox *m_MPCM;
+ HostCheckBox *m_AdvancedAudioSettings;
+ HostCheckBox *m_PassThroughOverride;
ADCMap audiodevs;
AudioOutput::ADCVect devices;
QMutex slotlock;