diff options
author | Thorvald Natvig <slicer@users.sourceforge.net> | 2008-03-17 03:28:34 +0300 |
---|---|---|
committer | Thorvald Natvig <slicer@users.sourceforge.net> | 2008-03-17 03:28:34 +0300 |
commit | 0ccde72bf2873e060ed8ff0693747424c5cef0b1 (patch) | |
tree | d337e152f769fc9cbf8f070ecd2b82b816a82d45 /src | |
parent | 2bb285b7f0f54ce99503510cf5be0e7bc72d77f1 (diff) |
Make all audio modules for Unix optional, as well as dbus and speechd (CONFIG+=no-whatver)
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@989 05730e5d-ab1b-0410-a4ac-84af385074fa
Diffstat (limited to 'src')
-rw-r--r-- | src/mumble/TextToSpeech_unix.cpp | 18 | ||||
-rw-r--r-- | src/mumble/main.cpp | 4 | ||||
-rw-r--r-- | src/mumble/mumble.pro | 97 |
3 files changed, 79 insertions, 40 deletions
diff --git a/src/mumble/TextToSpeech_unix.cpp b/src/mumble/TextToSpeech_unix.cpp index a26513083..2ef15ca06 100644 --- a/src/mumble/TextToSpeech_unix.cpp +++ b/src/mumble/TextToSpeech_unix.cpp @@ -33,8 +33,10 @@ #include <libspeechd.h> class TextToSpeechPrivate { +#ifdef USE_SPEECHD protected: SPDConnection *spd; +#endif public: TextToSpeechPrivate(); ~TextToSpeechPrivate(); @@ -42,6 +44,7 @@ class TextToSpeechPrivate { void setVolume(int v); }; +#ifdef USE_SPEECHD TextToSpeechPrivate::TextToSpeechPrivate() { spd = spd_open("Mumble", NULL, NULL, SPD_MODE_THREADED); if (! spd) { @@ -70,6 +73,21 @@ void TextToSpeechPrivate::setVolume(int vol) { if (spd) spd_set_volume(spd, vol * 2 - 100); } +#else +TextToSpeechPrivate::TextToSpeechPrivate() { + qWarning("TextToSpeech: Compiled without support for speech-dispatcher"); +} + +TextToSpeechPrivate::~TextToSpeechPrivate() { +} + +void TextToSpeechPrivate::say(const QString &) { +} + +void TextToSpeechPrivate::setVolume(int) { +} +#endif + TextToSpeech::TextToSpeech(QObject *p) : QObject(p) { enabled = true; diff --git a/src/mumble/main.cpp b/src/mumble/main.cpp index 34d1120e2..3bfae3ec9 100644 --- a/src/mumble/main.cpp +++ b/src/mumble/main.cpp @@ -73,7 +73,7 @@ int main(int argc, char **argv) { Global::g_global_struct = new Global(); -#ifndef Q_OS_MAC +#ifdef USE_DBUS #ifdef Q_OS_WIN // By default, windbus expects the path to dbus-daemon to be in PATH, and the path // should contain bin\\, and the path to the config is hardcoded as ..\etc @@ -175,7 +175,7 @@ int main(int argc, char **argv) { g.mw=new MainWindow(NULL); g.mw->show(); -#ifndef Q_OS_MAC +#ifdef USE_DBUS new MumbleDBus(g.mw); QDBusConnection::sessionBus().registerObject(QLatin1String("/"), g.mw); QDBusConnection::sessionBus().registerService(QLatin1String("net.sourceforge.mumble.mumble")); diff --git a/src/mumble/mumble.pro b/src/mumble/mumble.pro index e1d3e84c7..c243aed3e 100644 --- a/src/mumble/mumble.pro +++ b/src/mumble/mumble.pro @@ -20,10 +20,8 @@ PRECOMPILED_HEADER = mumble_pch.hpp QMAKE_CXXFLAGS += -Wall -Wextra } -!macx { - CONFIG += qdbus - HEADERS += DBus.h - SOURCES += DBus.cpp +!macx:!CONFIG(no-dbus) { + CONFIG += dbus } win32 { @@ -35,9 +33,11 @@ win32 { LIBS += -ldsound -ldxguid -ldinput8 -lsapi -lole32 -lws2_32 -llibeay32 -ladvapi32 LIBPATH += /dev/WinSDK/Lib/i386 /dev/dxsdk/Lib/x86 /dev/OpenSSL/lib LIBS += -lavrt -delayload:avrt -ldelayimp - CONFIG += asio DEFINES += WIN32 INCLUDEPATH += /dev/OpenSSL/include + !CONFIG(no-asio) { + CONFIG += asio + } } unix { @@ -48,22 +48,15 @@ unix { HAVE_PULSEAUDIO=$$system(pkg-config --modversion --silence-errors libpulse) HAVE_PORTAUDIO=$$system(pkg-config --modversion --silence-errors portaudio-2.0) - !isEmpty(HAVE_PORTAUDIO) { + !isEmpty(HAVE_PORTAUDIO):!CONFIG(no-portaudio) { CONFIG += portaudio } - !isEmpty(HAVE_PULSEAUDIO) { + !isEmpty(HAVE_PULSEAUDIO):!CONFIG(no-pulseaudio) { CONFIG += pulseaudio CONFIG -= portaudio } - # Enable mmx/sse optimizations on x86 archs except on mac where these would - # break universal build - # No, we don't, as it breaks packaging policies all over. - #!macx:!isEmpty(X86ARCH) { - # QMAKE_CXXFLAGS += -mmmx -msse - # } - QMAKE_CFLAGS += -I../../speex/include -I../../speexbuild QMAKE_CXXFLAGS += -I../../speex/include -I../../speexbuild QMAKE_CXXFLAGS_RELEASE += -I../../speex/include -I../../speexbuild @@ -73,12 +66,21 @@ unix { PKGCONFIG += openssl contains(UNAME, Linux) { - CONFIG += oss - FORMS += ALSAAudio.ui - HEADERS += ALSAAudio.h GlobalShortcut_unix.h - SOURCES += ALSAAudio.cpp GlobalShortcut_unix.cpp TextToSpeech_unix.cpp Overlay_unix.cpp - PKGCONFIG += xevie alsa - LIBS += -lspeechd + !CONFIG(no-oss) { + CONFIG += oss + } + + !CONFIG(no-alsa) { + CONFIG += alsa + } + + !CONFIG(no-speechd) { + CONFIG += speechd + } + + HEADERS += GlobalShortcut_unix.h + SOURCES += GlobalShortcut_unix.cpp TextToSpeech_unix.cpp Overlay_unix.cpp + PKGCONFIG += xevie } macx { @@ -99,26 +101,34 @@ unix { ICON = ../../icons/mumble.icns } - oss { - HEADERS += OSS.h - SOURCES += OSS.cpp - FORMS += OSS.ui - INCLUDEPATH += /usr/lib/oss/include - } +} - pulseaudio { - HEADERS += PulseAudio.h - SOURCES += PulseAudio.cpp - FORMS += PulseAudio.ui - PKGCONFIG += libpulse - } +alsa { + HEADERS += ALSAAudio.h + SOURCES += ALSAAudio.cpp + FORMS += ALSAAudio.ui + PKGCONFIG += alsa +} - portaudio { - PKGCONFIG += portaudio-2.0 - SOURCES += PAAudio.cpp PAAudioConfig.cpp - HEADERS += PAAudio.h PAAudioConfig.h - FORMS += PAAudioConfig.ui - } +oss { + HEADERS += OSS.h + SOURCES += OSS.cpp + FORMS += OSS.ui + INCLUDEPATH += /usr/lib/oss/include +} + +pulseaudio { + HEADERS += PulseAudio.h + SOURCES += PulseAudio.cpp + FORMS += PulseAudio.ui + PKGCONFIG += libpulse +} + +portaudio { + PKGCONFIG += portaudio-2.0 + SOURCES += PAAudio.cpp PAAudioConfig.cpp + HEADERS += PAAudio.h PAAudioConfig.h + FORMS += PAAudioConfig.ui } asio { @@ -128,6 +138,17 @@ asio { SOURCES += ASIOInput.cpp } +dbus { + CONFIG += qdbus + HEADERS += DBus.h + SOURCES += DBus.cpp + DEFINES += USE_DBUS +} + +speechd { + LIBS += -lspeechd + DEFINES += USE_SPEECHD +} QT_TRANSDIR = $$[QT_INSTALL_TRANSLATIONS]/ QT_TRANSDIR = $$replace(QT_TRANSDIR,/,$${DIR_SEPARATOR}) |