summaryrefslogtreecommitdiffstats
path: root/kttsd/plugins/freetts
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/freetts
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/freetts')
-rw-r--r--kttsd/plugins/freetts/freettsconf.cpp72
-rw-r--r--kttsd/plugins/freetts/freettsconf.h24
-rw-r--r--kttsd/plugins/freetts/freettsproc.cpp60
-rw-r--r--kttsd/plugins/freetts/freettsproc.h24
4 files changed, 90 insertions, 90 deletions
diff --git a/kttsd/plugins/freetts/freettsconf.cpp b/kttsd/plugins/freetts/freettsconf.cpp
index 701af5e..05c1fab 100644
--- a/kttsd/plugins/freetts/freettsconf.cpp
+++ b/kttsd/plugins/freetts/freettsconf.cpp
@@ -16,12 +16,12 @@
***************************************************************************/
// Qt includes.
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qfile.h>
-#include <qapplication.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqfile.h>
+#include <tqapplication.h>
// KDE includes.
#include <kdialog.h>
@@ -40,14 +40,14 @@
#include "freettsconfigwidget.h"
/** Constructor */
-FreeTTSConf::FreeTTSConf( QWidget* parent, const char* name, const QStringList&/*args*/) :
+FreeTTSConf::FreeTTSConf( TQWidget* parent, const char* name, const TQStringList&/*args*/) :
PlugInConf( parent, name ) {
// kdDebug() << "FreeTTSConf::FreeTTSConf: Running" << endl;
m_freettsProc = 0;
m_progressDlg = 0;
- QVBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(),
+ TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(),
KDialog::spacingHint(), "FreeTTSConfigWidgetLayout");
layout->setAlignment (Qt::AlignTop);
m_widget = new FreeTTSConfWidget(this, "FreeTTSConfigWidget");
@@ -55,28 +55,28 @@ FreeTTSConf::FreeTTSConf( QWidget* parent, const char* name, const QStringList&/
defaults();
- connect(m_widget->freettsPath, SIGNAL(textChanged(const QString&)),
- this, SLOT(configChanged()));
- connect(m_widget->freettsTest, SIGNAL(clicked()), this, SLOT(slotFreeTTSTest_clicked()));
+ connect(m_widget->freettsPath, TQT_SIGNAL(textChanged(const TQString&)),
+ this, TQT_SLOT(configChanged()));
+ connect(m_widget->freettsTest, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotFreeTTSTest_clicked()));
}
/** Destructor */
FreeTTSConf::~FreeTTSConf() {
// kdDebug() << "Running: FreeTTSConf::~FreeTTSConf()" << endl;
- if (!m_waveFile.isNull()) QFile::remove(m_waveFile);
+ if (!m_waveFile.isNull()) TQFile::remove(m_waveFile);
delete m_freettsProc;
delete m_progressDlg;
}
-void FreeTTSConf::load(KConfig *config, const QString &configGroup) {
+void FreeTTSConf::load(KConfig *config, const TQString &configGroup) {
// kdDebug() << "FreeTTSConf::load: Running" << endl;
config->setGroup(configGroup);
- QString freeTTSJar = config->readEntry("FreeTTSJarPath", QString::null);
+ TQString freeTTSJar = config->readEntry("FreeTTSJarPath", TQString::null);
if (freeTTSJar.isEmpty())
{
config->setGroup("FreeTTS");
- freeTTSJar = config->readEntry("FreeTTSJarPath", QString::null);
+ freeTTSJar = config->readEntry("FreeTTSJarPath", TQString::null);
}
if (freeTTSJar.isEmpty())
freeTTSJar = getLocation("freetts.jar");
@@ -84,7 +84,7 @@ void FreeTTSConf::load(KConfig *config, const QString &configGroup) {
/// If freettsPath is still empty, then we couldn't find the file in the path.
}
-void FreeTTSConf::save(KConfig *config, const QString &configGroup){
+void FreeTTSConf::save(KConfig *config, const TQString &configGroup){
// kdDebug() << "FreeTTSConf::save: Running" << endl;
config->setGroup("FreeTTS");
@@ -103,19 +103,19 @@ void FreeTTSConf::defaults(){
m_widget->freettsPath->setURL("");
}
-void FreeTTSConf::setDesiredLanguage(const QString &lang)
+void FreeTTSConf::setDesiredLanguage(const TQString &lang)
{
m_languageCode = lang;
}
-QString FreeTTSConf::getTalkerCode()
+TQString FreeTTSConf::getTalkerCode()
{
- QString freeTTSJar = realFilePath(m_widget->freettsPath->url());
+ TQString freeTTSJar = realFilePath(m_widget->freettsPath->url());
if (!freeTTSJar.isEmpty())
{
if (!getLocation(freeTTSJar).isEmpty())
{
- return QString(
+ return TQString(
"<voice lang=\"%1\" name=\"%2\" gender=\"%3\" />"
"<prosody volume=\"%4\" rate=\"%5\" />"
"<kttsd synthesizer=\"%6\" />")
@@ -127,25 +127,25 @@ QString FreeTTSConf::getTalkerCode()
.arg("FreeTTS");
}
}
- return QString::null;
+ return TQString::null;
}
-// QString FreeTTSConf::getLocation(const QString &name) {
+// TQString FreeTTSConf::getLocation(const TQString &name) {
// /// Iterate over the path and see if 'name' exists in it. Return the
-// /// full path to it if it does. Else return an empty QString.
+// /// full path to it if it does. Else return an empty TQString.
// kdDebug() << "FreeTTSConf::getLocation: Searching for " << name << " in the path... " << endl;
// kdDebug() << m_path << endl;
-// for(QStringList::iterator it = m_path.begin(); it != m_path.end(); ++it) {
-// QString fullName = *it;
+// for(TQStringList::iterator it = m_path.begin(); it != m_path.end(); ++it) {
+// TQString fullName = *it;
// fullName += "/";
// fullName += name;
// /// The user either has the directory of the file in the path...
-// if(QFile::exists(fullName)) {
+// if(TQFile::exists(fullName)) {
// return fullName;
// kdDebug() << fullName << endl;
// }
// /// ....Or the file itself
-// else if(QFileInfo(*it).baseName().append(QString(".").append(QFileInfo(*it).extension())) == name) {
+// else if(TQFileInfo(*it).baseName().append(TQString(".").append(TQFileInfo(*it).extension())) == name) {
// return fullName;
// kdDebug() << fullName << endl;
// }
@@ -163,15 +163,15 @@ void FreeTTSConf::slotFreeTTSTest_clicked()
else
{
m_freettsProc = new FreeTTSProc();
- connect (m_freettsProc, SIGNAL(stopped()), this, SLOT(slotSynthStopped()));
+ connect (m_freettsProc, TQT_SIGNAL(stopped()), this, TQT_SLOT(slotSynthStopped()));
}
// Create a temp file name for the wave file.
KTempFile tempFile (locateLocal("tmp", "freettsplugin-"), ".wav");
- QString tmpWaveFile = tempFile.file()->name();
+ TQString tmpWaveFile = tempFile.file()->name();
tempFile.close();
// Get test message in the language of the voice.
- QString testMsg = testMessage(m_languageCode);
+ TQString testMsg = testMessage(m_languageCode);
// Tell user to wait.
m_progressDlg = new KProgressDialog(m_widget, "kttsmgr_freetts_testdlg",
@@ -183,7 +183,7 @@ void FreeTTSConf::slotFreeTTSTest_clicked()
// I think FreeTTS only officialy supports English, but if anyone knows of someone
// whos built up a different language lexicon and has it working with FreeTTS gimme an email at ceruleanblaze@gmail.com
- connect (m_freettsProc, SIGNAL(synthFinished()), this, SLOT(slotSynthFinished()));
+ connect (m_freettsProc, TQT_SIGNAL(synthFinished()), this, TQT_SLOT(slotSynthFinished()));
m_freettsProc->synth(
testMsg,
tmpWaveFile,
@@ -192,7 +192,7 @@ void FreeTTSConf::slotFreeTTSTest_clicked()
// Display progress dialog modally. Processing continues when plugin signals synthFinished,
// or if user clicks Cancel button.
m_progressDlg->exec();
- disconnect (m_freettsProc, SIGNAL(synthFinished()), this, SLOT(slotSynthFinished()));
+ disconnect (m_freettsProc, TQT_SIGNAL(synthFinished()), this, TQT_SLOT(slotSynthFinished()));
if (m_progressDlg->wasCancelled()) m_freettsProc->stopText();
delete m_progressDlg;
m_progressDlg = 0;
@@ -215,16 +215,16 @@ void FreeTTSConf::slotSynthFinished()
// Play the wave file (possibly adjusting its Speed).
// Player object deletes the wave file when done.
if (m_player) m_player->play(m_waveFile);
- QFile::remove(m_waveFile);
- m_waveFile = QString::null;
+ TQFile::remove(m_waveFile);
+ m_waveFile = TQString::null;
if (m_progressDlg) m_progressDlg->close();
}
void FreeTTSConf::slotSynthStopped()
{
// Clean up after canceling test.
- QString filename = m_freettsProc->getFilename();
- if (!filename.isNull()) QFile::remove(filename);
+ TQString filename = m_freettsProc->getFilename();
+ if (!filename.isNull()) TQFile::remove(filename);
}
#include "freettsconf.moc"
diff --git a/kttsd/plugins/freetts/freettsconf.h b/kttsd/plugins/freetts/freettsconf.h
index 9ab3ae8..b8e252e 100644
--- a/kttsd/plugins/freetts/freettsconf.h
+++ b/kttsd/plugins/freetts/freettsconf.h
@@ -18,7 +18,7 @@
#ifndef _FREETTSCONF_H_
#define _FREETTSCONF_H_
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include <kdebug.h>
#include <kconfig.h>
@@ -36,7 +36,7 @@ class FreeTTSConf : public PlugInConf {
public:
/** Constructor */
- FreeTTSConf( QWidget* parent = 0, const char* name = 0, const QStringList &args = QStringList());
+ FreeTTSConf( TQWidget* parent = 0, const char* name = 0, const TQStringList &args = TQStringList());
/** Destructor */
~FreeTTSConf();
@@ -47,13 +47,13 @@ class FreeTTSConf : 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
@@ -65,7 +65,7 @@ class FreeTTSConf : 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.
*
@@ -77,22 +77,22 @@ class FreeTTSConf : 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();
/**
* Function searches the $PATH for a file. If it exists, it returns the full path
- * to that file. If not, then it returns an empty QString.
+ * to that file. If not, then it returns an empty TQString.
* @param name The name of the file to search for.
- * @returns The full path to the file or an empty QString.
+ * @returns The full path to the file or an empty TQString.
*/
private slots:
@@ -105,7 +105,7 @@ class FreeTTSConf : public PlugInConf {
private:
/// Language code.
- QString m_languageCode;
+ TQString m_languageCode;
/// Configuration Widget.
FreeTTSConfWidget *m_widget;
@@ -114,7 +114,7 @@ class FreeTTSConf : public PlugInConf {
FreeTTSProc *m_freettsProc;
/// Synthesized wave file name.
- QString m_waveFile;
+ TQString m_waveFile;
/// Progress dialog.
KProgressDialog* m_progressDlg;
diff --git a/kttsd/plugins/freetts/freettsproc.cpp b/kttsd/plugins/freetts/freettsproc.cpp
index 829fee9..9c038af 100644
--- a/kttsd/plugins/freetts/freettsproc.cpp
+++ b/kttsd/plugins/freetts/freettsproc.cpp
@@ -15,9 +15,9 @@
* *
***************************************************************************/
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qfileinfo.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqfileinfo.h>
#include <kdebug.h>
#include <kconfig.h>
@@ -27,7 +27,7 @@
#include "freettsproc.h"
/** Constructor */
-FreeTTSProc::FreeTTSProc( QObject* parent, const char* name, const QStringList& /*args*/) :
+FreeTTSProc::FreeTTSProc( TQObject* parent, const char* name, const TQStringList& /*args*/) :
PlugInProc( parent, name ) {
kdDebug() << "Running: FreeTTSProc::FreeTTSProc" << endl;
m_state = psIdle;
@@ -45,7 +45,7 @@ FreeTTSProc::~FreeTTSProc() {
}
/** Initializate the speech */
-bool FreeTTSProc::init(KConfig *config, const QString &configGroup) {
+bool FreeTTSProc::init(KConfig *config, const TQString &configGroup) {
kdDebug() << "Running: FreeTTSProc::init()" << endl;
kdDebug() << "Initializing plug in: FreeTTS" << endl;
config->setGroup(configGroup);
@@ -60,8 +60,8 @@ bool FreeTTSProc::init(KConfig *config, const QString &configGroup) {
*
* If the plugin supports asynchronous operation, it should return immediately.
*/
-void FreeTTSProc::sayText(const QString &text) {
- synth(text, QString::null, m_freettsJarPath);
+void FreeTTSProc::sayText(const TQString &text) {
+ synth(text, TQString::null, m_freettsJarPath);
}
/**
@@ -74,24 +74,24 @@ void FreeTTSProc::sayText(const QString &text) {
*
* If the plugin supports asynchronous operation, it should return immediately.
*/
-void FreeTTSProc::synthText(const QString& text, const QString& suggestedFilename) {
+void FreeTTSProc::synthText(const TQString& text, const TQString& suggestedFilename) {
kdDebug() << "Running: FreeTTSProc::synthText" << endl;
synth(text, suggestedFilename, m_freettsJarPath);
}
-// A little helper function because KDE 3.2 kdDebug() does not support QValueList<QCString>.
-QStringList argsToQStringList(const QValueList<QCString> list)
+// A little helper function because KDE 3.2 kdDebug() does not support TQValueList<TQCString>.
+TQStringList argsToQStringList(const TQValueList<TQCString> list)
{
- QStringList newList;
- QValueList<QCString>::ConstIterator it = list.begin();
+ TQStringList newList;
+ TQValueList<TQCString>::ConstIterator it = list.begin();
for ( ; it != list.end(); ++it ) newList.append(*it);
return newList;
}
void FreeTTSProc::synth(
- const QString &text,
- const QString &synthFilename,
- const QString& freettsJarPath) {
+ const TQString &text,
+ const TQString &synthFilename,
+ const TQString& freettsJarPath) {
kdDebug() << "Running: FreeTTSProc::synth" << endl;
@@ -103,21 +103,21 @@ void FreeTTSProc::synth(
}
m_freettsProc = new KProcess;
- connect(m_freettsProc, SIGNAL(processExited(KProcess*)),
- this, SLOT(slotProcessExited(KProcess*)));
- connect(m_freettsProc, SIGNAL(receivedStdout(KProcess*, char*, int)),
- this, SLOT(slotReceivedStdout(KProcess*, char*, int)));
- connect(m_freettsProc, SIGNAL(receivedStderr(KProcess*, char*, int)),
- this, SLOT(slotReceivedStderr(KProcess*, char*, int)));
- connect(m_freettsProc, SIGNAL(wroteStdin(KProcess*)),
- this, SLOT(slotWroteStdin(KProcess* )));
+ connect(m_freettsProc, TQT_SIGNAL(processExited(KProcess*)),
+ this, TQT_SLOT(slotProcessExited(KProcess*)));
+ connect(m_freettsProc, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)),
+ this, TQT_SLOT(slotReceivedStdout(KProcess*, char*, int)));
+ connect(m_freettsProc, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)),
+ this, TQT_SLOT(slotReceivedStderr(KProcess*, char*, int)));
+ connect(m_freettsProc, TQT_SIGNAL(wroteStdin(KProcess*)),
+ this, TQT_SLOT(slotWroteStdin(KProcess* )));
if (synthFilename.isNull())
m_state = psSaying;
else
m_state = psSynthing;
- QString saidText = text;
+ TQString saidText = text;
saidText += "\n";
/// As freetts.jar doesn't seem to like being called from an absolute path,
@@ -125,8 +125,8 @@ void FreeTTSProc::synth(
/// KProcess::setWorkingDirectory()
/// We could just strip off 11 characters from the end of the path to freetts.jar, but thats
/// not exactly very portable...
- QString filename = QFileInfo(freettsJarPath).baseName().append(QString(".").append(QFileInfo(freettsJarPath).extension()));
- QString freettsJarDir = freettsJarPath.left((freettsJarPath.length() - filename.length()) - 1);
+ TQString filename = TQFileInfo(freettsJarPath).baseName().append(TQString(".").append(TQFileInfo(freettsJarPath).extension()));
+ TQString freettsJarDir = freettsJarPath.left((freettsJarPath.length() - filename.length()) - 1);
m_freettsProc->setWorkingDirectory(freettsJarDir);
kdDebug() << "FreeTTSProc::synthText: moved to directory '" << freettsJarDir << "'" << endl;
@@ -154,7 +154,7 @@ void FreeTTSProc::synth(
* Returning the filename of the synth'd text
* @returns The filename of the last synth'd text
*/
-QString FreeTTSProc::getFilename() {
+TQString FreeTTSProc::getFilename() {
kdDebug() << "FreeTTSProc::getFilename: returning " << m_synthFilename << endl;
return m_synthFilename;
}
@@ -206,12 +206,12 @@ void FreeTTSProc::slotProcessExited(KProcess*) {
}
void FreeTTSProc::slotReceivedStdout(KProcess*, char* buffer, int buflen) {
- QString buf = QString::fromLatin1(buffer, buflen);
+ TQString buf = TQString::fromLatin1(buffer, buflen);
kdDebug() << "FreeTTSProc::slotReceivedStdout: Received output from FreeTTS: " << buf << endl;
}
void FreeTTSProc::slotReceivedStderr(KProcess*, char* buffer, int buflen) {
- QString buf = QString::fromLatin1(buffer, buflen);
+ TQString buf = TQString::fromLatin1(buffer, buflen);
kdDebug() << "FreeTTSProc::slotReceivedStderr: Received error from FreeTTS: " << buf << endl;
}
@@ -242,7 +242,7 @@ pluginState FreeTTSProc::getState() {
void FreeTTSProc::ackFinished() {
if (m_state == psFinished) {
m_state = psIdle;
- m_synthFilename = QString::null;
+ m_synthFilename = TQString::null;
}
}
diff --git a/kttsd/plugins/freetts/freettsproc.h b/kttsd/plugins/freetts/freettsproc.h
index b2bb631..7dbc3b5 100644
--- a/kttsd/plugins/freetts/freettsproc.h
+++ b/kttsd/plugins/freetts/freettsproc.h
@@ -19,8 +19,8 @@
#define _FREETTSPROC_H_
-#include <qstringlist.h>
-#include <qmutex.h>
+#include <tqstringlist.h>
+#include <tqmutex.h>
#include <pluginproc.h>
@@ -33,7 +33,7 @@ public:
/**
* Constructor
*/
- FreeTTSProc( QObject* parent = 0, const char* name = 0, const QStringList &args = QStringList());
+ FreeTTSProc( TQObject* parent = 0, const char* name = 0, const TQStringList &args = TQStringList());
/**
* Destructor
@@ -45,13 +45,13 @@ public:
* @param config Settings object.
* @param configGroup Settings group.
*/
- virtual bool init(KConfig *config, const QString &configGroup);
+ virtual bool init(KConfig *config, const TQString &configGroup);
/**
* Say a text string.
* @param text The text to speak.
*/
- 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.
@@ -63,7 +63,7 @@ public:
*
* If the plugin supports asynchronous operation, it should return immediately.
*/
- virtual void synthText(const QString& text, const QString& suggestedFilename);
+ virtual void synthText(const TQString& text, const TQString& suggestedFilename);
/**
* Get the generated audio filename from synthText.
@@ -72,7 +72,7 @@ public:
*
* The plugin must not re-use the filename.
*/
- virtual QString getFilename();
+ virtual TQString getFilename();
/**
* Stop current operation (saying or synthesizing text).
@@ -137,9 +137,9 @@ public:
* @param freettsJarPath Path to the freetts jar file.
*/
void synth(
- const QString &text,
- const QString &synthFilename,
- const QString &freettsJarPath);
+ const TQString &text,
+ const TQString &synthFilename,
+ const TQString &freettsJarPath);
private slots:
void slotProcessExited(KProcess* proc);
@@ -152,7 +152,7 @@ private:
/**
* Path to FreeTTS jar file (from config).
*/
- QString m_freettsJarPath;
+ TQString m_freettsJarPath;
/**
* FreeTTS process
@@ -162,7 +162,7 @@ private:
/**
* Synthesis filename.
*/
- QString m_synthFilename;
+ TQString m_synthFilename;
/**
* Plugin state.