mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 08:22:09 +02:00
Merge pull request #16327 from kencooke/audio-device-sleep-wake
DEV-1901: No audio in Interface when restoring from sleep
This commit is contained in:
commit
8325ee2c8e
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