summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-01-06 19:19:32 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-01-06 19:19:32 +0000
commitbe0e197190c0d4af347c5532b8ab8229279d940e (patch)
tree39b9030d4e5df8c8b736af0492e7e69ac2a1d8e7 /rbutil/rbutilqt
parentf860b571437fc514bfefa1444dbdbf09583f8f9b (diff)
downloadrockbox-be0e197190c0d4af347c5532b8ab8229279d940e.tar.gz
rockbox-be0e197190c0d4af347c5532b8ab8229279d940e.zip
Split up encoders sources.
Create a separate source / header file for each supported encoder and the base class and rename classes for better readability. This should also make it easier adding new encoders. Remove a few trailing spaces while at it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31592 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt')
-rw-r--r--rbutil/rbutilqt/base/encoderbase.cpp75
-rw-r--r--rbutil/rbutilqt/base/encoderbase.h (renamed from rbutil/rbutilqt/base/encoders.h)83
-rw-r--r--rbutil/rbutilqt/base/encoderexe.cpp94
-rw-r--r--rbutil/rbutilqt/base/encoderexe.h55
-rw-r--r--rbutil/rbutilqt/base/encoderrbspeex.cpp (renamed from rbutil/rbutilqt/base/encoders.cpp)145
-rw-r--r--rbutil/rbutilqt/base/encoderrbspeex.h60
-rw-r--r--rbutil/rbutilqt/base/talkgenerator.cpp2
-rw-r--r--rbutil/rbutilqt/base/talkgenerator.h8
-rw-r--r--rbutil/rbutilqt/configure.cpp14
-rw-r--r--rbutil/rbutilqt/createvoicewindow.cpp6
-rw-r--r--rbutil/rbutilqt/installtalkwindow.cpp26
-rw-r--r--rbutil/rbutilqt/rbutilqt.pri8
12 files changed, 337 insertions, 239 deletions
diff --git a/rbutil/rbutilqt/base/encoderbase.cpp b/rbutil/rbutilqt/base/encoderbase.cpp
new file mode 100644
index 0000000000..e2668febd1
--- /dev/null
+++ b/rbutil/rbutilqt/base/encoderbase.cpp
@@ -0,0 +1,75 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ *
+ * Copyright (C) 2007 by Dominik Wenger
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#include "encoderbase.h"
+#include "utils.h"
+#include "rbsettings.h"
+#include "encoderrbspeex.h"
+#include "encoderexe.h"
+
+/*********************************************************************
+* Encoder Base
+**********************************************************************/
+QMap<QString,QString> EncoderBase::encoderList;
+
+EncoderBase::EncoderBase(QObject *parent): EncTtsSettingInterface(parent)
+{
+
+}
+
+// initialize list of encoders
+void EncoderBase::initEncodernamesList()
+{
+ encoderList["rbspeex"] = "Rockbox Speex Encoder";
+ encoderList["lame"] = "Lame Mp3 Encoder";
+}
+
+
+// get nice name for a specific encoder
+QString EncoderBase::getEncoderName(QString encoder)
+{
+ if(encoderList.isEmpty())
+ initEncodernamesList();
+ return encoderList.value(encoder);
+}
+
+
+// get a specific encoder object
+EncoderBase* EncoderBase::getEncoder(QObject* parent,QString encoder)
+{
+ EncoderBase* enc;
+ if(encoder == "lame")
+ {
+ enc = new EncoderExe(encoder,parent);
+ return enc;
+ }
+ else // rbspeex is default
+ {
+ enc = new EncoderRbSpeex(parent);
+ return enc;
+ }
+}
+
+
+QStringList EncoderBase::getEncoderList()
+{
+ if(encoderList.isEmpty())
+ initEncodernamesList();
+ return encoderList.keys();
+}
+
diff --git a/rbutil/rbutilqt/base/encoders.h b/rbutil/rbutilqt/base/encoderbase.h
index 015b8346b1..e032e5f48f 100644
--- a/rbutil/rbutilqt/base/encoders.h
+++ b/rbutil/rbutilqt/base/encoderbase.h
@@ -17,21 +17,21 @@
* KIND, either express or implied.
*
****************************************************************************/
-
+
#ifndef ENCODERS_H
#define ENCODERS_H
-
+
#include <QtCore>
-
+
#include "encttssettings.h"
#include "rbspeex.h"
-class EncBase : public EncTtsSettingInterface
+class EncoderBase : public EncTtsSettingInterface
{
Q_OBJECT
public:
- EncBase(QObject *parent );
+ EncoderBase(QObject *parent );
//! Child class should encode a wav file
virtual bool encode(QString input,QString output) =0;
@@ -39,18 +39,18 @@ class EncBase : public EncTtsSettingInterface
virtual bool start()=0;
//! Child class should stop
virtual bool stop()=0;
-
+
// settings
//! Child class should return true when configuration is ok
virtual bool configOk()=0;
- //! Child class should fill in the setttingsList
+ //! Child class should fill in the setttingsList
virtual void generateSettings() = 0;
//! Chlid class should commit the from SettingsList to permanent storage
virtual void saveSettings() = 0;
-
+
// static functions
static QString getEncoderName(QString name);
- static EncBase* getEncoder(QObject* parent,QString name);
+ static EncoderBase* getEncoder(QObject* parent,QString name);
static QStringList getEncoderList(void);
private:
@@ -60,68 +60,5 @@ class EncBase : public EncTtsSettingInterface
static QMap<QString,QString> encoderList;
};
-
-class EncExes : public EncBase
-{
- enum ESettings
- {
- eEXEPATH,
- eEXEOPTIONS
- };
-
- Q_OBJECT
-public:
- EncExes(QString name,QObject *parent = NULL);
- bool encode(QString input,QString output);
- bool start();
- bool stop() {return true;}
-
- // setting
- bool configOk();
- void generateSettings();
- void saveSettings();
-
-private:
- QString m_name;
- QString m_EncExec;
- QString m_EncOpts;
- QMap<QString,QString> m_TemplateMap;
- QString m_EncTemplate;
-};
-
-class EncRbSpeex : public EncBase
-{
- enum ESettings
- {
- eVOLUME,
- eQUALITY,
- eCOMPLEXITY,
- eNARROWBAND
- };
-
- Q_OBJECT
-public:
- EncRbSpeex(QObject *parent = NULL);
- bool encode(QString input,QString output);
- bool start();
- bool stop() {return true;}
-
- // for settings view
- bool configOk();
- void generateSettings();
- void saveSettings();
-
-private:
- float quality;
- float volume;
- int complexity;
- bool narrowband;
-
- float defaultQuality;
- float defaultVolume;
- int defaultComplexity;
- bool defaultBand;
-};
-
-
#endif
+
diff --git a/rbutil/rbutilqt/base/encoderexe.cpp b/rbutil/rbutilqt/base/encoderexe.cpp
new file mode 100644
index 0000000000..f0f39daad7
--- /dev/null
+++ b/rbutil/rbutilqt/base/encoderexe.cpp
@@ -0,0 +1,94 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ *
+ * Copyright (C) 2007 by Dominik Wenger
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#include <QtCore>
+#include "encoderexe.h"
+#include "rbsettings.h"
+#include "utils.h"
+
+EncoderExe::EncoderExe(QString name,QObject *parent) : EncoderBase(parent)
+{
+ m_name = name;
+
+ m_TemplateMap["lame"] = "\"%exe\" %options \"%input\" \"%output\"";
+
+}
+
+
+
+void EncoderExe::generateSettings()
+{
+ QString exepath =RbSettings::subValue(m_name,RbSettings::EncoderPath).toString();
+ if(exepath == "") exepath = Utils::findExecutable(m_name);
+
+ insertSetting(eEXEPATH,new EncTtsSetting(this,EncTtsSetting::eSTRING,
+ tr("Path to Encoder:"),exepath,EncTtsSetting::eBROWSEBTN));
+ insertSetting(eEXEOPTIONS,new EncTtsSetting(this,EncTtsSetting::eSTRING,
+ tr("Encoder options:"),RbSettings::subValue(m_name,RbSettings::EncoderOptions)));
+}
+
+void EncoderExe::saveSettings()
+{
+ RbSettings::setSubValue(m_name,RbSettings::EncoderPath,getSetting(eEXEPATH)->current().toString());
+ RbSettings::setSubValue(m_name,RbSettings::EncoderOptions,getSetting(eEXEOPTIONS)->current().toString());
+ RbSettings::sync();
+}
+
+bool EncoderExe::start()
+{
+ m_EncExec = RbSettings::subValue(m_name, RbSettings::EncoderPath).toString();
+ m_EncOpts = RbSettings::subValue(m_name, RbSettings::EncoderOptions).toString();
+
+ m_EncTemplate = m_TemplateMap.value(m_name);
+
+ QFileInfo enc(m_EncExec);
+ if(enc.exists())
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+bool EncoderExe::encode(QString input,QString output)
+{
+ //qDebug() << "encoding..";
+ QString execstring = m_EncTemplate;
+
+ execstring.replace("%exe",m_EncExec);
+ execstring.replace("%options",m_EncOpts);
+ execstring.replace("%input",input);
+ execstring.replace("%output",output);
+ qDebug() << "[EncoderExe] cmd: " << execstring;
+ int result = QProcess::execute(execstring);
+ return (result == 0) ? true : false;
+}
+
+
+bool EncoderExe::configOk()
+{
+ QString path = RbSettings::subValue(m_name, RbSettings::EncoderPath).toString();
+
+ if (QFileInfo(path).exists())
+ return true;
+
+ return false;
+}
+
diff --git a/rbutil/rbutilqt/base/encoderexe.h b/rbutil/rbutilqt/base/encoderexe.h
new file mode 100644
index 0000000000..699dc417e1
--- /dev/null
+++ b/rbutil/rbutilqt/base/encoderexe.h
@@ -0,0 +1,55 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ *
+ * Copyright (C) 2007 by Dominik Wenger
+ *
+ * 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.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#ifndef ENCODEREXES_H
+#define ENCODEREXES_H
+
+#include <QtCore>
+#include "encoderbase.h"
+
+class EncoderExe : public EncoderBase
+{
+ enum ESettings
+ {
+ eEXEPATH,
+ eEXEOPTIONS
+ };
+
+ Q_OBJECT
+ public:
+ EncoderExe(QString name,QObject *parent = NULL);
+ bool encode(QString input,QString output);
+ bool start();
+ bool stop() {return true;}
+
+ // setting
+ bool configOk();
+ void generateSettings();
+ void saveSettings();
+
+ private:
+ QString m_name;
+ QString m_EncExec;
+ QString m_EncOpts;
+ QMap<QString,QString> m_TemplateMap;
+ QString m_EncTemplate;
+};
+#endif
+
diff --git a/rbutil/rbutilqt/base/encoders.cpp b/rbutil/rbutilqt/base/encoderrbspeex.cpp
index ea8817bd98..431ab0a872 100644
--- a/rbutil/rbutilqt/base/encoders.cpp
+++ b/rbutil/rbutilqt/base/encoderrbspeex.cpp
@@ -16,145 +16,16 @@
*
****************************************************************************/
-#include "encoders.h"
-#include "utils.h"
+#include <QtCore>
+#include "encoderrbspeex.h"
#include "rbsettings.h"
-/*********************************************************************
-* Encoder Base
-**********************************************************************/
-QMap<QString,QString> EncBase::encoderList;
-
-EncBase::EncBase(QObject *parent): EncTtsSettingInterface(parent)
-{
-
-}
-
-// initialize list of encoders
-void EncBase::initEncodernamesList()
-{
- encoderList["rbspeex"] = "Rockbox Speex Encoder";
- encoderList["lame"] = "Lame Mp3 Encoder";
-}
-
-
-// get nice name for a specific encoder
-QString EncBase::getEncoderName(QString encoder)
-{
- if(encoderList.isEmpty())
- initEncodernamesList();
- return encoderList.value(encoder);
-}
-
-
-// get a specific encoder object
-EncBase* EncBase::getEncoder(QObject* parent,QString encoder)
-{
- EncBase* enc;
- if(encoder == "lame")
- {
- enc = new EncExes(encoder,parent);
- return enc;
- }
- else // rbspeex is default
- {
- enc = new EncRbSpeex(parent);
- return enc;
- }
-}
-
-
-QStringList EncBase::getEncoderList()
-{
- if(encoderList.isEmpty())
- initEncodernamesList();
- return encoderList.keys();
-}
-
-
-/*********************************************************************
-* GEneral Exe Encoder
-**********************************************************************/
-EncExes::EncExes(QString name,QObject *parent) : EncBase(parent)
-{
- m_name = name;
-
- m_TemplateMap["lame"] = "\"%exe\" %options \"%input\" \"%output\"";
-
-}
-
-
-
-void EncExes::generateSettings()
-{
- QString exepath =RbSettings::subValue(m_name,RbSettings::EncoderPath).toString();
- if(exepath == "") exepath = Utils::findExecutable(m_name);
-
- insertSetting(eEXEPATH,new EncTtsSetting(this,EncTtsSetting::eSTRING,
- tr("Path to Encoder:"),exepath,EncTtsSetting::eBROWSEBTN));
- insertSetting(eEXEOPTIONS,new EncTtsSetting(this,EncTtsSetting::eSTRING,
- tr("Encoder options:"),RbSettings::subValue(m_name,RbSettings::EncoderOptions)));
-}
-
-void EncExes::saveSettings()
-{
- RbSettings::setSubValue(m_name,RbSettings::EncoderPath,getSetting(eEXEPATH)->current().toString());
- RbSettings::setSubValue(m_name,RbSettings::EncoderOptions,getSetting(eEXEOPTIONS)->current().toString());
- RbSettings::sync();
-}
-
-bool EncExes::start()
-{
- m_EncExec = RbSettings::subValue(m_name, RbSettings::EncoderPath).toString();
- m_EncOpts = RbSettings::subValue(m_name, RbSettings::EncoderOptions).toString();
-
- m_EncTemplate = m_TemplateMap.value(m_name);
-
- QFileInfo enc(m_EncExec);
- if(enc.exists())
- {
- return true;
- }
- else
- {
- return false;
- }
-}
-
-bool EncExes::encode(QString input,QString output)
-{
- //qDebug() << "encoding..";
- QString execstring = m_EncTemplate;
-
- execstring.replace("%exe",m_EncExec);
- execstring.replace("%options",m_EncOpts);
- execstring.replace("%input",input);
- execstring.replace("%output",output);
- qDebug() << "[EncExes] cmd: " << execstring;
- int result = QProcess::execute(execstring);
- return (result == 0) ? true : false;
-}
-
-
-bool EncExes::configOk()
-{
- QString path = RbSettings::subValue(m_name, RbSettings::EncoderPath).toString();
-
- if (QFileInfo(path).exists())
- return true;
-
- return false;
-}
-
-/*********************************************************************
-* RB SPEEX ENCODER
-**********************************************************************/
-EncRbSpeex::EncRbSpeex(QObject *parent) : EncBase(parent)
+EncoderRbSpeex::EncoderRbSpeex(QObject *parent) : EncoderBase(parent)
{
}
-void EncRbSpeex::generateSettings()
+void EncoderRbSpeex::generateSettings()
{
insertSetting(eVOLUME,new EncTtsSetting(this,EncTtsSetting::eDOUBLE,
tr("Volume:"),RbSettings::subValue("rbspeex",RbSettings::EncoderVolume),1.0,10.0));
@@ -166,7 +37,7 @@ void EncRbSpeex::generateSettings()
tr("Use Narrowband:"),RbSettings::subValue("rbspeex",RbSettings::EncoderNarrowBand)));
}
-void EncRbSpeex::saveSettings()
+void EncoderRbSpeex::saveSettings()
{
//save settings in user config
RbSettings::setSubValue("rbspeex",RbSettings::EncoderVolume,
@@ -181,7 +52,7 @@ void EncRbSpeex::saveSettings()
RbSettings::sync();
}
-bool EncRbSpeex::start()
+bool EncoderRbSpeex::start()
{
// try to get config from settings
@@ -194,7 +65,7 @@ bool EncRbSpeex::start()
return true;
}
-bool EncRbSpeex::encode(QString input,QString output)
+bool EncoderRbSpeex::encode(QString input,QString output)
{
qDebug() << "[RbSpeex] Encoding " << input << " to "<< output;
char errstr[512];
@@ -224,7 +95,7 @@ bool EncRbSpeex::encode(QString input,QString output)
return true;
}
-bool EncRbSpeex::configOk()
+bool EncoderRbSpeex::configOk()
{
bool result=true;
// check config
diff --git a/rbutil/rbutilqt/base/encoderrbspeex.h b/rbutil/rbutilqt/base/encoderrbspeex.h
new file mode 100644
index 0000000000..9f51d8e264
--- /dev/null
+++ b/rbutil/rbutilqt/base/encoderrbspeex.h
@@ -0,0 +1,60 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ *
+ * Copyright (C) 2007 by Dominik Wenger
+ *
+ * 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 ENCODERRBSPEEX_H
+#define ENCODERRBSPEEX_H
+
+#include <QtCore>
+#include "encoderbase.h"
+
+class EncoderRbSpeex : public EncoderBase
+{
+ enum ESettings
+ {
+ eVOLUME,
+ eQUALITY,
+ eCOMPLEXITY,
+ eNARROWBAND
+ };
+
+ Q_OBJECT
+ public:
+ EncoderRbSpeex(QObject *parent = NULL);
+ bool encode(QString input,QString output);
+ bool start();
+ bool stop() {return true;}
+
+ // for settings view
+ bool configOk();
+ void generateSettings();
+ void saveSettings();
+
+ private:
+ float quality;
+ float volume;
+ int complexity;
+ bool narrowband;
+
+ float defaultQuality;
+ float defaultVolume;
+ int defaultComplexity;
+ bool defaultBand;
+};
+
+#endif
+
diff --git a/rbutil/rbutilqt/base/talkgenerator.cpp b/rbutil/rbutilqt/base/talkgenerator.cpp
index 134aa637ad..427df0ed1d 100644
--- a/rbutil/rbutilqt/base/talkgenerator.cpp
+++ b/rbutil/rbutilqt/base/talkgenerator.cpp
@@ -48,7 +48,7 @@ TalkGenerator::Status TalkGenerator::process(QList<TalkEntry>* list,int wavtrimt
// Encoder
emit logItem(tr("Starting Encoder Engine"),LOGINFO);
- m_enc = EncBase::getEncoder(this,SystemInfo::value(SystemInfo::CurEncoder).toString());
+ m_enc = EncoderBase::getEncoder(this,SystemInfo::value(SystemInfo::CurEncoder).toString());
if(!m_enc->start())
{
emit logItem(tr("Init of Encoder engine failed"),LOGERROR);
diff --git a/rbutil/rbutilqt/base/talkgenerator.h b/rbutil/rbutilqt/base/talkgenerator.h
index a446a26342..5fe036e2f1 100644
--- a/rbutil/rbutilqt/base/talkgenerator.h
+++ b/rbutil/rbutilqt/base/talkgenerator.h
@@ -25,7 +25,7 @@
#include <QtCore>
#include "progressloggerinterface.h"
-#include "encoders.h"
+#include "encoderbase.h"
#include "ttsbase.h"
//! \brief Talk generator, generates .wav and .talk files out of a list.
@@ -57,9 +57,9 @@ public:
* for error checking */
struct
{
- EncBase* encoder;
+ EncoderBase* encoder;
TTSBase* tts;
- TalkGenerator* generator;
+ TalkGenerator* generator;
int wavtrim;
} refs;
};
@@ -92,7 +92,7 @@ private:
static void ttsEntryPoint(TalkEntry& entry);
TTSBase* m_tts;
- EncBase* m_enc;
+ EncoderBase* m_enc;
bool m_ttsWarnings;
bool m_userAborted;
diff --git a/rbutil/rbutilqt/configure.cpp b/rbutil/rbutilqt/configure.cpp
index 872fcfaa84..470a5a5d6b 100644
--- a/rbutil/rbutilqt/configure.cpp
+++ b/rbutil/rbutilqt/configure.cpp
@@ -22,7 +22,7 @@
#include "configure.h"
#include "autodetection.h"
#include "ui_configurefrm.h"
-#include "encoders.h"
+#include "encoderbase.h"
#include "ttsbase.h"
#include "system.h"
#include "encttscfggui.h"
@@ -40,6 +40,8 @@
#endif
#include "rbutilqt.h"
+#include "systrace.h"
+
#define DEFAULT_LANG "English (en)"
#define DEFAULT_LANG_CODE "en"
@@ -436,10 +438,10 @@ void Config::updateEncState()
QString devname = ui.treeDevices->selectedItems().at(0)->data(0, Qt::UserRole).toString();
QString encoder = SystemInfo::platformValue(devname,
SystemInfo::CurEncoder).toString();
- ui.encoderName->setText(EncBase::getEncoderName(SystemInfo::platformValue(devname,
+ ui.encoderName->setText(EncoderBase::getEncoderName(SystemInfo::platformValue(devname,
SystemInfo::CurEncoder).toString()));
- EncBase* enc = EncBase::getEncoder(this,encoder);
+ EncoderBase* enc = EncoderBase::getEncoder(this,encoder);
if(enc->configOk())
{
@@ -893,13 +895,13 @@ void Config::configEnc()
QString devname = ui.treeDevices->selectedItems().at(0)->data(0, Qt::UserRole).toString();
QString encoder = SystemInfo::platformValue(devname,
SystemInfo::CurEncoder).toString();
- ui.encoderName->setText(EncBase::getEncoderName(SystemInfo::platformValue(devname,
+ ui.encoderName->setText(EncoderBase::getEncoderName(SystemInfo::platformValue(devname,
SystemInfo::CurEncoder).toString()));
- EncBase* enc = EncBase::getEncoder(this,encoder);
+ EncoderBase* enc = EncoderBase::getEncoder(this,encoder);
- EncTtsCfgGui gui(this,enc,EncBase::getEncoderName(encoder));
+ EncTtsCfgGui gui(this,enc,EncoderBase::getEncoderName(encoder));
gui.exec();
updateEncState();
diff --git a/rbutil/rbutilqt/createvoicewindow.cpp b/rbutil/rbutilqt/createvoicewindow.cpp
index 3b915f62a7..d1db0145e4 100644
--- a/rbutil/rbutilqt/createvoicewindow.cpp
+++ b/rbutil/rbutilqt/createvoicewindow.cpp
@@ -99,14 +99,14 @@ void CreateVoiceWindow::updateSettings(void)
else
ui.labelTtsProfile->setText(tr("Selected TTS engine: <b>%1</b>")
.arg("Invalid TTS configuration!"));
-
+
QString encoder = SystemInfo::value(SystemInfo::CurEncoder).toString();
// only proceed if encoder setting is set
- EncBase* enc = EncBase::getEncoder(this,encoder);
+ EncoderBase* enc = EncoderBase::getEncoder(this,encoder);
if(enc != NULL) {
if(enc->configOk())
ui.labelEncProfile->setText(tr("Selected encoder: <b>%1</b>")
- .arg(EncBase::getEncoderName(encoder)));
+ .arg(EncoderBase::getEncoderName(encoder)));
else
ui.labelEncProfile->setText(tr("Selected encoder: <b>%1</b>")
.arg("Invalid encoder configuration!"));
diff --git a/rbutil/rbutilqt/installtalkwindow.cpp b/rbutil/rbutilqt/installtalkwindow.cpp
index e17bdc43b2..c751b3aad3 100644
--- a/rbutil/rbutilqt/installtalkwindow.cpp
+++ b/rbutil/rbutilqt/installtalkwindow.cpp
@@ -34,7 +34,7 @@ InstallTalkWindow::InstallTalkWindow(QWidget *parent) : QDialog(parent)
ui.recursive->setChecked(true);
ui.GenerateOnlyNew->setChecked(true);
ui.StripExtensions->setChecked(true);
-
+
updateSettings();
}
@@ -62,28 +62,28 @@ void InstallTalkWindow::browseFolder()
void InstallTalkWindow::change()
{
Config *cw = new Config(this,4);
-
+
// make sure the current selected folder doesn't get lost on settings
// changes. If the current selection is invalid don't accept it so
- // it gets reset to the old value after closing the settings dialog.
+ // it gets reset to the old value after closing the settings dialog.
QString folderToTalk = ui.lineTalkFolder->text();
if(QFileInfo(folderToTalk).isDir())
RbSettings::setValue(RbSettings::LastTalkedFolder, folderToTalk);
connect(cw, SIGNAL(settingsUpdated()), this, SLOT(updateSettings()));
-
+
cw->show();
}
void InstallTalkWindow::accept()
{
logger = new ProgressLoggerGui(this);
-
+
connect(logger,SIGNAL(closed()),this,SLOT(close()));
logger->show();
-
+
QString folderToTalk = ui.lineTalkFolder->text();
-
+
if(!QFileInfo(folderToTalk).isDir())
{
logger->addItem(tr("The Folder to Talk is wrong!"),LOGERROR);
@@ -97,19 +97,19 @@ void InstallTalkWindow::accept()
talkcreator->setDir(QDir(folderToTalk));
talkcreator->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString());
-
+
talkcreator->setGenerateOnlyNew(ui.GenerateOnlyNew->isChecked());
talkcreator->setRecursive(ui.recursive->isChecked());
talkcreator->setStripExtensions(ui.StripExtensions->isChecked());
talkcreator->setTalkFolders(ui.talkFolders->isChecked());
talkcreator->setTalkFiles(ui.talkFiles->isChecked());
talkcreator->setIgnoreFiles(ui.ignoreFiles->text().split(",",QString::SkipEmptyParts));
-
+
connect(talkcreator, SIGNAL(done(bool)), logger, SLOT(setFinished()));
connect(talkcreator, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));
connect(talkcreator, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int)));
connect(logger,SIGNAL(aborted()),talkcreator,SLOT(abort()));
-
+
talkcreator->createTalkFiles();
}
@@ -124,13 +124,13 @@ void InstallTalkWindow::updateSettings(void)
else
ui.labelTtsProfile->setText(tr("Selected TTS engine: <b>%1</b>")
.arg("Invalid TTS configuration!"));
-
+
QString encoder = SystemInfo::value(SystemInfo::CurEncoder).toString();
- EncBase* enc = EncBase::getEncoder(this,encoder);
+ EncoderBase* enc = EncoderBase::getEncoder(this,encoder);
if(enc != NULL) {
if(enc->configOk())
ui.labelEncProfile->setText(tr("Selected encoder: <b>%1</b>")
- .arg(EncBase::getEncoderName(encoder)));
+ .arg(EncoderBase::getEncoderName(encoder)));
else
ui.labelEncProfile->setText(tr("Selected encoder: <b>%1</b>")
.arg("Invalid encoder configuration!"));
diff --git a/rbutil/rbutilqt/rbutilqt.pri b/rbutil/rbutilqt/rbutilqt.pri
index c8d3f58546..3f2fdee7b9 100644
--- a/rbutil/rbutilqt/rbutilqt.pri
+++ b/rbutil/rbutilqt/rbutilqt.pri
@@ -33,7 +33,9 @@ SOURCES += \
uninstallwindow.cpp \
base/utils.cpp \
preview.cpp \
- base/encoders.cpp \
+ base/encoderbase.cpp \
+ base/encoderrbspeex.cpp \
+ base/encoderexe.cpp \
encttscfggui.cpp \
base/encttssettings.cpp \
base/ttsbase.cpp \
@@ -95,7 +97,9 @@ HEADERS += \
uninstallwindow.h \
base/utils.h \
preview.h \
- base/encoders.h \
+ base/encoderbase.h \
+ base/encoderrbspeex.h \
+ base/encoderexe.h \
encttscfggui.h \
base/encttssettings.h \
base/ttsbase.h \