From be0e197190c0d4af347c5532b8ab8229279d940e Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Fri, 6 Jan 2012 19:19:32 +0000 Subject: [PATCH] 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 --- rbutil/rbutilqt/base/encoderbase.cpp | 75 +++++++++++ rbutil/rbutilqt/base/{encoders.h => encoderbase.h} | 83 ++---------- rbutil/rbutilqt/base/encoderexe.cpp | 94 +++++++++++++ rbutil/rbutilqt/base/encoderexe.h | 55 ++++++++ .../base/{encoders.cpp => encoderrbspeex.cpp} | 145 ++------------------- rbutil/rbutilqt/base/encoderrbspeex.h | 60 +++++++++ rbutil/rbutilqt/base/talkgenerator.cpp | 2 +- rbutil/rbutilqt/base/talkgenerator.h | 8 +- rbutil/rbutilqt/configure.cpp | 14 +- rbutil/rbutilqt/createvoicewindow.cpp | 6 +- rbutil/rbutilqt/installtalkwindow.cpp | 26 ++-- rbutil/rbutilqt/rbutilqt.pri | 8 +- 12 files changed, 337 insertions(+), 239 deletions(-) create mode 100644 rbutil/rbutilqt/base/encoderbase.cpp rename rbutil/rbutilqt/base/{encoders.h => encoderbase.h} (58%) create mode 100644 rbutil/rbutilqt/base/encoderexe.cpp create mode 100644 rbutil/rbutilqt/base/encoderexe.h rename rbutil/rbutilqt/base/{encoders.cpp => encoderrbspeex.cpp} (51%) create mode 100644 rbutil/rbutilqt/base/encoderrbspeex.h 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 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 similarity index 58% rename from rbutil/rbutilqt/base/encoders.h rename to 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 - + #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 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 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 +#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 +#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 m_TemplateMap; + QString m_EncTemplate; +}; +#endif + diff --git a/rbutil/rbutilqt/base/encoders.cpp b/rbutil/rbutilqt/base/encoderrbspeex.cpp similarity index 51% rename from rbutil/rbutilqt/base/encoders.cpp rename to 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 +#include "encoderrbspeex.h" #include "rbsettings.h" -/********************************************************************* -* Encoder Base -**********************************************************************/ -QMap 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 +#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* 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 #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: %1") .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: %1") - .arg(EncBase::getEncoderName(encoder))); + .arg(EncoderBase::getEncoderName(encoder))); else ui.labelEncProfile->setText(tr("Selected encoder: %1") .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: %1") .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: %1") - .arg(EncBase::getEncoderName(encoder))); + .arg(EncoderBase::getEncoderName(encoder))); else ui.labelEncProfile->setText(tr("Selected encoder: %1") .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 \ -- 2.11.4.GIT