summaryrefslogtreecommitdiffstats
path: root/kttsd/plugins/hadifix
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:20:30 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:20:30 +0000
commit28bf3cbba4139c8a0f81dc9d1a2f6c4ed724f22c (patch)
treea2f011f22aa31d0839c6e2118501b7a6d2f2ae96 /kttsd/plugins/hadifix
parent0285229d858c8f03cde7354c679a752598cf4515 (diff)
downloadtdeaccessibility-28bf3cbba4139c8a0f81dc9d1a2f6c4ed724f22c.tar.gz
tdeaccessibility-28bf3cbba4139c8a0f81dc9d1a2f6c4ed724f22c.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaccessibility@1157633 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kttsd/plugins/hadifix')
-rw-r--r--kttsd/plugins/hadifix/hadifixconf.cpp128
-rw-r--r--kttsd/plugins/hadifix/hadifixconf.h16
-rw-r--r--kttsd/plugins/hadifix/hadifixconfigui.ui.h14
-rw-r--r--kttsd/plugins/hadifix/hadifixproc.cpp94
-rw-r--r--kttsd/plugins/hadifix/hadifixproc.h32
-rw-r--r--kttsd/plugins/hadifix/initialconfig.h86
-rw-r--r--kttsd/plugins/hadifix/voicefileui.ui.h2
7 files changed, 186 insertions, 186 deletions
diff --git a/kttsd/plugins/hadifix/hadifixconf.cpp b/kttsd/plugins/hadifix/hadifixconf.cpp
index a2c5547..0249aea 100644
--- a/kttsd/plugins/hadifix/hadifixconf.cpp
+++ b/kttsd/plugins/hadifix/hadifixconf.cpp
@@ -15,14 +15,14 @@
***************************************************************************/
// Qt includes.
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qgroupbox.h>
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qdir.h>
-#include <qfileinfo.h>
-#include <qfile.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqgroupbox.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqdir.h>
+#include <tqfileinfo.h>
+#include <tqfile.h>
// KDE includes.
#include <ktempfile.h>
@@ -63,16 +63,16 @@ class HadifixConfPrivate {
~HadifixConfPrivate() {
if (hadifixProc) hadifixProc->stopText();
delete hadifixProc;
- if (!waveFile.isNull()) QFile::remove(waveFile);
+ if (!waveFile.isNull()) TQFile::remove(waveFile);
delete progressDlg;
};
#include "initialconfig.h"
- void setConfiguration (QString hadifixExec, QString mbrolaExec,
- QString voice, bool male,
+ void setConfiguration (TQString hadifixExec, TQString mbrolaExec,
+ TQString voice, bool male,
int volume, int time, int pitch,
- QString codecName)
+ TQString codecName)
{
configWidget->hadifixURL->setURL (hadifixExec);
configWidget->mbrolaURL->setURL (mbrolaExec);
@@ -86,10 +86,10 @@ class HadifixConfPrivate {
}
void initializeVoices () {
- QStringList::iterator it;
+ TQStringList::iterator it;
for (it = defaultVoices.begin(); it != defaultVoices.end(); ++it) {
HadifixProc::VoiceGender gender;
- QString name = QFileInfo(*it).fileName();
+ TQString name = TQFileInfo(*it).fileName();
gender = HadifixProc::determineGender(defaultMbrolaExec, *it);
if (gender == HadifixProc::MaleGender)
configWidget->addVoice(*it, true, i18n("Male voice \"%1\"").arg(name));
@@ -114,10 +114,10 @@ class HadifixConfPrivate {
}
void setDefaultEncodingFromVoice() {
- QString voiceFile = configWidget->getVoiceFilename();
- QString voiceCode = QFileInfo(voiceFile).baseName(false);
+ TQString voiceFile = configWidget->getVoiceFilename();
+ TQString voiceCode = TQFileInfo(voiceFile).baseName(false);
voiceCode = voiceCode.left(2);
- QString codecName = "Local";
+ TQString codecName = "Local";
if (voiceCode == "de") codecName = "ISO 8859-1";
if (voiceCode == "hu") codecName = "ISO 8859-2";
configWidget->characterCodingBox->setCurrentItem(PlugInProc::codecNameToListIndex(
@@ -125,14 +125,14 @@ class HadifixConfPrivate {
}
void setDefaults () {
- QStringList::iterator it = defaultVoices.begin();
+ TQStringList::iterator it = defaultVoices.begin();
// Find a voice that matches language code, if any.
if (!languageCode.isEmpty())
{
- QString justLang = languageCode.left(2);
+ TQString justLang = languageCode.left(2);
for (;it != defaultVoices.end();++it)
{
- QString voiceCode = QFileInfo(*it).baseName(false).left(2);
+ TQString voiceCode = TQFileInfo(*it).baseName(false).left(2);
if (voiceCode == justLang) break;
}
if (it == defaultVoices.end()) it = defaultVoices.begin();
@@ -145,19 +145,19 @@ class HadifixConfPrivate {
100, 100, 100, "Local");
};
- void load (KConfig *config, const QString &configGroup) {
+ void load (KConfig *config, const TQString &configGroup) {
config->setGroup(configGroup);
- QString voice = config->readEntry("voice", configWidget->getVoiceFilename());
+ TQString voice = config->readEntry("voice", configWidget->getVoiceFilename());
HadifixProc::VoiceGender gender;
gender = HadifixProc::determineGender(defaultMbrolaExec, voice);
bool isMale = (gender == HadifixProc::MaleGender);
- QString defaultCodecName = "Local";
+ TQString defaultCodecName = "Local";
// TODO: Need a better way to determine proper codec for each voice.
// This will do for now.
- QString voiceCode = QFileInfo(voice).baseName(false);
+ TQString voiceCode = TQFileInfo(voice).baseName(false);
if (voiceCode.left(2) == "de") defaultCodecName = "ISO 8859-1";
if (voiceCode.left(2) == "hu") defaultCodecName = "ISO 8859-2";
@@ -173,7 +173,7 @@ class HadifixConfPrivate {
);
};
- void save (KConfig *config, const QString &configGroup) {
+ void save (KConfig *config, const TQString &configGroup) {
config->setGroup(configGroup);
config->writeEntry ("hadifixExec", PlugInConf::realFilePath(configWidget->hadifixURL->url()));
config->writeEntry ("mbrolaExec", PlugInConf::realFilePath(configWidget->mbrolaURL->url()));
@@ -188,14 +188,14 @@ class HadifixConfPrivate {
HadifixConfigUI *configWidget;
- QString languageCode;
- QString defaultHadifixExec;
- QString defaultMbrolaExec;
- QStringList defaultVoices;
- QStringList codecList;
+ TQString languageCode;
+ TQString defaultHadifixExec;
+ TQString defaultMbrolaExec;
+ TQStringList defaultVoices;
+ TQStringList codecList;
// Wave file playing on play object.
- QString waveFile;
+ TQString waveFile;
// Synthesizer.
HadifixProc* hadifixProc;
// Progress Dialog.
@@ -203,24 +203,24 @@ class HadifixConfPrivate {
};
/** Constructor */
-HadifixConf::HadifixConf( QWidget* parent, const char* name, const QStringList &) :
+HadifixConf::HadifixConf( TQWidget* parent, const char* name, const TQStringList &) :
PlugInConf( parent, name ){
// kdDebug() << "HadifixConf::HadifixConf: Running" << endl;
- QVBoxLayout *layout = new QVBoxLayout (this, KDialog::marginHint(), KDialog::spacingHint(), "CommandConfigWidgetLayout");
+ TQVBoxLayout *layout = new TQVBoxLayout (this, KDialog::marginHint(), KDialog::spacingHint(), "CommandConfigWidgetLayout");
layout->setAlignment (Qt::AlignTop);
d = new HadifixConfPrivate();
d->configWidget = new HadifixConfigUI (this, "configWidget");
- QString file = locate("data", "LICENSES/LGPL_V2");
+ TQString file = locate("data", "LICENSES/LGPL_V2");
i18n("This plugin is distributed under the terms of the GPL v2 or later.");
- connect(d->configWidget->voiceButton, SIGNAL(clicked()), this, SLOT(voiceButton_clicked()));
- connect(d->configWidget->testButton, SIGNAL(clicked()), this, SLOT(testButton_clicked()));
- connect(d->configWidget, SIGNAL(changed(bool)), this, SLOT(configChanged (bool)));
- connect(d->configWidget->characterCodingBox, SIGNAL(textChanged(const QString&)),
- this, SLOT(configChanged()));
- connect(d->configWidget->voiceCombo, SIGNAL(activated(int)), this, SLOT(voiceCombo_activated(int)));
+ connect(d->configWidget->voiceButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(voiceButton_clicked()));
+ connect(d->configWidget->testButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(testButton_clicked()));
+ connect(d->configWidget, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(configChanged (bool)));
+ connect(d->configWidget->characterCodingBox, TQT_SIGNAL(textChanged(const TQString&)),
+ this, TQT_SLOT(configChanged()));
+ connect(d->configWidget->voiceCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(voiceCombo_activated(int)));
d->initializeCharacterCodes();
d->initializeVoices();
d->setDefaults();
@@ -233,13 +233,13 @@ HadifixConf::~HadifixConf(){
delete d;
}
-void HadifixConf::load(KConfig *config, const QString &configGroup) {
+void HadifixConf::load(KConfig *config, const TQString &configGroup) {
// kdDebug() << "HadifixConf::load: Running" << endl;
d->setDefaults();
d->load (config, configGroup);
}
-void HadifixConf::save(KConfig *config, const QString &configGroup) {
+void HadifixConf::save(KConfig *config, const TQString &configGroup) {
// kdDebug() << "HadifixConf::save: Running" << endl;
d->save (config, configGroup);
}
@@ -249,22 +249,22 @@ void HadifixConf::defaults() {
d->setDefaults();
}
-void HadifixConf::setDesiredLanguage(const QString &lang)
+void HadifixConf::setDesiredLanguage(const TQString &lang)
{
d->languageCode = lang;
}
-QString HadifixConf::getTalkerCode()
+TQString HadifixConf::getTalkerCode()
{
if (!d->configWidget->hadifixURL->url().isEmpty() && !d->configWidget->mbrolaURL->url().isEmpty())
{
- QString voiceFile = d->configWidget->getVoiceFilename();
- if (QFileInfo(voiceFile).exists())
+ TQString voiceFile = d->configWidget->getVoiceFilename();
+ if (TQFileInfo(voiceFile).exists())
{
// mbrola voice file names usually start with two-letter language code,
// but this is by no means guaranteed.
- QString voiceCode = QFileInfo(voiceFile).baseName(false);
- QString voiceLangCode = voiceCode.left(2);
+ TQString voiceCode = TQFileInfo(voiceFile).baseName(false);
+ TQString voiceLangCode = voiceCode.left(2);
if (d->languageCode.left(2) != voiceLangCode)
{
// Verify that first two letters of voice filename are a valid language code.
@@ -272,15 +272,15 @@ QString HadifixConf::getTalkerCode()
if (!TalkerCode::languageCodeToLanguage(voiceLangCode).isEmpty())
d->languageCode = voiceLangCode;
}
- QString gender = "male";
+ TQString gender = "male";
if (!d->configWidget->isMaleVoice()) gender = "female";
- QString volume = "medium";
+ TQString volume = "medium";
if (d->configWidget->volumeBox->value() < 75) volume = "soft";
if (d->configWidget->volumeBox->value() > 125) volume = "loud";
- QString rate = "medium";
+ TQString rate = "medium";
if (d->configWidget->timeBox->value() < 75) rate = "slow";
if (d->configWidget->timeBox->value() > 125) rate = "fast";
- return QString(
+ return TQString(
"<voice lang=\"%1\" name=\"%2\" gender=\"%3\" />"
"<prosody volume=\"%4\" rate=\"%5\" />"
"<kttsd synthesizer=\"%6\" />")
@@ -292,7 +292,7 @@ QString HadifixConf::getTalkerCode()
.arg("Hadifix");
}
}
- return QString::null;
+ return TQString::null;
}
void HadifixConf::voiceButton_clicked () {
@@ -308,7 +308,7 @@ void HadifixConf::voiceButton_clicked () {
widget->voiceFileURL->setURL(d->configWidget->getVoiceFilename());
widget->mbrola = d->defaultMbrolaExec;
- if (dialog->exec() == QDialog::Accepted) {
+ if (dialog->exec() == TQDialog::Accepted) {
d->configWidget->setVoice (widget->voiceFileURL->url(),
widget->maleOption->isChecked());
d->setDefaultEncodingFromVoice();
@@ -330,11 +330,11 @@ void HadifixConf::testButton_clicked () {
else
{
d->hadifixProc = new HadifixProc();
- connect (d->hadifixProc, SIGNAL(stopped()), this, SLOT(slotSynthStopped()));
+ connect (d->hadifixProc, TQT_SIGNAL(stopped()), this, TQT_SLOT(slotSynthStopped()));
}
// Create a temp file name for the wave file.
KTempFile tempFile (locateLocal("tmp", "hadifixplugin-"), ".wav");
- QString tmpWaveFile = tempFile.file()->name();
+ TQString tmpWaveFile = tempFile.file()->name();
tempFile.close();
// Tell user to wait.
@@ -352,9 +352,9 @@ void HadifixConf::testButton_clicked () {
// italian, and a few others, written in perl, but they have many issues.
// Go to the mbrola website and click on "TTS" to learn more.
- // QString testMsg = "K D E ist eine moderne grafische Arbeitsumgebung für UNIX-Computer.";
- QString testMsg = testMessage(d->languageCode);
- connect (d->hadifixProc, SIGNAL(synthFinished()), this, SLOT(slotSynthFinished()));
+ // TQString testMsg = "K D E ist eine moderne grafische Arbeitsumgebung für UNIX-Computer.";
+ TQString testMsg = testMessage(d->languageCode);
+ connect (d->hadifixProc, TQT_SIGNAL(synthFinished()), this, TQT_SLOT(slotSynthFinished()));
d->hadifixProc->synth (testMsg,
realFilePath(d->configWidget->hadifixURL->url()),
d->configWidget->isMaleVoice(),
@@ -369,7 +369,7 @@ void HadifixConf::testButton_clicked () {
// Display progress dialog modally. Processing continues when plugin signals synthFinished,
// or if user clicks Cancel button.
d->progressDlg->exec();
- disconnect (d->hadifixProc, SIGNAL(synthFinished()), this, SLOT(slotSynthFinished()));
+ disconnect (d->hadifixProc, TQT_SIGNAL(synthFinished()), this, TQT_SLOT(slotSynthFinished()));
if (d->progressDlg->wasCancelled()) d->hadifixProc->stopText();
delete d->progressDlg;
d->progressDlg = 0;
@@ -392,15 +392,15 @@ void HadifixConf::slotSynthFinished()
// Play the wave file (possibly adjusting its Speed).
// Player object deletes the wave file when done.
if (m_player) m_player->play(d->waveFile);
- QFile::remove(d->waveFile);
- d->waveFile = QString::null;
+ TQFile::remove(d->waveFile);
+ d->waveFile = TQString::null;
if (d->progressDlg) d->progressDlg->close();
}
void HadifixConf::slotSynthStopped()
{
// Clean up after canceling test.
- QString filename = d->hadifixProc->getFilename();
+ TQString filename = d->hadifixProc->getFilename();
// kdDebug() << "HadifixConf::slotSynthStopped: filename = " << filename << endl;
- if (!filename.isNull()) QFile::remove(filename);
+ if (!filename.isNull()) TQFile::remove(filename);
}
diff --git a/kttsd/plugins/hadifix/hadifixconf.h b/kttsd/plugins/hadifix/hadifixconf.h
index a53ecb1..4ef96a6 100644
--- a/kttsd/plugins/hadifix/hadifixconf.h
+++ b/kttsd/plugins/hadifix/hadifixconf.h
@@ -1,7 +1,7 @@
#ifndef _HADIFIXCONF_H_
#define _HADIFIXCONF_H_
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include <kconfig.h>
@@ -15,7 +15,7 @@ class HadifixConf : public PlugInConf {
public:
/** Constructor */
- HadifixConf( QWidget* parent = 0, const char* name = 0, const QStringList &args = QStringList());
+ HadifixConf( TQWidget* parent = 0, const char* name = 0, const TQStringList &args = TQStringList());
/** Destructor */
~HadifixConf();
@@ -26,13 +26,13 @@ class HadifixConf : public PlugInConf {
the control center, to undo all of his changes and restore the currently
valid settings. NOTE that this is not called after the modules is loaded,
so you probably want to call this method in the constructor.*/
- void load(KConfig *config, const QString &configGroup);
+ void load(KConfig *config, const TQString &configGroup);
/** This function gets called when the user wants to save the settings in
the user interface, updating the config files or wherever the
configuration is stored. The method is called when the user clicks "Apply"
or "Ok". */
- void save(KConfig *config, const QString &configGroup);
+ void save(KConfig *config, const TQString &configGroup);
/** This function is called to set the settings in the module to sensible
default values. It gets called when hitting the "Default" button. The
@@ -44,7 +44,7 @@ class HadifixConf : public PlugInConf {
* This function informs the plugin of the desired language to be spoken
* by the plugin. The plugin should attempt to adapt itself to the
* specified language code, choosing sensible defaults if necessary.
- * If the passed-in code is QString::null, no specific language has
+ * If the passed-in code is TQString::null, no specific language has
* been chosen.
* @param lang The desired language code or Null if none.
*
@@ -56,16 +56,16 @@ class HadifixConf : public PlugInConf {
* not the given country, treat it as though the country
* code were not specified, i.e., adapt to the given language.
*/
- void setDesiredLanguage(const QString &lang);
+ void setDesiredLanguage(const TQString &lang);
/**
* Return fully-specified talker code for the configured plugin. This code
* uniquely identifies the configured instance of the plugin and distinquishes
* one instance from another. If the plugin has not been fully configured,
- * i.e., cannot yet synthesize, return QString::null.
+ * i.e., cannot yet synthesize, return TQString::null.
* @return Fully-specified talker code.
*/
- QString getTalkerCode();
+ TQString getTalkerCode();
public slots:
void configChanged(bool t = true){emit changed(t);};
diff --git a/kttsd/plugins/hadifix/hadifixconfigui.ui.h b/kttsd/plugins/hadifix/hadifixconfigui.ui.h
index e3a7a04..7c21c54 100644
--- a/kttsd/plugins/hadifix/hadifixconfigui.ui.h
+++ b/kttsd/plugins/hadifix/hadifixconfigui.ui.h
@@ -51,7 +51,7 @@ void HadifixConfigUI::init () {
female = KGlobal::iconLoader()->loadIcon("female", KIcon::Small);
}
-void HadifixConfigUI::addVoice (const QString &filename, bool isMale) {
+void HadifixConfigUI::addVoice (const TQString &filename, bool isMale) {
if (isMale) {
if (!maleVoices.contains(filename)) {
int id = voiceCombo->count();
@@ -68,7 +68,7 @@ void HadifixConfigUI::addVoice (const QString &filename, bool isMale) {
}
}
-void HadifixConfigUI::addVoice (const QString &filename, bool isMale, const QString &displayname) {
+void HadifixConfigUI::addVoice (const TQString &filename, bool isMale, const TQString &displayname) {
addVoice (filename, isMale);
if (isMale) {
@@ -81,7 +81,7 @@ void HadifixConfigUI::addVoice (const QString &filename, bool isMale, const QStr
}
}
-void HadifixConfigUI::setVoice (const QString &filename, bool isMale) {
+void HadifixConfigUI::setVoice (const TQString &filename, bool isMale) {
addVoice (filename, isMale);
if (isMale)
voiceCombo->setCurrentItem (maleVoices[filename]);
@@ -89,10 +89,10 @@ void HadifixConfigUI::setVoice (const QString &filename, bool isMale) {
voiceCombo->setCurrentItem (femaleVoices[filename]);
}
-QString HadifixConfigUI::getVoiceFilename() {
+TQString HadifixConfigUI::getVoiceFilename() {
int curr = voiceCombo->currentItem();
- QString filename = voiceCombo->text(curr);
+ TQString filename = voiceCombo->text(curr);
if (defaultVoices.contains(curr))
filename = defaultVoices[curr];
@@ -101,7 +101,7 @@ QString HadifixConfigUI::getVoiceFilename() {
bool HadifixConfigUI::isMaleVoice() {
int curr = voiceCombo->currentItem();
- QString filename = getVoiceFilename();
+ TQString filename = getVoiceFilename();
if (maleVoices.contains(filename))
return maleVoices[filename] == curr;
@@ -109,6 +109,6 @@ bool HadifixConfigUI::isMaleVoice() {
return false;
}
-void HadifixConfigUI::changed (const QString &) {
+void HadifixConfigUI::changed (const TQString &) {
emit changed (true);
}
diff --git a/kttsd/plugins/hadifix/hadifixproc.cpp b/kttsd/plugins/hadifix/hadifixproc.cpp
index 42730b3..598eb21 100644
--- a/kttsd/plugins/hadifix/hadifixproc.cpp
+++ b/kttsd/plugins/hadifix/hadifixproc.cpp
@@ -16,9 +16,9 @@
* *
***************************************************************************/
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qtextcodec.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqtextcodec.h>
#include <kdebug.h>
#include <kconfig.h>
@@ -35,7 +35,7 @@ class HadifixProcPrivate {
hadifixProc = 0;
waitingStop = false;
state = psIdle;
- synthFilename = QString::null;
+ synthFilename = TQString::null;
gender = false;
volume = 100;
time = 100;
@@ -47,11 +47,11 @@ class HadifixProcPrivate {
delete hadifixProc;
};
- void load(KConfig *config, const QString &configGroup) {
+ void load(KConfig *config, const TQString &configGroup) {
config->setGroup(configGroup);
- hadifix = config->readEntry ("hadifixExec", QString::null);
- mbrola = config->readEntry ("mbrolaExec", QString::null);
- voice = config->readEntry ("voice", QString::null);
+ hadifix = config->readEntry ("hadifixExec", TQString::null);
+ mbrola = config->readEntry ("mbrolaExec", TQString::null);
+ voice = config->readEntry ("voice", TQString::null);
gender = config->readBoolEntry("gender", false);
volume = config->readNumEntry ("volume", 100);
time = config->readNumEntry ("time", 100);
@@ -59,9 +59,9 @@ class HadifixProcPrivate {
codec = PlugInProc::codecNameToCodec(config->readEntry ("codec", "Local"));
};
- QString hadifix;
- QString mbrola;
- QString voice;
+ TQString hadifix;
+ TQString mbrola;
+ TQString voice;
bool gender;
int volume;
int time;
@@ -70,12 +70,12 @@ class HadifixProcPrivate {
bool waitingStop;
KShellProcess* hadifixProc;
volatile pluginState state;
- QTextCodec* codec;
- QString synthFilename;
+ TQTextCodec* codec;
+ TQString synthFilename;
};
/** Constructor */
-HadifixProc::HadifixProc( QObject* parent, const char* name, const QStringList &) :
+HadifixProc::HadifixProc( TQObject* parent, const char* name, const TQStringList &) :
PlugInProc( parent, name ){
// kdDebug() << "HadifixProc::HadifixProc: Running" << endl;
d = 0;
@@ -92,7 +92,7 @@ HadifixProc::~HadifixProc(){
}
/** Initializate the speech */
-bool HadifixProc::init(KConfig *config, const QString &configGroup){
+bool HadifixProc::init(KConfig *config, const TQString &configGroup){
// kdDebug() << "HadifixProc::init: Initializing plug in: Hadifix" << endl;
if (d == 0)
@@ -110,7 +110,7 @@ bool HadifixProc::init(KConfig *config, const QString &configGroup){
* It must also implement the @ref getState method, which must return
* psFinished, when saying is completed.
*/
-void HadifixProc::sayText(const QString& /*text*/)
+void HadifixProc::sayText(const TQString& /*text*/)
{
kdDebug() << "HadifixProc::sayText: Warning, sayText not implemented." << endl;
return;
@@ -129,7 +129,7 @@ void HadifixProc::sayText(const QString& /*text*/)
* It must also implement the @ref getState method, which must return
* psFinished, when synthesis is completed.
*/
-void HadifixProc::synthText(const QString &text, const QString &suggestedFilename)
+void HadifixProc::synthText(const TQString &text, const TQString &suggestedFilename)
{
if (d == 0) return; // Caller should have called init.
synth(text, d->hadifix, d->gender, d->mbrola, d->voice, d->volume,
@@ -148,12 +148,12 @@ void HadifixProc::synthText(const QString &text, const QString &suggestedFilenam
* @param pitch Frequency. 100 = normal
* @param waveFilename Name of file to synthesize to.
*/
-void HadifixProc::synth(QString text,
- QString hadifix, bool isMale,
- QString mbrola, QString voice,
+void HadifixProc::synth(TQString text,
+ TQString hadifix, bool isMale,
+ TQString mbrola, TQString voice,
int volume, int time, int pitch,
- QTextCodec *codec,
- const QString waveFilename)
+ TQTextCodec *codec,
+ const TQString waveFilename)
{
// kdDebug() << "HadifixProc::synth: Saying text: '" << text << "' using Hadifix plug in" << endl;
if (d == 0)
@@ -176,31 +176,31 @@ void HadifixProc::synth(QString text,
// Set up txt2pho and mbrola commands.
// kdDebug() << "HadifixProc::synth: setting up commands" << endl;
- QString hadifixCommand = d->hadifixProc->quote(hadifix);
+ TQString hadifixCommand = d->hadifixProc->quote(hadifix);
if (isMale)
hadifixCommand += " -m";
else
hadifixCommand += " -f";
- QString mbrolaCommand = d->hadifixProc->quote(mbrola);
+ TQString mbrolaCommand = d->hadifixProc->quote(mbrola);
mbrolaCommand += " -e"; //Ignore fatal errors on unkown diphone
- mbrolaCommand += QString(" -v %1").arg(volume/100.0); // volume ratio
- mbrolaCommand += QString(" -f %1").arg(pitch/100.0); // freqency ratio
- mbrolaCommand += QString(" -t %1").arg(1/(time/100.0)); // time ratio
+ mbrolaCommand += TQString(" -v %1").arg(volume/100.0); // volume ratio
+ mbrolaCommand += TQString(" -f %1").arg(pitch/100.0); // freqency ratio
+ mbrolaCommand += TQString(" -t %1").arg(1/(time/100.0)); // time ratio
mbrolaCommand += " " + d->hadifixProc->quote(voice);
mbrolaCommand += " - " + d->hadifixProc->quote(waveFilename);
// kdDebug() << "HadifixProc::synth: Hadifix command: " << hadifixCommand << endl;
// kdDebug() << "HadifixProc::synth: Mbrola command: " << mbrolaCommand << endl;
- QString command = hadifixCommand + "|" + mbrolaCommand;
+ TQString command = hadifixCommand + "|" + mbrolaCommand;
*(d->hadifixProc) << command;
// Connect signals from process.
- connect(d->hadifixProc, SIGNAL(processExited(KProcess *)),
- this, SLOT(slotProcessExited(KProcess *)));
- connect(d->hadifixProc, SIGNAL(wroteStdin(KProcess *)),
- this, SLOT(slotWroteStdin(KProcess *)));
+ connect(d->hadifixProc, TQT_SIGNAL(processExited(KProcess *)),
+ this, TQT_SLOT(slotProcessExited(KProcess *)));
+ connect(d->hadifixProc, TQT_SIGNAL(wroteStdin(KProcess *)),
+ this, TQT_SLOT(slotWroteStdin(KProcess *)));
// Store off name of wave file to be generated.
d->synthFilename = waveFilename;
@@ -211,7 +211,7 @@ void HadifixProc::synth(QString text,
kdDebug() << "HadifixProc::synth: start process failed." << endl;
d->state = psIdle;
} else {
- QCString encodedText;
+ TQCString encodedText;
if (codec) {
encodedText = codec->fromUnicode(text);
// kdDebug() << "HadifixProc::synth: encoding using " << codec->name() << endl;
@@ -231,7 +231,7 @@ void HadifixProc::synth(QString text,
* be locked when this method is called. The file will be deleted when
* KTTSD is finished using it.
*/
-QString HadifixProc::getFilename() { return d->synthFilename; }
+TQString HadifixProc::getFilename() { return d->synthFilename; }
/**
* Stop current operation (saying or synthesizing text).
@@ -285,7 +285,7 @@ void HadifixProc::ackFinished()
if (d->state == psFinished)
{
d->state = psIdle;
- d->synthFilename = QString::null;
+ d->synthFilename = TQString::null;
}
}
@@ -345,27 +345,27 @@ void HadifixProc::slotWroteStdin(KProcess*)
* Static function to determine whether the voice file is male or female.
* @param mbrola the mbrola executable
* @param voice the voice file
-* @param output the output of mbrola will be written into this QString*
+* @param output the output of mbrola will be written into this TQString*
* @return HadifixSpeech::MaleGender if the voice is male,
* HadifixSpeech::FemaleGender if the voice is female,
* HadifixSpeech::NoGender if the gender cannot be determined,
* HadifixSpeech::NoVoice if there is an error in the voice file
*/
-HadifixProc::VoiceGender HadifixProc::determineGender(QString mbrola, QString voice, QString *output)
+HadifixProc::VoiceGender HadifixProc::determineGender(TQString mbrola, TQString voice, TQString *output)
{
- QString command = mbrola + " -i " + voice + " - -";
+ TQString command = mbrola + " -i " + voice + " - -";
// create a new process
HadifixProc speech;
KShellProcess proc;
proc << command;
- connect(&proc, SIGNAL(receivedStdout(KProcess *, char *, int)),
- &speech, SLOT(receivedStdout(KProcess *, char *, int)));
- connect(&proc, SIGNAL(receivedStderr(KProcess *, char *, int)),
- &speech, SLOT(receivedStderr(KProcess *, char *, int)));
+ connect(&proc, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)),
+ &speech, TQT_SLOT(receivedStdout(KProcess *, char *, int)));
+ connect(&proc, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)),
+ &speech, TQT_SLOT(receivedStderr(KProcess *, char *, int)));
- speech.stdOut = QString::null;
- speech.stdErr = QString::null;
+ speech.stdOut = TQString::null;
+ speech.stdErr = TQString::null;
proc.start (KProcess::Block, KProcess::AllOutput);
VoiceGender result;
@@ -389,11 +389,11 @@ HadifixProc::VoiceGender HadifixProc::determineGender(QString mbrola, QString vo
}
void HadifixProc::receivedStdout (KProcess *, char *buffer, int buflen) {
- stdOut += QString::fromLatin1(buffer, buflen);
+ stdOut += TQString::fromLatin1(buffer, buflen);
}
void HadifixProc::receivedStderr (KProcess *, char *buffer, int buflen) {
- stdErr += QString::fromLatin1(buffer, buflen);
+ stdErr += TQString::fromLatin1(buffer, buflen);
}
/**
@@ -405,7 +405,7 @@ void HadifixProc::receivedStderr (KProcess *, char *buffer, int buflen) {
* tags and converts the file to plain text.
* @return Name of the XSLT file.
*/
-QString HadifixProc::getSsmlXsltFilename()
+TQString HadifixProc::getSsmlXsltFilename()
{
return KGlobal::dirs()->resourceDirs("data").last() + "kttsd/hadifix/xslt/SSMLtoTxt2pho.xsl";
}
diff --git a/kttsd/plugins/hadifix/hadifixproc.h b/kttsd/plugins/hadifix/hadifixproc.h
index 225c7ed..01b7c5d 100644
--- a/kttsd/plugins/hadifix/hadifixproc.h
+++ b/kttsd/plugins/hadifix/hadifixproc.h
@@ -18,7 +18,7 @@
#ifndef _HADIFIXPROC_H_
#define _HADIFIXPROC_H_
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include <pluginproc.h>
@@ -37,13 +37,13 @@ class HadifixProc : public PlugInProc{
};
/** Constructor */
- HadifixProc( QObject* parent = 0, const char* name = 0, const QStringList &args = QStringList());
+ HadifixProc( TQObject* parent = 0, const char* name = 0, const TQStringList &args = TQStringList());
/** Destructor */
~HadifixProc();
/** Initializate the speech */
- virtual bool init (KConfig *config, const QString &configGroup);
+ virtual bool init (KConfig *config, const TQString &configGroup);
/**
* Say a text. Synthesize and audibilize it.
@@ -54,7 +54,7 @@ class HadifixProc : public PlugInProc{
* It must also implement the @ref getState method, which must return
* psFinished, when saying is completed.
*/
- virtual void sayText(const QString &text);
+ virtual void sayText(const TQString &text);
/**
* Synthesize text into an audio file, but do not send to the audio device.
@@ -69,7 +69,7 @@ class HadifixProc : public PlugInProc{
* It must also implement the @ref getState method, which must return
* psFinished, when synthesis is completed.
*/
- virtual void synthText(const QString &text, const QString &suggestedFilename);
+ virtual void synthText(const TQString &text, const TQString &suggestedFilename);
/**
* Get the generated audio filename from call to @ref synthText.
@@ -80,7 +80,7 @@ class HadifixProc : public PlugInProc{
* be locked when this method is called. The file will be deleted when
* KTTSD is finished using it.
*/
- virtual QString getFilename();
+ virtual TQString getFilename();
/**
* Stop current operation (saying or synthesizing text).
@@ -156,24 +156,24 @@ class HadifixProc : public PlugInProc{
* @param pitch Frequency. 100 = normal
* @param waveFilename Name of file to synthesize to.
*/
- void synth(QString text,
- QString hadifix, bool isMale,
- QString mbrola, QString voice,
+ void synth(TQString text,
+ TQString hadifix, bool isMale,
+ TQString mbrola, TQString voice,
int volume, int time, int pitch,
- QTextCodec* codec,
- const QString waveFilename);
+ TQTextCodec* codec,
+ const TQString waveFilename);
/**
* Static function to determine whether the voice file is male or female.
* @param mbrola the mbrola executable
* @param voice the voice file
- * @param output the output of mbrola will be written into this QString*
+ * @param output the output of mbrola will be written into this TQString*
* @return HadifixSpeech::MaleGender if the voice is male,
* HadifixSpeech::FemaleGender if the voice is female,
* HadifixSpeech::NoGender if the gender cannot be determined,
* HadifixSpeech::NoVoice if there is an error in the voice file
*/
- static VoiceGender determineGender(QString mbrola, QString voice, QString *output = 0);
+ static VoiceGender determineGender(TQString mbrola, TQString voice, TQString *output = 0);
/**
* Returns the name of an XSLT stylesheet that will convert a valid SSML file
@@ -184,7 +184,7 @@ class HadifixProc : public PlugInProc{
* tags and converts the file to plain text.
* @return Name of the XSLT file.
*/
- virtual QString getSsmlXsltFilename();
+ virtual TQString getSsmlXsltFilename();
private slots:
void slotProcessExited(KProcess*);
@@ -196,8 +196,8 @@ class HadifixProc : public PlugInProc{
private:
HadifixProcPrivate *d;
- QString stdOut;
- QString stdErr;
+ TQString stdOut;
+ TQString stdErr;
};
#endif
diff --git a/kttsd/plugins/hadifix/initialconfig.h b/kttsd/plugins/hadifix/initialconfig.h
index 4fac632..02e920c 100644
--- a/kttsd/plugins/hadifix/initialconfig.h
+++ b/kttsd/plugins/hadifix/initialconfig.h
@@ -5,31 +5,31 @@
* installation directories.
*/
void findInitialConfig() {
- QString hadifixDataPath = findHadifixDataPath();
+ TQString hadifixDataPath = findHadifixDataPath();
defaultHadifixExec = findExecutable("txt2pho", hadifixDataPath+"/../");
- QStringList list; list += "mbrola"; list += "mbrola-linux-i386";
+ TQStringList list; list += "mbrola"; list += "mbrola-linux-i386";
defaultMbrolaExec = findExecutable(list, hadifixDataPath+"/../../mbrola/");
defaultVoices = findVoices (defaultMbrolaExec, hadifixDataPath);
}
/** Tries to find the hadifix data path by looking into a number of files. */
-QString findHadifixDataPath () {
- QStringList files;
+TQString findHadifixDataPath () {
+ TQStringList files;
files += "/etc/txt2pho";
- files += QDir::homeDirPath()+"/.txt2phorc";
+ files += TQDir::homeDirPath()+"/.txt2phorc";
- QStringList::iterator it;
+ TQStringList::iterator it;
for (it = files.begin(); it != files.end(); ++it) {
- QFile file(*it);
+ TQFile file(*it);
if ( file.open(IO_ReadOnly) ) {
- QTextStream stream(&file);
+ TQTextStream stream(&file);
while (!stream.atEnd()) {
- QString s = stream.readLine().stripWhiteSpace();
+ TQString s = stream.readLine().stripWhiteSpace();
// look for a line "DATAPATH=..."
if (s.startsWith("DATAPATH")) {
@@ -39,7 +39,7 @@ QString findHadifixDataPath () {
if (s.startsWith("/"))
return s;
else {
- QFileInfo info (QFileInfo(*it).dirPath() + "/" + s);
+ TQFileInfo info (TQFileInfo(*it).dirPath() + "/" + s);
return info.absFilePath();
}
}
@@ -52,81 +52,81 @@ QString findHadifixDataPath () {
}
/** Tries to find the an executable by looking onto the hard disk. */
-QString findExecutable (const QStringList &names, const QString &possiblePath) {
+TQString findExecutable (const TQStringList &names, const TQString &possiblePath) {
// a) Try to find it directly
- QStringList::ConstIterator it;
- QStringList::ConstIterator itEnd = names.constEnd();
+ TQStringList::ConstIterator it;
+ TQStringList::ConstIterator itEnd = names.constEnd();
for (it = names.constBegin(); it != itEnd; ++it) {
- QString executable = KStandardDirs::findExe (*it);
+ TQString executable = KStandardDirs::findExe (*it);
if (!executable.isNull() && !executable.isEmpty())
return executable;
}
// b) Try to find it in the path specified by the second parameter
for (it = names.constBegin(); it != itEnd; ++it) {
- QFileInfo info (possiblePath+*it);
+ TQFileInfo info (possiblePath+*it);
if (info.exists() && info.isExecutable() && info.isFile()) {
return info.absFilePath();
}
}
// Both tries failed, so the user has to locate the executable.
- return QString::null;
+ return TQString::null;
}
/** Tries to find the voice files by looking onto the hard disk. */
-QStringList findVoices(QString mbrolaExec, const QString &hadifixDataPath) {
+TQStringList findVoices(TQString mbrolaExec, const TQString &hadifixDataPath) {
// First of all:
// dereference links to the mbrola executable (if mbrolaExec is a link).
for (int i = 0; i < 10; ++i) {
// If we have a chain of more than ten links something is surely wrong.
- QFileInfo info (mbrolaExec);
+ TQFileInfo info (mbrolaExec);
if (info.exists() && info.isSymLink())
mbrolaExec = info.readLink();
}
// Second:
// create a list of directories that possibly contain voice files
- QStringList list;
+ TQStringList list;
// 2a) search near the mbrola executable
- QFileInfo info (mbrolaExec);
+ TQFileInfo info (mbrolaExec);
if (info.exists() && info.isFile() && info.isExecutable()) {
- QString mbrolaPath = info.dirPath (true);
+ TQString mbrolaPath = info.dirPath (true);
list += mbrolaPath;
}
// 2b) search near the hadifix data path
info.setFile(hadifixDataPath + "../../mbrola");
- QString mbrolaPath = info.dirPath (true) + "/mbrola";
+ TQString mbrolaPath = info.dirPath (true) + "/mbrola";
if (!list.contains(mbrolaPath))
list += mbrolaPath;
// 2c) broaden the search by adding subdirs (with a depth of 2)
- QStringList subDirs = findSubdirs (list);
- QStringList subSubDirs = findSubdirs (subDirs);
+ TQStringList subDirs = findSubdirs (list);
+ TQStringList subSubDirs = findSubdirs (subDirs);
list += subDirs;
list += subSubDirs;
// Third:
// look into each of these directories and search for voice files.
- QStringList result;
- QStringList::iterator it;
+ TQStringList result;
+ TQStringList::iterator it;
for (it = list.begin(); it != list.end(); ++it) {
- QDir baseDir (*it, QString::null,
- QDir::Name|QDir::IgnoreCase, QDir::Files);
- QStringList files = baseDir.entryList();
+ TQDir baseDir (*it, TQString::null,
+ TQDir::Name|TQDir::IgnoreCase, TQDir::Files);
+ TQStringList files = baseDir.entryList();
- QStringList::iterator iter;
+ TQStringList::iterator iter;
for (iter = files.begin(); iter != files.end(); ++iter) {
// Voice files start with "MBROLA", but are afterwards binary files
- QString filename = *it + "/" + *iter;
- QFile file (filename);
+ TQString filename = *it + "/" + *iter;
+ TQFile file (filename);
if (file.open(IO_ReadOnly)) {
- QTextStream stream(&file);
+ TQTextStream stream(&file);
if (!stream.atEnd()) {
- QString s = stream.readLine();
+ TQString s = stream.readLine();
if (s.startsWith("MBROLA"))
if (HadifixProc::determineGender(mbrolaExec, filename)
!= HadifixProc::NoVoice
@@ -141,20 +141,20 @@ QStringList findVoices(QString mbrolaExec, const QString &hadifixDataPath) {
}
/** Returns a list of subdirs (with absolute paths) */
-QStringList findSubdirs (const QStringList &baseDirs) {
- QStringList result;
+TQStringList findSubdirs (const TQStringList &baseDirs) {
+ TQStringList result;
- QStringList::ConstIterator it;
- QStringList::ConstIterator itEnd = baseDirs.constEnd();
+ TQStringList::ConstIterator it;
+ TQStringList::ConstIterator itEnd = baseDirs.constEnd();
for (it = baseDirs.constBegin(); it != itEnd; ++it) {
// a) get a list of directory names
- QDir baseDir (*it, QString::null,
- QDir::Name|QDir::IgnoreCase, QDir::Dirs);
- QStringList list = baseDir.entryList();
+ TQDir baseDir (*it, TQString::null,
+ TQDir::Name|TQDir::IgnoreCase, TQDir::Dirs);
+ TQStringList list = baseDir.entryList();
// b) produce absolute paths
- QStringList::ConstIterator iter;
- QStringList::ConstIterator iterEnd = list.constEnd();
+ TQStringList::ConstIterator iter;
+ TQStringList::ConstIterator iterEnd = list.constEnd();
for (iter = list.constBegin(); iter != iterEnd; ++iter) {
if ((*iter != ".") && (*iter != ".."))
result += *it + "/" + *iter;
diff --git a/kttsd/plugins/hadifix/voicefileui.ui.h b/kttsd/plugins/hadifix/voicefileui.ui.h
index 9d37375..16e65e5 100644
--- a/kttsd/plugins/hadifix/voicefileui.ui.h
+++ b/kttsd/plugins/hadifix/voicefileui.ui.h
@@ -11,7 +11,7 @@
void VoiceFileWidget::genderButton_clicked()
{
HadifixProc::VoiceGender gender;
- QString details;
+ TQString details;
gender = HadifixProc::determineGender(mbrola, voiceFileURL->url(), &details);
if (gender == HadifixProc::MaleGender) {