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.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef VOICEFILE_H
|
|
|
|
#define VOICEFILE_H
|
|
|
|
|
2008-02-10 18:25:49 +00:00
|
|
|
#include <QtCore>
|
2008-01-11 23:59:12 +00:00
|
|
|
#include "progressloggerinterface.h"
|
|
|
|
|
|
|
|
#include "encoders.h"
|
|
|
|
#include "tts.h"
|
|
|
|
#include "httpget.h"
|
|
|
|
|
2008-05-22 17:51:35 +00:00
|
|
|
#include "wavtrim.h"
|
|
|
|
#include "voicefont.h"
|
|
|
|
|
2008-01-11 23:59:12 +00:00
|
|
|
class VoiceFileCreator :public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2009-04-29 21:27:01 +00:00
|
|
|
VoiceFileCreator(QObject* parent);
|
2008-05-22 17:51:35 +00:00
|
|
|
|
2008-01-11 23:59:12 +00:00
|
|
|
//start creation
|
|
|
|
bool createVoiceFile(ProgressloggerInterface* logger);
|
|
|
|
|
|
|
|
void setMountPoint(QString mountpoint) {m_mountpoint =mountpoint; }
|
|
|
|
void setTargetId(int id){m_targetid = id;}
|
|
|
|
void setLang(QString name){m_lang =name;}
|
2008-01-19 18:33:33 +00:00
|
|
|
void setWavtrimThreshold(int th){m_wavtrimThreshold = th;}
|
2009-04-05 12:46:41 +00:00
|
|
|
|
2008-02-09 18:58:14 +00:00
|
|
|
signals:
|
|
|
|
void done(bool error);
|
2009-04-05 12:46:41 +00:00
|
|
|
|
2008-01-11 23:59:12 +00:00
|
|
|
private slots:
|
|
|
|
void abort();
|
|
|
|
void downloadDone(bool error);
|
|
|
|
void updateDataReadProgress(int read, int total);
|
2009-04-05 12:46:41 +00:00
|
|
|
|
2008-01-11 23:59:12 +00:00
|
|
|
private:
|
2009-04-05 12:46:41 +00:00
|
|
|
|
2008-01-11 23:59:12 +00:00
|
|
|
// ptr to encoder, tts and settings
|
|
|
|
TTSBase* m_tts;
|
|
|
|
EncBase* m_enc;
|
|
|
|
HttpGet *getter;
|
2009-04-05 12:46:41 +00:00
|
|
|
|
2008-01-11 23:59:12 +00:00
|
|
|
QString filename; //the temporary file
|
2009-04-05 12:46:41 +00:00
|
|
|
|
2008-01-11 23:59:12 +00:00
|
|
|
QString m_mountpoint; //mountpoint of the device
|
|
|
|
QString m_path; //path where the wav and mp3 files are stored to
|
|
|
|
int m_targetid; //the target id
|
|
|
|
QString m_lang; // the language which will be spoken
|
2008-01-19 18:33:33 +00:00
|
|
|
int m_wavtrimThreshold;
|
2009-04-05 12:46:41 +00:00
|
|
|
|
2008-01-11 23:59:12 +00:00
|
|
|
ProgressloggerInterface* m_logger;
|
|
|
|
|
|
|
|
bool m_abort;
|
|
|
|
};
|
2009-04-05 12:46:41 +00:00
|
|
|
|
2008-01-11 23:59:12 +00:00
|
|
|
#endif
|
2009-04-05 12:46:41 +00:00
|
|
|
|