From 91bfe56b790ad541452af362c3da8649466bb604 Mon Sep 17 00:00:00 2001 From: pixhawk Date: Fri, 9 Apr 2010 10:11:38 +0200 Subject: [PATCH] Fixed Linux compatibility of Linux Qt Phonon support --- src/GAudioOutput.cc | 14 ++++++-------- src/GAudioOutput.h | 12 +++++++++++- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/GAudioOutput.cc b/src/GAudioOutput.cc index 6f17bfc7b..2dd47f9f4 100644 --- a/src/GAudioOutput.cc +++ b/src/GAudioOutput.cc @@ -36,10 +36,7 @@ This file is part of the PIXHAWK project #ifdef Q_OS_MAC #include #endif -#ifdef Q_OS_LINUX -#include -#endif -#include + #include #include @@ -79,7 +76,9 @@ GAudioOutput* GAudioOutput::instance() } GAudioOutput::GAudioOutput(QObject* parent) : QObject(parent), +#ifdef Q_OS_LINUX voice(NULL), +#endif voiceIndex(0), emergency(false) { @@ -236,13 +235,12 @@ extern "C" { #endif /* __cplusplus */ QStringList GAudioOutput::listVoices(void) { - - + QStringList l; +#ifdef Q_OS_LINUX cst_voice *voice; const cst_val *v; - QStringList l; -#ifndef _WIN32 + /* printf("Voices available: "); for (v=flite_voice_list; v; v=val_cdr(v)) diff --git a/src/GAudioOutput.h b/src/GAudioOutput.h index 6a9cf5a96..c375ba210 100644 --- a/src/GAudioOutput.h +++ b/src/GAudioOutput.h @@ -35,8 +35,16 @@ This file is part of the PIXHAWK project #include #include #include +#ifdef Q_OS_MAC +#include +#endif +#ifdef Q_OS_LINUX #include +#include +#endif +#ifdef Q_OS_WIN #include +#endif /* For Snow leopard and later #ifdef Q_OS_MAC @@ -77,10 +85,12 @@ public slots: void beep(); protected: - #ifdef Q_OS_MAC +#ifdef Q_OS_MAC //NSSpeechSynthesizer #endif +#ifdef Q_OS_LINUX cst_voice* voice; ///< The flite voice object +#endif int voiceIndex; ///< The index of the flite voice to use (awb, slt, rms) Phonon::MediaObject* m_media; ///< The output object for audio Phonon::AudioOutput* m_audioOutput; -- 2.22.0