1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

enable volume sliders only, if a valid audio device is selected

This commit is contained in:
Nils Fenner 2016-01-17 11:37:05 +01:00 committed by tux3
parent f4f77af071
commit da6bed19b2
No known key found for this signature in database
GPG Key ID: 7E086DD661263264

View File

@ -339,6 +339,7 @@ void AVForm::onInDevChanged(QString deviceDescriptor)
Settings::getInstance().setInDev(deviceDescriptor);
Audio& audio = Audio::getInstance();
audio.reinitInput(deviceDescriptor);
bodyUI->microphoneSlider->setEnabled(audio.isInputReady());
bodyUI->microphoneSlider->setSliderPosition(audio.inputVolume() * 100.f);
}
@ -350,6 +351,7 @@ void AVForm::onOutDevChanged(QString deviceDescriptor)
Settings::getInstance().setOutDev(deviceDescriptor);
Audio& audio = Audio::getInstance();
audio.reinitOutput(deviceDescriptor);
bodyUI->playbackSlider->setEnabled(audio.isOutputReady());
bodyUI->playbackSlider->setSliderPosition(audio.outputVolume() * 100.f);
}