2007-12-15 13:13:57 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 by Dominik Wenger
|
|
|
|
* $Id: tts.h 15212 2007-10-19 21:49:07Z domonoky $
|
|
|
|
*
|
|
|
|
* All files in this archive are subject to the GNU General Public License.
|
|
|
|
* See the file COPYING in the source tree root for full license agreement.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef TTS_H
|
|
|
|
#define TTS_H
|
|
|
|
|
2008-01-29 21:54:43 +00:00
|
|
|
|
2008-01-25 00:12:25 +00:00
|
|
|
#include "rbsettings.h"
|
2007-12-15 13:13:57 +00:00
|
|
|
#include <QtGui>
|
|
|
|
|
2008-01-29 21:54:43 +00:00
|
|
|
#ifndef CONSOLE
|
|
|
|
#include "ttsgui.h"
|
|
|
|
#endif
|
2007-12-15 13:13:57 +00:00
|
|
|
|
|
|
|
class TTSBase;
|
|
|
|
|
|
|
|
//inits the tts List
|
|
|
|
void initTTSList();
|
|
|
|
// function to get a specific tts
|
|
|
|
TTSBase* getTTS(QString ttsname);
|
|
|
|
// get the list of tts, nice names
|
|
|
|
QStringList getTTSList();
|
2008-02-06 21:51:35 +00:00
|
|
|
QString getTTSName(QString tts);
|
2007-12-15 13:13:57 +00:00
|
|
|
|
|
|
|
|
2008-01-29 21:54:43 +00:00
|
|
|
class TTSBase : public QObject
|
2007-12-15 13:13:57 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2008-01-29 21:54:43 +00:00
|
|
|
TTSBase();
|
2008-02-06 21:51:35 +00:00
|
|
|
virtual bool voice(QString text,QString wavfile) {(void)text; (void)wavfile; return false;}
|
|
|
|
virtual bool start(QString *errStr){(void)errStr; return false;}
|
2007-12-15 13:13:57 +00:00
|
|
|
virtual bool stop(){return false;}
|
|
|
|
virtual void showCfg(){}
|
|
|
|
virtual bool configOk(){return false;}
|
|
|
|
|
2008-01-25 00:12:25 +00:00
|
|
|
void setCfg(RbSettings* sett){settings = sett;}
|
2007-12-15 13:13:57 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
virtual void accept(void){}
|
|
|
|
virtual void reject(void){}
|
|
|
|
virtual void reset(void){}
|
|
|
|
|
|
|
|
protected:
|
2008-01-25 00:12:25 +00:00
|
|
|
RbSettings* settings;
|
2007-12-15 13:13:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class TTSSapi : public TTSBase
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2008-01-29 21:54:43 +00:00
|
|
|
TTSSapi();
|
2007-12-15 13:13:57 +00:00
|
|
|
virtual bool voice(QString text,QString wavfile);
|
2008-01-19 18:33:33 +00:00
|
|
|
virtual bool start(QString *errStr);
|
2007-12-15 13:13:57 +00:00
|
|
|
virtual bool stop();
|
|
|
|
virtual void showCfg();
|
|
|
|
virtual bool configOk();
|
2008-01-29 21:54:43 +00:00
|
|
|
|
|
|
|
QStringList getVoiceList(QString language);
|
2007-12-15 13:13:57 +00:00
|
|
|
private:
|
2008-01-29 21:54:43 +00:00
|
|
|
|
2007-12-15 13:13:57 +00:00
|
|
|
QProcess* voicescript;
|
|
|
|
|
|
|
|
QString defaultLanguage;
|
|
|
|
|
|
|
|
QString m_TTSexec;
|
|
|
|
QString m_TTSOpts;
|
|
|
|
QString m_TTSTemplate;
|
|
|
|
QString m_TTSLanguage;
|
2008-01-19 18:33:33 +00:00
|
|
|
QString m_TTSVoice;
|
|
|
|
QString m_TTSSpeed;
|
|
|
|
|
2007-12-15 13:13:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class TTSExes : public TTSBase
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2008-01-29 21:54:43 +00:00
|
|
|
TTSExes(QString name);
|
2007-12-15 13:13:57 +00:00
|
|
|
virtual bool voice(QString text,QString wavfile);
|
2008-01-19 18:33:33 +00:00
|
|
|
virtual bool start(QString *errStr);
|
2007-12-15 13:13:57 +00:00
|
|
|
virtual bool stop() {return true;}
|
|
|
|
virtual void showCfg();
|
|
|
|
virtual bool configOk();
|
|
|
|
|
2008-01-29 21:54:43 +00:00
|
|
|
|
2007-12-15 13:13:57 +00:00
|
|
|
|
|
|
|
private:
|
2008-01-29 21:54:43 +00:00
|
|
|
|
2007-12-15 13:13:57 +00:00
|
|
|
QString m_name;
|
|
|
|
QString m_TTSexec;
|
|
|
|
QString m_TTSOpts;
|
|
|
|
QString m_TTSTemplate;
|
|
|
|
QMap<QString,QString> m_TemplateMap;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|