diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:20:30 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:20:30 +0000 |
commit | 28bf3cbba4139c8a0f81dc9d1a2f6c4ed724f22c (patch) | |
tree | a2f011f22aa31d0839c6e2118501b7a6d2f2ae96 /kttsd/plugins/flite | |
parent | 0285229d858c8f03cde7354c679a752598cf4515 (diff) | |
download | tdeaccessibility-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/flite')
-rw-r--r-- | kttsd/plugins/flite/fliteconf.cpp | 52 | ||||
-rw-r--r-- | kttsd/plugins/flite/fliteconf.h | 20 | ||||
-rw-r--r-- | kttsd/plugins/flite/fliteproc.cpp | 50 | ||||
-rw-r--r-- | kttsd/plugins/flite/fliteproc.h | 24 |
4 files changed, 73 insertions, 73 deletions
diff --git a/kttsd/plugins/flite/fliteconf.cpp b/kttsd/plugins/flite/fliteconf.cpp index cbc4b2d..0dfb6d1 100644 --- a/kttsd/plugins/flite/fliteconf.cpp +++ b/kttsd/plugins/flite/fliteconf.cpp @@ -22,9 +22,9 @@ ******************************************************************************/ // Qt includes. -#include <qlayout.h> -#include <qfile.h> -#include <qapplication.h> +#include <tqlayout.h> +#include <tqfile.h> +#include <tqapplication.h> // KDE includes. #include <klocale.h> @@ -42,14 +42,14 @@ #include "fliteconf.moc" /** Constructor */ -FliteConf::FliteConf( QWidget* parent, const char* name, const QStringList& /*args*/) : +FliteConf::FliteConf( TQWidget* parent, const char* name, const TQStringList& /*args*/) : PlugInConf(parent, name) { // kdDebug() << "FliteConf::FliteConf: Running" << endl; m_fliteProc = 0; m_progressDlg = 0; - QVBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), + TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint(), "FliteConfigWidgetLayout"); layout->setAlignment (Qt::AlignTop); m_widget = new FliteConfWidget(this, "FliteConfigWidget"); @@ -57,24 +57,24 @@ FliteConf::FliteConf( QWidget* parent, const char* name, const QStringList& /*ar defaults(); - connect(m_widget->flitePath, SIGNAL(textChanged(const QString&)), - this, SLOT(configChanged())); - connect(m_widget->fliteTest, SIGNAL(clicked()), this, SLOT(slotFliteTest_clicked())); + connect(m_widget->flitePath, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(configChanged())); + connect(m_widget->fliteTest, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotFliteTest_clicked())); } /** Destructor */ FliteConf::~FliteConf(){ // kdDebug() << "Running: FliteConf::~FliteConf()" << endl; - if (!m_waveFile.isNull()) QFile::remove(m_waveFile); + if (!m_waveFile.isNull()) TQFile::remove(m_waveFile); delete m_fliteProc; delete m_progressDlg; } -void FliteConf::load(KConfig *config, const QString &configGroup){ +void FliteConf::load(KConfig *config, const TQString &configGroup){ // kdDebug() << "FliteConf::load: Loading configuration for language " << langGroup << " with plug in " << "Festival Lite (flite)" << endl; config->setGroup(configGroup); - QString fliteExe = config->readEntry("FliteExePath", QString::null); + TQString fliteExe = config->readEntry("FliteExePath", TQString::null); if (fliteExe.isEmpty()) { config->setGroup("Flite"); @@ -83,7 +83,7 @@ void FliteConf::load(KConfig *config, const QString &configGroup){ m_widget->flitePath->setURL(fliteExe); } -void FliteConf::save(KConfig *config, const QString &configGroup){ +void FliteConf::save(KConfig *config, const TQString &configGroup){ // kdDebug() << "FliteConf::save: Saving configuration for language " << langGroup << " with plug in " << "Festival Lite (flite)" << endl; config->setGroup("Flite"); @@ -99,19 +99,19 @@ void FliteConf::defaults(){ m_widget->flitePath->setURL("flite"); } -void FliteConf::setDesiredLanguage(const QString &lang) +void FliteConf::setDesiredLanguage(const TQString &lang) { m_languageCode = lang; } -QString FliteConf::getTalkerCode() +TQString FliteConf::getTalkerCode() { - QString fliteExe = realFilePath(m_widget->flitePath->url()); + TQString fliteExe = realFilePath(m_widget->flitePath->url()); if (!fliteExe.isEmpty()) { if (!getLocation(fliteExe).isEmpty()) { - return QString( + return TQString( "<voice lang=\"%1\" name=\"%2\" gender=\"%3\" />" "<prosody volume=\"%4\" rate=\"%5\" />" "<kttsd synthesizer=\"%6\" />") @@ -123,7 +123,7 @@ QString FliteConf::getTalkerCode() .arg("Festival Lite (flite)"); } } - return QString::null; + return TQString::null; } void FliteConf::slotFliteTest_clicked() @@ -135,15 +135,15 @@ void FliteConf::slotFliteTest_clicked() else { m_fliteProc = new FliteProc(); - connect (m_fliteProc, SIGNAL(stopped()), this, SLOT(slotSynthStopped())); + connect (m_fliteProc, TQT_SIGNAL(stopped()), this, TQT_SLOT(slotSynthStopped())); } // Create a temp file name for the wave file. KTempFile tempFile (locateLocal("tmp", "fliteplugin-"), ".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_flite_testdlg", @@ -154,7 +154,7 @@ void FliteConf::slotFliteTest_clicked() m_progressDlg->setAllowCancel(true); // Play an English test. Flite only supports English. - connect (m_fliteProc, SIGNAL(synthFinished()), this, SLOT(slotSynthFinished())); + connect (m_fliteProc, TQT_SIGNAL(synthFinished()), this, TQT_SLOT(slotSynthFinished())); m_fliteProc->synth( testMsg, tmpWaveFile, @@ -163,7 +163,7 @@ void FliteConf::slotFliteTest_clicked() // Display progress dialog modally. Processing continues when plugin signals synthFinished, // or if user clicks Cancel button. m_progressDlg->exec(); - disconnect (m_fliteProc, SIGNAL(synthFinished()), this, SLOT(slotSynthFinished())); + disconnect (m_fliteProc, TQT_SIGNAL(synthFinished()), this, TQT_SLOT(slotSynthFinished())); if (m_progressDlg->wasCancelled()) m_fliteProc->stopText(); delete m_progressDlg; m_progressDlg = 0; @@ -186,14 +186,14 @@ void FliteConf::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 FliteConf::slotSynthStopped() { // Clean up after canceling test. - QString filename = m_fliteProc->getFilename(); - if (!filename.isNull()) QFile::remove(filename); + TQString filename = m_fliteProc->getFilename(); + if (!filename.isNull()) TQFile::remove(filename); } diff --git a/kttsd/plugins/flite/fliteconf.h b/kttsd/plugins/flite/fliteconf.h index aa26c7b..6d5ff06 100644 --- a/kttsd/plugins/flite/fliteconf.h +++ b/kttsd/plugins/flite/fliteconf.h @@ -25,7 +25,7 @@ #define _FLITECONF_H_ // Qt includes. -#include <qstring.h> +#include <tqstring.h> // KDE includes. #include <kconfig.h> @@ -45,7 +45,7 @@ class FliteConf : public PlugInConf { public: /** Constructor */ - FliteConf( QWidget* parent = 0, const char* name = 0, const QStringList &args = QStringList()); + FliteConf( TQWidget* parent = 0, const char* name = 0, const TQStringList &args = TQStringList()); /** Destructor */ ~FliteConf(); @@ -57,14 +57,14 @@ class FliteConf : public PlugInConf { * 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 @@ -77,7 +77,7 @@ class FliteConf : 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. * @@ -89,16 +89,16 @@ class FliteConf : 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(); private slots: void configChanged(){ @@ -111,13 +111,13 @@ class FliteConf : public PlugInConf { private: // Language code. - QString m_languageCode; + TQString m_languageCode; // Configuration Widget. FliteConfWidget* m_widget; // Flite synthesizer. FliteProc* m_fliteProc; // Synthesized wave file name. - QString m_waveFile; + TQString m_waveFile; // Progress dialog. KProgressDialog* m_progressDlg; }; diff --git a/kttsd/plugins/flite/fliteproc.cpp b/kttsd/plugins/flite/fliteproc.cpp index 54b15e3..55cb0fa 100644 --- a/kttsd/plugins/flite/fliteproc.cpp +++ b/kttsd/plugins/flite/fliteproc.cpp @@ -22,8 +22,8 @@ ******************************************************************************/ // Qt includes. -#include <qstring.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqstringlist.h> // KDE includes. #include <kdebug.h> @@ -36,7 +36,7 @@ #include "fliteproc.moc" /** Constructor */ -FliteProc::FliteProc( QObject* parent, const char* name, const QStringList& ) : +FliteProc::FliteProc( TQObject* parent, const char* name, const TQStringList& ) : PlugInProc( parent, name ){ kdDebug() << "FliteProc::FliteProc: Running" << endl; m_state = psIdle; @@ -55,8 +55,8 @@ FliteProc::~FliteProc(){ } /** Initialize the speech */ -bool FliteProc::init(KConfig* config, const QString& configGroup){ - // kdDebug() << "Running: FliteProc::init(const QString &lang)" << endl; +bool FliteProc::init(KConfig* config, const TQString& configGroup){ + // kdDebug() << "Running: FliteProc::init(const TQString &lang)" << endl; // kdDebug() << "Initializing plug in: Flite" << endl; // Retrieve path to flite executable. config->setGroup(configGroup); @@ -71,9 +71,9 @@ bool FliteProc::init(KConfig* config, const QString& configGroup){ * * If the plugin supports asynchronous operation, it should return immediately. */ -void FliteProc::sayText(const QString &text) +void FliteProc::sayText(const TQString &text) { - synth(text, QString::null, m_fliteExePath); + synth(text, TQString::null, m_fliteExePath); } /** @@ -86,7 +86,7 @@ void FliteProc::sayText(const QString &text) * * If the plugin supports asynchronous operation, it should return immediately. */ -void FliteProc::synthText(const QString& text, const QString& suggestedFilename) +void FliteProc::synthText(const TQString& text, const TQString& suggestedFilename) { synth(text, suggestedFilename, m_fliteExePath); } @@ -98,11 +98,11 @@ void FliteProc::synthText(const QString& text, const QString& suggestedFilename) * synthesize and audibilize the text. */ void FliteProc::synth( - const QString &text, - const QString &synthFilename, - const QString& fliteExePath) + const TQString &text, + const TQString &synthFilename, + const TQString& fliteExePath) { - // kdDebug() << "Running: FliteProc::synth(const QString &text)" << endl; + // kdDebug() << "Running: FliteProc::synth(const TQString &text)" << endl; if (m_fliteProc) { @@ -112,14 +112,14 @@ void FliteProc::synth( } // kdDebug()<< "FliteProc::synth: Creating Flite object" << endl; m_fliteProc = new KProcess; - connect(m_fliteProc, SIGNAL(processExited(KProcess*)), - this, SLOT(slotProcessExited(KProcess*))); - connect(m_fliteProc, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(slotReceivedStdout(KProcess*, char*, int))); - connect(m_fliteProc, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedStderr(KProcess*, char*, int))); - connect(m_fliteProc, SIGNAL(wroteStdin(KProcess*)), - this, SLOT(slotWroteStdin(KProcess* ))); + connect(m_fliteProc, TQT_SIGNAL(processExited(KProcess*)), + this, TQT_SLOT(slotProcessExited(KProcess*))); + connect(m_fliteProc, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedStdout(KProcess*, char*, int))); + connect(m_fliteProc, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedStderr(KProcess*, char*, int))); + connect(m_fliteProc, TQT_SIGNAL(wroteStdin(KProcess*)), + this, TQT_SLOT(slotWroteStdin(KProcess* ))); if (synthFilename.isNull()) m_state = psSaying; else @@ -127,7 +127,7 @@ void FliteProc::synth( // Encode quotation characters. - QString saidText = text; + TQString saidText = text; /* saidText.replace("\\\"", "#!#!"); saidText.replace("\"", "\\\""); @@ -162,7 +162,7 @@ void FliteProc::synth( * * The plugin must not re-use the filename. */ -QString FliteProc::getFilename() +TQString FliteProc::getFilename() { kdDebug() << "FliteProc::getFilename: returning " << m_synthFilename << endl; return m_synthFilename; @@ -218,13 +218,13 @@ void FliteProc::slotProcessExited(KProcess*) void FliteProc::slotReceivedStdout(KProcess*, char* buffer, int buflen) { - QString buf = QString::fromLatin1(buffer, buflen); + TQString buf = TQString::fromLatin1(buffer, buflen); kdDebug() << "FliteProc::slotReceivedStdout: Received output from Flite: " << buf << endl; } void FliteProc::slotReceivedStderr(KProcess*, char* buffer, int buflen) { - QString buf = QString::fromLatin1(buffer, buflen); + TQString buf = TQString::fromLatin1(buffer, buflen); kdDebug() << "FliteProc::slotReceivedStderr: Received error from Flite: " << buf << endl; } @@ -256,7 +256,7 @@ void FliteProc::ackFinished() if (m_state == psFinished) { m_state = psIdle; - m_synthFilename = QString::null; + m_synthFilename = TQString::null; } } diff --git a/kttsd/plugins/flite/fliteproc.h b/kttsd/plugins/flite/fliteproc.h index 7737b3a..a956d5c 100644 --- a/kttsd/plugins/flite/fliteproc.h +++ b/kttsd/plugins/flite/fliteproc.h @@ -25,8 +25,8 @@ #define _FLITEPROC_H_ // Qt includes. -#include <qstringlist.h> -#include <qmutex.h> +#include <tqstringlist.h> +#include <tqmutex.h> // KTTS includes. #include <pluginproc.h> @@ -40,7 +40,7 @@ class FliteProc : public PlugInProc{ /** * Constructor */ - FliteProc( QObject* parent = 0, const char* name = 0, const QStringList &args = QStringList()); + FliteProc( TQObject* parent = 0, const char* name = 0, const TQStringList &args = TQStringList()); /** * Destructor @@ -52,13 +52,13 @@ class FliteProc : public PlugInProc{ * @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. @@ -70,7 +70,7 @@ class FliteProc : public PlugInProc{ * * 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. @@ -79,7 +79,7 @@ class FliteProc : public PlugInProc{ * * The plugin must not re-use the filename. */ - virtual QString getFilename(); + virtual TQString getFilename(); /** * Stop current operation (saying or synthesizing text). @@ -144,9 +144,9 @@ class FliteProc : public PlugInProc{ * @param fliteExePath Path to the flite executable. */ void synth( - const QString &text, - const QString &synthFilename, - const QString &fliteExePath); + const TQString &text, + const TQString &synthFilename, + const TQString &fliteExePath); private slots: void slotProcessExited(KProcess* proc); @@ -159,7 +159,7 @@ class FliteProc : public PlugInProc{ /** * Path to flite executable (from config). */ - QString m_fliteExePath; + TQString m_fliteExePath; /** * Flite process @@ -169,7 +169,7 @@ class FliteProc : public PlugInProc{ /** * Synthesis filename. */ - QString m_synthFilename; + TQString m_synthFilename; /** * Plugin state. |