mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-30 05:51:23 +08:00
Ref T195, audio utility function
This commit is contained in:
@@ -58,5 +58,14 @@ namespace BlackCore
|
|||||||
return new CContextAudioEmpty(runtime); // audio not mandatory
|
return new CContextAudioEmpty(runtime); // audio not mandatory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString IContextAudio::audioRunsWhereInfo() const
|
||||||
|
{
|
||||||
|
if (this->isEmptyObject()) { return "no audio"; }
|
||||||
|
const CIdentifier i = this->audioRunsWhere();
|
||||||
|
return this->isUsingImplementingObject() ?
|
||||||
|
QString("Local audio on '%1', '%2'.").arg(i.getMachineName(), i.getProcessName()) :
|
||||||
|
QString("Remote audio on '%1', '%2'.").arg(i.getMachineName(), i.getProcessName());
|
||||||
|
}
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -137,6 +137,9 @@ namespace BlackCore
|
|||||||
//! Audio runs where
|
//! Audio runs where
|
||||||
virtual BlackMisc::CIdentifier audioRunsWhere() const = 0;
|
virtual BlackMisc::CIdentifier audioRunsWhere() const = 0;
|
||||||
|
|
||||||
|
//! Info string about audio
|
||||||
|
QString audioRunsWhereInfo() const;
|
||||||
|
|
||||||
//! Get current audio device
|
//! Get current audio device
|
||||||
//! \return input and output devices
|
//! \return input and output devices
|
||||||
virtual BlackMisc::Audio::CAudioDeviceInfoList getCurrentAudioDevices() const = 0;
|
virtual BlackMisc::Audio::CAudioDeviceInfoList getCurrentAudioDevices() const = 0;
|
||||||
|
|||||||
@@ -45,22 +45,7 @@ namespace BlackGui
|
|||||||
// audio is optional
|
// audio is optional
|
||||||
const bool audio = this->hasAudio();
|
const bool audio = this->hasAudio();
|
||||||
this->setEnabled(audio);
|
this->setEnabled(audio);
|
||||||
if (!audio)
|
ui->lbl_ExtraInfo->setText(audio ? sGui->getIContextAudio()->audioRunsWhereInfo() : "No audio, cannot change.");
|
||||||
{
|
|
||||||
ui->lbl_ExtraInfo->setText("No audio, cannot change.");
|
|
||||||
}
|
|
||||||
else if (sGui->getIContextAudio()->isUsingImplementingObject())
|
|
||||||
{
|
|
||||||
const CIdentifier i = sGui->getIContextAudio()->audioRunsWhere();
|
|
||||||
const QString info = QString("Local audio on '%1', '%2'.").arg(i.getMachineName(), i.getProcessName());
|
|
||||||
ui->lbl_ExtraInfo->setText(info);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const CIdentifier i = sGui->getIContextAudio()->audioRunsWhere();
|
|
||||||
const QString info = QString("Remote audio on '%1', '%2'.").arg(i.getMachineName(), i.getProcessName());
|
|
||||||
ui->lbl_ExtraInfo->setText(info);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool c = connect(ui->tb_ExpandNotificationSounds, &QToolButton::toggled, this, &CAudioSetupComponent::ps_onToggleNotificationSoundsVisibility);
|
bool c = connect(ui->tb_ExpandNotificationSounds, &QToolButton::toggled, this, &CAudioSetupComponent::ps_onToggleNotificationSoundsVisibility);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
|
|||||||
Reference in New Issue
Block a user