2008-01-11 23:59:12 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 by Dominik Wenger
|
2008-06-30 22:09:45 +00:00
|
|
|
* $Id$
|
2008-01-11 23:59:12 +00:00
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2008-01-11 23:59:12 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
2009-06-26 20:40:51 +00:00
|
|
|
#ifndef TALKGENERATOR_H
|
|
|
|
#define TALKGENERATOR_H
|
2008-01-11 23:59:12 +00:00
|
|
|
|
2008-02-10 18:25:49 +00:00
|
|
|
#include <QtCore>
|
2008-01-11 23:59:12 +00:00
|
|
|
#include "progressloggerinterface.h"
|
|
|
|
|
|
|
|
#include "encoders.h"
|
2009-10-13 19:54:27 +00:00
|
|
|
#include "ttsbase.h"
|
2008-01-11 23:59:12 +00:00
|
|
|
|
2009-06-26 20:40:51 +00:00
|
|
|
//! \brief Talk generator, generates .wav and .talk files out of a list.
|
|
|
|
class TalkGenerator :public QObject
|
2008-01-11 23:59:12 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2009-06-26 20:40:51 +00:00
|
|
|
enum Status
|
|
|
|
{
|
|
|
|
eOK,
|
|
|
|
eWARNING,
|
|
|
|
eERROR
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TalkEntry
|
|
|
|
{
|
|
|
|
QString toSpeak;
|
|
|
|
QString wavfilename;
|
|
|
|
QString talkfilename;
|
|
|
|
QString target;
|
|
|
|
bool voiced;
|
|
|
|
bool encoded;
|
|
|
|
};
|
|
|
|
|
|
|
|
TalkGenerator(QObject* parent);
|
|
|
|
|
|
|
|
Status process(QList<TalkEntry>* list,int wavtrimth = -1);
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void abort();
|
2009-04-05 12:46:41 +00:00
|
|
|
|
2008-02-09 18:58:14 +00:00
|
|
|
signals:
|
2009-06-26 20:40:51 +00:00
|
|
|
void done(bool);
|
|
|
|
void logItem(QString, int); //! set logger item
|
|
|
|
void logProgress(int, int); //! set progress bar.
|
2009-04-05 12:46:41 +00:00
|
|
|
|
2008-01-11 23:59:12 +00:00
|
|
|
private:
|
2009-06-26 20:40:51 +00:00
|
|
|
Status voiceList(QList<TalkEntry>* list,int wavetrimth);
|
|
|
|
Status encodeList(QList<TalkEntry>* list);
|
2009-04-05 12:46:41 +00:00
|
|
|
|
2008-01-11 23:59:12 +00:00
|
|
|
TTSBase* m_tts;
|
|
|
|
EncBase* m_enc;
|
|
|
|
|
|
|
|
bool m_abort;
|
|
|
|
};
|
2009-04-05 12:46:41 +00:00
|
|
|
|
2009-06-26 20:40:51 +00:00
|
|
|
|
2008-01-11 23:59:12 +00:00
|
|
|
#endif
|
2009-04-05 12:46:41 +00:00
|
|
|
|