Support "eject" on OS X.
[maemo-rb.git] / rbutil / rbutilqt / base / ttsfestival.h
blob2772108a2323e6a21b808c53821f3786dc4002a8
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
9 * Copyright (C) 2009 by Dominik Wenger
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
19 ****************************************************************************/
21 #ifndef TTSFESTIVAL_H
22 #define TTSFESTIVAL_H
24 #include <QTemporaryFile>
25 #include "ttsbase.h"
27 class TTSFestival : public TTSBase
29 enum ESettings
31 eSERVERPATH,
32 eCLIENTPATH,
33 eVOICE,
34 eVOICEDESC
37 Q_OBJECT
38 public:
39 TTSFestival(QObject* parent=NULL) : TTSBase(parent) {}
40 ~TTSFestival();
41 bool start(QString *errStr);
42 bool stop();
43 TTSStatus voice(QString text,QString wavfile, QString *errStr);
44 QString voiceVendor(void) { return QString(); }
45 Capabilities capabilities();
47 // for settings
48 bool configOk();
49 void generateSettings();
50 void saveSettings();
52 private slots:
53 void updateVoiceList();
54 void updateVoiceDescription();
55 void clearVoiceDescription();
56 private:
57 QTemporaryFile prologFile;
58 QString prologPath;
59 QString currentPath;
60 QStringList getVoiceList();
61 QString getVoiceInfo(QString voice);
63 inline void startServer();
64 inline bool ensureServerRunning();
65 QString queryServer(QString query, int timeout = -1);
66 QProcess serverProcess;
67 QStringList voices;
68 QMap<QString, QString> voiceDescriptions;
72 #endif