mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Reload audio devices on the fly from settings
This commit is contained in:
parent
aaf04a80db
commit
995fc4cdda
|
@ -476,7 +476,7 @@ bool Audio::isInputReady()
|
|||
/**
|
||||
Returns true if the output device is open
|
||||
*/
|
||||
bool Audio::isOutputClosed()
|
||||
bool Audio::isOutputReady()
|
||||
{
|
||||
QMutexLocker locker(&audioOutLock);
|
||||
return alOutDev;
|
||||
|
|
|
@ -70,7 +70,7 @@ public:
|
|||
bool openOutput(const QString& outDevDescr);
|
||||
|
||||
bool isInputReady();
|
||||
bool isOutputClosed();
|
||||
bool isOutputReady();
|
||||
|
||||
static void createSource(ALuint* source);
|
||||
static void deleteSource(ALuint* source);
|
||||
|
|
|
@ -316,8 +316,8 @@ void AVForm::onInDevChanged(const QString &deviceDescriptor)
|
|||
Settings::getInstance().setInDev(deviceDescriptor);
|
||||
|
||||
Audio& audio = Audio::getInstance();
|
||||
audio.unsubscribeInput();
|
||||
audio.subscribeInput();
|
||||
if (audio.isInputReady())
|
||||
audio.openInput(deviceDescriptor);
|
||||
}
|
||||
|
||||
void AVForm::onOutDevChanged(const QString& deviceDescriptor)
|
||||
|
@ -325,8 +325,8 @@ void AVForm::onOutDevChanged(const QString& deviceDescriptor)
|
|||
Settings::getInstance().setOutDev(deviceDescriptor);
|
||||
|
||||
Audio& audio = Audio::getInstance();
|
||||
audio.unsubscribeInput();
|
||||
audio.subscribeInput();
|
||||
if (audio.isOutputReady())
|
||||
audio.openOutput(deviceDescriptor);
|
||||
}
|
||||
|
||||
void AVForm::onFilterAudioToggled(bool filterAudio)
|
||||
|
|
Loading…
Reference in New Issue
Block a user