Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
feat(audio): make the libfilteraudio dependency optional
Browse files Browse the repository at this point in the history
  • Loading branch information
sudden6 committed Aug 5, 2017
1 parent e1da943 commit 8652fe9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 0 additions & 1 deletion cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion src/audio/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -167,6 +169,7 @@
*/
Audio& Audio::getInstance()
{
#ifdef USE_FILTERAUDIO
static bool initialized = false;
static bool Backend2 = false;

Expand All @@ -178,7 +181,9 @@ Audio& Audio::getInstance()
if (Backend2) {
static OpenAL2 instance;
return instance;
} else {
} else
#endif
{
static OpenAL instance;
return instance;
}
Expand Down
3 changes: 3 additions & 0 deletions src/widget/form/settings/avform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8652fe9

Please sign in to comment.