1
0
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:
tux3 2015-10-24 02:59:12 +02:00
parent aaf04a80db
commit 995fc4cdda
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
3 changed files with 6 additions and 6 deletions

View File

@ -476,7 +476,7 @@ bool Audio::isInputReady()
/** /**
Returns true if the output device is open Returns true if the output device is open
*/ */
bool Audio::isOutputClosed() bool Audio::isOutputReady()
{ {
QMutexLocker locker(&audioOutLock); QMutexLocker locker(&audioOutLock);
return alOutDev; return alOutDev;

View File

@ -70,7 +70,7 @@ public:
bool openOutput(const QString& outDevDescr); bool openOutput(const QString& outDevDescr);
bool isInputReady(); bool isInputReady();
bool isOutputClosed(); bool isOutputReady();
static void createSource(ALuint* source); static void createSource(ALuint* source);
static void deleteSource(ALuint* source); static void deleteSource(ALuint* source);

View File

@ -316,8 +316,8 @@ void AVForm::onInDevChanged(const QString &deviceDescriptor)
Settings::getInstance().setInDev(deviceDescriptor); Settings::getInstance().setInDev(deviceDescriptor);
Audio& audio = Audio::getInstance(); Audio& audio = Audio::getInstance();
audio.unsubscribeInput(); if (audio.isInputReady())
audio.subscribeInput(); audio.openInput(deviceDescriptor);
} }
void AVForm::onOutDevChanged(const QString& deviceDescriptor) void AVForm::onOutDevChanged(const QString& deviceDescriptor)
@ -325,8 +325,8 @@ void AVForm::onOutDevChanged(const QString& deviceDescriptor)
Settings::getInstance().setOutDev(deviceDescriptor); Settings::getInstance().setOutDev(deviceDescriptor);
Audio& audio = Audio::getInstance(); Audio& audio = Audio::getInstance();
audio.unsubscribeInput(); if (audio.isOutputReady())
audio.subscribeInput(); audio.openOutput(deviceDescriptor);
} }
void AVForm::onFilterAudioToggled(bool filterAudio) void AVForm::onFilterAudioToggled(bool filterAudio)