diff options
author | Thorvald Natvig <slicer@users.sourceforge.net> | 2007-06-23 15:02:24 +0400 |
---|---|---|
committer | Thorvald Natvig <slicer@users.sourceforge.net> | 2007-06-23 15:02:24 +0400 |
commit | dd39467b2b187b75cb0159a587bff82269d34bdb (patch) | |
tree | 8a98ac1a74ff4f30cb6ea98148bfd45535443c22 /src | |
parent | be21e2871ab7906bdac674c813e7f871b5d62aec (diff) |
Festival under Linux
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@489 05730e5d-ab1b-0410-a4ac-84af385074fa
Diffstat (limited to 'src')
-rw-r--r-- | src/mumble/GlobalShortcut_unix.cpp | 4 | ||||
-rw-r--r-- | src/mumble/Settings.cpp | 38 | ||||
-rw-r--r-- | src/mumble/Settings.h | 20 | ||||
-rw-r--r-- | src/mumble/TextToSpeech_unix.cpp | 38 | ||||
-rw-r--r-- | src/mumble/mumble.pro | 1 |
5 files changed, 85 insertions, 16 deletions
diff --git a/src/mumble/GlobalShortcut_unix.cpp b/src/mumble/GlobalShortcut_unix.cpp index 83f85543a..44822d43f 100644 --- a/src/mumble/GlobalShortcut_unix.cpp +++ b/src/mumble/GlobalShortcut_unix.cpp @@ -200,12 +200,16 @@ GlobalShortcutX::GlobalShortcutX() { qWarning("GlobalShortcutX: XEVIE %d.%d", maj, min); + // Here's the thing. If we're debugging, it doesn't do to have the xevie application hang. + +#ifdef QT_NO_DEBUG if (! XevieStart(display)) { qWarning("GlobalShortcutX: Another client is already using XEVIE"); return; } XevieSelectInput(display, KeyPressMask | KeyReleaseMask); +#endif bRunning=true; start(QThread::TimeCriticalPriority); diff --git a/src/mumble/Settings.cpp b/src/mumble/Settings.cpp index 202ae4cfc..c2df9b96d 100644 --- a/src/mumble/Settings.cpp +++ b/src/mumble/Settings.cpp @@ -33,7 +33,7 @@ Settings::Settings() { atTransmit = VAD; - a3dModel = None; + bTransmitPosition = false; bMute = bDeaf = false; bTTS = true; iTTSVolume = 75; @@ -46,7 +46,15 @@ Settings::Settings() { bTCPCompat = false; bReconnect = true; bExpandAll = false; + iDXOutputDelay = 5; + +#ifdef Q_OS_UNIX + qsFestival=QLatin1String("/usr/bin/festival --batch --pipe"); +#endif + +#ifdef Q_OS_WIN + a3dModel = None; fDXMinDistance = 10.0; fDXMaxDistance = 50.0; fDXRollOff = 0.15; @@ -60,7 +68,6 @@ Settings::Settings() { bOverlayBottom = true; bOverlayLeft = true; bOverlayRight = false; - bTransmitPosition = false; qfOverlayFont = QFont(QLatin1String("Arial"), 20); fOverlayWidth = 20.0; qcOverlayPlayer = QColor(255,255,255,128); @@ -68,6 +75,7 @@ Settings::Settings() { qcOverlayAltTalking = QColor(255,128,128,255); qcOverlayChannel = QColor(192,192,255,192); qcOverlayChannelTalking = QColor(224,224,255,255); +#endif } void Settings::load() { @@ -85,17 +93,22 @@ void Settings::load() { bTCPCompat = g.qs->value(QLatin1String("TCPCompat"), bTCPCompat).toBool(); bReconnect = g.qs->value(QLatin1String("Reconnect"), bReconnect).toBool(); bExpandAll = g.qs->value(QLatin1String("ExpandAll"), bExpandAll).toBool(); + iDXOutputDelay = g.qs->value(QLatin1String("DXOutputDelay"), iDXOutputDelay).toInt(); +#ifdef Q_OS_UNIX + qsFestival = g.qs->value(QLatin1String("Festival"),qsFestival).toString(); +#endif +#ifdef USE_ASIO + qsASIOclass = g.qs->value(QLatin1String("ASIOclass")).toString(); + qlASIOmic = g.qs->value(QLatin1String("ASIOmic")).toList(); + qlASIOspeaker = g.qs->value(QLatin1String("ASIOspeaker")).toList(); +#endif #ifdef Q_OS_WIN a3dModel = static_cast<Settings::Audio3D>(g.qs->value(QLatin1String("Audio3D"), a3dModel).toInt()); - iDXOutputDelay = g.qs->value(QLatin1String("DXOutputDelay"), iDXOutputDelay).toInt(); qbaDXInput = g.qs->value(QLatin1String("DXInput")).toByteArray(); qbaDXOutput = g.qs->value(QLatin1String("DXOutput")).toByteArray(); fDXMinDistance = g.qs->value(QLatin1String("DXMinDistance"), fDXMinDistance).toDouble(); fDXMaxDistance = g.qs->value(QLatin1String("DXMaxDistance"), fDXMaxDistance).toDouble(); fDXRollOff = g.qs->value(QLatin1String("DXRollOff"), fDXRollOff).toDouble(); - qsASIOclass = g.qs->value(QLatin1String("ASIOclass")).toString(); - qlASIOmic = g.qs->value(QLatin1String("ASIOmic")).toList(); - qlASIOspeaker = g.qs->value(QLatin1String("ASIOspeaker")).toList(); bOverlayEnable = g.qs->value(QLatin1String("OverlayEnable"),bOverlayEnable).toBool(); osOverlay = static_cast<Settings::OverlayShow>(g.qs->value(QLatin1String("OverlayShow"), osOverlay).toInt()); bOverlayAlwaysSelf = g.qs->value(QLatin1String("OverlayAlwaysSelf"),bOverlayAlwaysSelf).toBool(); @@ -130,18 +143,23 @@ void Settings::save() { g.qs->setValue(QLatin1String("TCPCompat"), bTCPCompat); g.qs->setValue(QLatin1String("Reconnect"), bReconnect); g.qs->setValue(QLatin1String("ExpandAll"), bExpandAll); + g.qs->setValue(QLatin1String("DXOutputDelay"), iDXOutputDelay); +#ifdef Q_OS_UNIX + g.qs->setValue(QLatin1String("Festival"), qsFestival); +#endif +#ifdef USE_ASIO + g.qs->setValue(QLatin1String("ASIOclass"), qsASIOclass); + g.qs->setValue(QLatin1String("ASIOmic"), qlASIOmic); + g.qs->setValue(QLatin1String("ASIOspeaker"), qlASIOspeaker); +#endif #ifdef Q_OS_WIN g.qs->setValue(QLatin1String("PosTransmit"), g.s.bTransmitPosition); g.qs->setValue(QLatin1String("Audio3D"), g.s.a3dModel); - g.qs->setValue(QLatin1String("DXOutputDelay"), iDXOutputDelay); g.qs->setValue(QLatin1String("DXInput"), qbaDXInput); g.qs->setValue(QLatin1String("DXOutput"), qbaDXOutput); g.qs->setValue(QLatin1String("DXMinDistance"), fDXMinDistance); g.qs->setValue(QLatin1String("DXMaxDistance"), fDXMaxDistance); g.qs->setValue(QLatin1String("DXRollOff"), fDXRollOff); - g.qs->setValue(QLatin1String("ASIOclass"), qsASIOclass); - g.qs->setValue(QLatin1String("ASIOmic"), qlASIOmic); - g.qs->setValue(QLatin1String("ASIOspeaker"), qlASIOspeaker); g.qs->setValue(QLatin1String("OverlayEnable"), bOverlayEnable); g.qs->setValue(QLatin1String("OverlayShow"), osOverlay); g.qs->setValue(QLatin1String("OverlayAlwaysSelf"), bOverlayAlwaysSelf); diff --git a/src/mumble/Settings.h b/src/mumble/Settings.h index 746797089..de35f0242 100644 --- a/src/mumble/Settings.h +++ b/src/mumble/Settings.h @@ -40,11 +40,8 @@ struct Settings { enum AudioTransmit { Continous, VAD, PushToTalk }; - enum Audio3D { None, Panning, Light, Full }; - enum OverlayShow { Nothing, Talking, All }; AudioTransmit atTransmit; bool bTransmitPosition; - Audio3D a3dModel; bool bMute, bDeaf; bool bTTS; int iTTSVolume; @@ -54,12 +51,24 @@ struct Settings { QString qsAudioInput, qsAudioOutput; int iDXOutputDelay; - QByteArray qbaDXInput, qbaDXOutput; - float fDXMinDistance, fDXMaxDistance, fDXRollOff; + +#ifdef Q_OS_UNIX + QString qsFestival; +#endif +#ifdef USE_ASIO QString qsASIOclass; QList<QVariant> qlASIOmic; QList<QVariant> qlASIOspeaker; +#endif + +#ifdef Q_OS_WIN + enum Audio3D { None, Panning, Light, Full }; + enum OverlayShow { Nothing, Talking, All }; + Audio3D a3dModel; + + QByteArray qbaDXInput, qbaDXOutput; + float fDXMinDistance, fDXMaxDistance, fDXRollOff; bool bOverlayEnable; OverlayShow osOverlay; @@ -74,6 +83,7 @@ struct Settings { QColor qcOverlayAltTalking; QColor qcOverlayChannel; QColor qcOverlayChannelTalking; +#endif Settings(); void load(); diff --git a/src/mumble/TextToSpeech_unix.cpp b/src/mumble/TextToSpeech_unix.cpp index 680ed2355..a4e40e710 100644 --- a/src/mumble/TextToSpeech_unix.cpp +++ b/src/mumble/TextToSpeech_unix.cpp @@ -29,21 +29,57 @@ */ #include "TextToSpeech.h" +#include "Global.h" + +class TextToSpeechPrivate { + protected: + QProcess qpFestival; + public: + TextToSpeechPrivate(); + ~TextToSpeechPrivate(); + void say(QString text); + void setVolume(int v); +}; + +TextToSpeechPrivate::TextToSpeechPrivate() { + qpFestival.start(g.s.qsFestival,QIODevice::ReadWrite); + qpFestival.waitForStarted(5000); +} + +TextToSpeechPrivate::~TextToSpeechPrivate() { + qpFestival.closeWriteChannel(); + qpFestival.close(); +} + +void TextToSpeechPrivate::say(QString text) { + QTextDocument td; + td.setHtml(text); + qpFestival.write(QString::fromLatin1("(SayText \"%1\")").arg(td.toPlainText().replace(QLatin1String("\""),QLatin1String("\\\""))).toUtf8()); +} + +void TextToSpeechPrivate::setVolume(int) { +} TextToSpeech::TextToSpeech(QObject *p) : QObject(p) { + enabled = true; + d = new TextToSpeechPrivate(); } TextToSpeech::~TextToSpeech() { + delete d; } void TextToSpeech::say(QString text) { + if (enabled) + d->say(text); } void TextToSpeech::setEnabled(bool e) { enabled = e; } -void TextToSpeech::setVolume(int) { +void TextToSpeech::setVolume(int volume) { + d->setVolume(volume); } diff --git a/src/mumble/mumble.pro b/src/mumble/mumble.pro index e74a4ac29..25ada5c58 100644 --- a/src/mumble/mumble.pro +++ b/src/mumble/mumble.pro @@ -43,6 +43,7 @@ unix { } CONFIG(asio) { + DEFINES += USE_ASIO INCLUDEPATH += ../../asio/common ../../asio/host ../../asio/host/pc HEADERS += ASIOInput.h SOURCES += ASIOInput.cpp |