mirror of
https://github.com/lubosz/overte.git
synced 2025-04-10 04:28:59 +02:00
On waking from sleep/hibernate, restart the audio devices
This commit is contained in:
parent
1316f9b046
commit
ec67b67966
3 changed files with 8 additions and 0 deletions
|
@ -974,6 +974,7 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) {
|
|||
|
||||
QObject::connect(PlatformHelper::instance(), &PlatformHelper::systemWillWake, [] {
|
||||
QMetaObject::invokeMethod(DependencyManager::get<NodeList>().data(), "noteAwakening", Qt::QueuedConnection);
|
||||
QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(), "noteAwakening", Qt::QueuedConnection);
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -1998,6 +1998,12 @@ void AudioClient::outputNotify() {
|
|||
}
|
||||
}
|
||||
|
||||
void AudioClient::noteAwakening() {
|
||||
qCDebug(audioclient) << "Restarting the audio devices.";
|
||||
switchInputToAudioDevice(_inputDeviceInfo);
|
||||
switchOutputToAudioDevice(_outputDeviceInfo);
|
||||
}
|
||||
|
||||
bool AudioClient::switchOutputToAudioDevice(const HifiAudioDeviceInfo outputDeviceInfo, bool isShutdownRequest) {
|
||||
Q_ASSERT_X(QThread::currentThread() == thread(), Q_FUNC_INFO, "Function invoked on wrong thread");
|
||||
|
||||
|
|
|
@ -255,6 +255,7 @@ public slots:
|
|||
void setOutputGain(float gain) { _outputGain = gain; };
|
||||
|
||||
void outputNotify();
|
||||
void noteAwakening();
|
||||
|
||||
void loadSettings();
|
||||
void saveSettings();
|
||||
|
|
Loading…
Reference in a new issue