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

cleanup reinitialization of changed audio in/out

This commit is contained in:
Nils Fenner 2015-11-08 21:11:03 +01:00
parent ad6e0a85f5
commit 32bc99fb38
No known key found for this signature in database
GPG Key ID: 9591A163FF9BE04C
3 changed files with 4 additions and 14 deletions

View File

@ -527,12 +527,6 @@ bool Audio::isInputReady()
return alInDev;
}
bool Audio::isInputSubscribed()
{
// No lock, inputSubscriptions is atomic!
return inputSubscriptions;
}
/**
Returns true if the output device is open
*/

View File

@ -81,7 +81,6 @@ public:
}
bool isInputReady();
bool isInputSubscribed();
bool isOutputReady();
static void createSource(ALuint* source);

View File

@ -335,21 +335,18 @@ void AVForm::onInDevChanged(QString deviceDescriptor)
{
if (!bodyUI->inDevCombobox->currentIndex())
deviceDescriptor = "none";
Settings::getInstance().setInDev(deviceDescriptor);
Audio& audio = Audio::getInstance();
if (audio.isInputSubscribed())
audio.openInput(deviceDescriptor);
Settings::getInstance().setInDev(deviceDescriptor);
Audio::getInstance().reinitInput(deviceDescriptor);
}
void AVForm::onOutDevChanged(QString deviceDescriptor)
{
if (!bodyUI->outDevCombobox->currentIndex())
deviceDescriptor = "none";
Settings::getInstance().setOutDev(deviceDescriptor);
Audio& audio = Audio::getInstance();
audio.openOutput(deviceDescriptor);
Settings::getInstance().setOutDev(deviceDescriptor);
Audio::getInstance().reinitOutput(deviceDescriptor);
}
void AVForm::onFilterAudioToggled(bool filterAudio)