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
|
Returns true if the output device is open
|
||||||
*/
|
*/
|
||||||
bool Audio::isOutputClosed()
|
bool Audio::isOutputReady()
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&audioOutLock);
|
QMutexLocker locker(&audioOutLock);
|
||||||
return alOutDev;
|
return alOutDev;
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user