Browse Source

feat(audio): make the libfilteraudio dependency optional

pull/4367/head
sudden6 8 years ago
parent
commit
8652fe99e3
No known key found for this signature in database
GPG Key ID: 279509B499E032B9
  1. 1
      cmake/Dependencies.cmake
  2. 7
      src/audio/audio.cpp
  3. 3
      src/widget/form/settings/avform.cpp

1
cmake/Dependencies.cmake

@ -117,7 +117,6 @@ if (NOT TOXCORE_FOUND OR @@ -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)

7
src/audio/audio.cpp

@ -19,7 +19,9 @@ @@ -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 @@ @@ -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() @@ -178,7 +181,9 @@ Audio& Audio::getInstance()
if (Backend2) {
static OpenAL2 instance;
return instance;
} else {
} else
#endif
{
static OpenAL instance;
return instance;
}

3
src/widget/form/settings/avform.cpp

@ -60,6 +60,9 @@ AVForm::AVForm() @@ -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);

Loading…
Cancel
Save