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

feat(audio): make the libfilteraudio dependency optional

This commit is contained in:
sudden6 2017-06-05 18:36:18 +02:00
parent e1da943e4e
commit 8652fe99e3
No known key found for this signature in database
GPG Key ID: 279509B499E032B9
3 changed files with 9 additions and 2 deletions

View File

@ -117,7 +117,6 @@ if (NOT TOXCORE_FOUND OR
endif()
search_dependency(OPENAL PACKAGE openal)
search_dependency(FILTERAUDIO LIBRARY filteraudio)
if (PLATFORM_EXTENSIONS AND UNIX AND NOT APPLE)
# Automatic auto-away support. (X11 also using for capslock detection)

View File

@ -19,7 +19,9 @@
#include "audio.h"
#include "src/audio/backend/openal.h"
#ifdef USE_FILTERAUDIO
#include "src/audio/backend/openal2.h"
#endif
#include "src/persistence/settings.h"
#include <QDebug>
@ -167,6 +169,7 @@
*/
Audio& Audio::getInstance()
{
#ifdef USE_FILTERAUDIO
static bool initialized = false;
static bool Backend2 = false;
@ -178,7 +181,9 @@ Audio& Audio::getInstance()
if (Backend2) {
static OpenAL2 instance;
return instance;
} else {
} else
#endif
{
static OpenAL instance;
return instance;
}

View File

@ -60,6 +60,9 @@ AVForm::AVForm()
cbEnableTestSound->setToolTip(tr("Play a test sound while changing the output volume."));
#ifndef USE_FILTERAUDIO
cbEnableBackend2->setVisible(false);
#endif
cbEnableBackend2->setChecked(s.getEnableBackend2());
connect(rescanButton, &QPushButton::clicked, this, &AVForm::rescanDevices);