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:
parent
f4f77af071
commit
da6bed19b2
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user