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 | |
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')
27 files changed, 803 insertions, 803 deletions
diff --git a/kttsd/plugins/command/commandconf.cpp b/kttsd/plugins/command/commandconf.cpp index 9d70ff2..5d46fe9 100644 --- a/kttsd/plugins/command/commandconf.cpp +++ b/kttsd/plugins/command/commandconf.cpp @@ -16,11 +16,11 @@ ***************************************************************************/ // Qt includes. -#include <qlayout.h> -#include <qcheckbox.h> -#include <qfile.h> -#include <qapplication.h> -#include <qtextcodec.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqfile.h> +#include <tqapplication.h> +#include <tqtextcodec.h> // KDE includes. #include <kdialog.h> @@ -41,14 +41,14 @@ #include "commandconf.h" /** Constructor */ -CommandConf::CommandConf( QWidget* parent, const char* name, const QStringList& /*args*/) : +CommandConf::CommandConf( TQWidget* parent, const char* name, const TQStringList& /*args*/) : PlugInConf(parent, name) { // kdDebug() << "CommandConf::CommandConf: Running" << endl; m_commandProc = 0; m_progressDlg = 0; - QVBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), + TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint(), "CommandConfigWidgetLayout"); layout->setAlignment (Qt::AlignTop); m_widget = new CommandConfWidget(this, "CommandConfigWidget"); @@ -60,39 +60,39 @@ CommandConf::CommandConf( QWidget* parent, const char* name, const QStringList& m_widget->characterCodingBox->insertStringList(m_codecList); defaults(); - connect(m_widget->characterCodingBox, SIGNAL(textChanged(const QString&)), - this, SLOT(configChanged())); - connect(m_widget->characterCodingBox, SIGNAL(activated(const QString&)), - this, SLOT(configChanged())); - connect(m_widget->stdInButton, SIGNAL(toggled(bool)), - this, SLOT(configChanged())); - connect(m_widget->urlReq, SIGNAL(textChanged(const QString&)), - this, SLOT(configChanged())); - connect(m_widget->commandTestButton, SIGNAL(clicked()), - this, SLOT(slotCommandTest_clicked())); + connect(m_widget->characterCodingBox, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(configChanged())); + connect(m_widget->characterCodingBox, TQT_SIGNAL(activated(const TQString&)), + this, TQT_SLOT(configChanged())); + connect(m_widget->stdInButton, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(configChanged())); + connect(m_widget->urlReq, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(configChanged())); + connect(m_widget->commandTestButton, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotCommandTest_clicked())); } /** Destructor */ CommandConf::~CommandConf() { // kdDebug() << "CommandConf::~CommandConf: Running" << endl; - if (!m_waveFile.isNull()) QFile::remove(m_waveFile); + if (!m_waveFile.isNull()) TQFile::remove(m_waveFile); delete m_commandProc; delete m_progressDlg; } -void CommandConf::load(KConfig *config, const QString &configGroup) { +void CommandConf::load(KConfig *config, const TQString &configGroup) { // kdDebug() << "CommandConf::load: Running" << endl; config->setGroup(configGroup); m_widget->urlReq->setURL (config->readEntry("Command", "cat -")); m_widget->stdInButton->setChecked(config->readBoolEntry("StdIn", false)); - QString codecString = config->readEntry("Codec", "Local"); + TQString codecString = config->readEntry("Codec", "Local"); m_languageCode = config->readEntry("LanguageCode", m_languageCode); int codec = PlugInProc::codecNameToListIndex(codecString, m_codecList); m_widget->characterCodingBox->setCurrentItem(codec); } -void CommandConf::save(KConfig *config, const QString &configGroup) { +void CommandConf::save(KConfig *config, const TQString &configGroup) { // kdDebug() << "CommandConf::save: Running" << endl; config->setGroup(configGroup); config->writeEntry("Command", m_widget->urlReq->url()); @@ -109,21 +109,21 @@ void CommandConf::defaults(){ m_widget->characterCodingBox->setCurrentItem(0); } -void CommandConf::setDesiredLanguage(const QString &lang) +void CommandConf::setDesiredLanguage(const TQString &lang) { m_languageCode = lang; } -QString CommandConf::getTalkerCode() +TQString CommandConf::getTalkerCode() { - QString url = m_widget->urlReq->url(); + TQString url = m_widget->urlReq->url(); if (!url.isEmpty()) { // Must contain either text or file parameter, or StdIn checkbox must be checked, // otherwise, does nothing! if ((url.contains("%t") > 0) || (url.contains("%f") > 0) || m_widget->stdInButton->isChecked()) { - return QString( + return TQString( "<voice lang=\"%1\" name=\"%2\" gender=\"%3\" />" "<prosody volume=\"%4\" rate=\"%5\" />" "<kttsd synthesizer=\"%6\" />") @@ -135,7 +135,7 @@ QString CommandConf::getTalkerCode() .arg("Command"); } } - return QString::null; + return TQString::null; } void CommandConf::slotCommandTest_clicked() @@ -147,16 +147,16 @@ void CommandConf::slotCommandTest_clicked() else { m_commandProc = new CommandProc(); - connect (m_commandProc, SIGNAL(stopped()), this, SLOT(slotSynthStopped())); + connect (m_commandProc, TQT_SIGNAL(stopped()), this, TQT_SLOT(slotSynthStopped())); } // Create a temp file name for the wave file. KTempFile tempFile (locateLocal("tmp", "commandplugin-"), ".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_command_testdlg", @@ -167,7 +167,7 @@ void CommandConf::slotCommandTest_clicked() m_progressDlg->setAllowCancel(true); // TODO: Do codec names contain non-ASCII characters? - connect (m_commandProc, SIGNAL(synthFinished()), this, SLOT(slotSynthFinished())); + connect (m_commandProc, TQT_SIGNAL(synthFinished()), this, TQT_SLOT(slotSynthFinished())); m_commandProc->synth( testMsg, tmpWaveFile, @@ -179,7 +179,7 @@ void CommandConf::slotCommandTest_clicked() // Display progress dialog modally. Processing continues when plugin signals synthFinished, // or if user clicks Cancel button. m_progressDlg->exec(); - disconnect (m_commandProc, SIGNAL(synthFinished()), this, SLOT(slotSynthFinished())); + disconnect (m_commandProc, TQT_SIGNAL(synthFinished()), this, TQT_SLOT(slotSynthFinished())); if (m_progressDlg->wasCancelled()) m_commandProc->stopText(); delete m_progressDlg; m_progressDlg = 0; @@ -202,16 +202,16 @@ void CommandConf::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 CommandConf::slotSynthStopped() { // Clean up after canceling test. - QString filename = m_commandProc->getFilename(); - if (!filename.isNull()) QFile::remove(filename); + TQString filename = m_commandProc->getFilename(); + if (!filename.isNull()) TQFile::remove(filename); } #include "commandconf.moc" diff --git a/kttsd/plugins/command/commandconf.h b/kttsd/plugins/command/commandconf.h index 7e9a573..b3889b9 100644 --- a/kttsd/plugins/command/commandconf.h +++ b/kttsd/plugins/command/commandconf.h @@ -19,8 +19,8 @@ #define _COMMANDCONF_H_ // Qt includes. -#include <qstring.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqstringlist.h> // KDE includes. #include <kconfig.h> @@ -39,7 +39,7 @@ class CommandConf : public PlugInConf { public: /** Constructor */ - CommandConf( QWidget* parent = 0, const char* name = 0, const QStringList &args = QStringList()); + CommandConf( TQWidget* parent = 0, const char* name = 0, const TQStringList &args = TQStringList()); /** Destructor */ ~CommandConf(); @@ -51,14 +51,14 @@ class CommandConf : 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 @@ -71,7 +71,7 @@ class CommandConf : 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. * @@ -83,16 +83,16 @@ class CommandConf : 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(){ @@ -104,7 +104,7 @@ class CommandConf : public PlugInConf { void slotSynthStopped(); private: - QString m_languageCode; + TQString m_languageCode; // Configuration Widget. CommandConfWidget* m_widget; @@ -112,10 +112,10 @@ class CommandConf : public PlugInConf { // Command synthesizer. CommandProc* m_commandProc; // Synthesized wave file name. - QString m_waveFile; + TQString m_waveFile; // Progress dialog. KProgressDialog* m_progressDlg; // Codec list. - QStringList m_codecList; + TQStringList m_codecList; }; #endif // _COMMANDCONF_H_ diff --git a/kttsd/plugins/command/commandproc.cpp b/kttsd/plugins/command/commandproc.cpp index e8d3e72..77d63f3 100644 --- a/kttsd/plugins/command/commandproc.cpp +++ b/kttsd/plugins/command/commandproc.cpp @@ -16,13 +16,13 @@ ***************************************************************************/ // Qt includes. -#include <qfile.h> -#include <qstring.h> -#include <qvaluelist.h> -#include <qstringlist.h> -#include <qregexp.h> -#include <qtextcodec.h> -#include <qvaluestack.h> +#include <tqfile.h> +#include <tqstring.h> +#include <tqvaluelist.h> +#include <tqstringlist.h> +#include <tqregexp.h> +#include <tqtextcodec.h> +#include <tqvaluestack.h> // KDE includes. #include <kdebug.h> @@ -39,7 +39,7 @@ #include "commandproc.moc" /** Constructor */ -CommandProc::CommandProc( QObject* parent, const char* name, const QStringList& /*args*/) : +CommandProc::CommandProc( TQObject* parent, const char* name, const TQStringList& /*args*/) : PlugInProc( parent, name ) { kdDebug() << "CommandProc::CommandProc: Running" << endl; @@ -59,12 +59,12 @@ CommandProc::~CommandProc() if (m_commandProc->isRunning()) m_commandProc->kill(); delete m_commandProc; // Don't delete synth file. That is responsibility of caller. - if (!m_textFilename.isNull()) QFile::remove(m_textFilename); + if (!m_textFilename.isNull()) TQFile::remove(m_textFilename); } } /** Initialize */ -bool CommandProc::init(KConfig *config, const QString &configGroup){ +bool CommandProc::init(KConfig *config, const TQString &configGroup){ kdDebug() << "CommandProc::init: Initializing plug in: Command " << endl; config->setGroup(configGroup); @@ -75,7 +75,7 @@ bool CommandProc::init(KConfig *config, const QString &configGroup){ // Support separate synthesis if the TTS command contains %w macro. m_supportsSynth = (m_ttsCommand.contains("%w")); - QString codecString = config->readEntry("Codec", "Local"); + TQString codecString = config->readEntry("Codec", "Local"); m_codec = codecNameToCodec(codecString); kdDebug() << "CommandProc::init: Initialized with command: " << m_ttsCommand << " codec: " << codecString << endl; return true; @@ -87,9 +87,9 @@ bool CommandProc::init(KConfig *config, const QString &configGroup){ * * If the plugin supports asynchronous operation, it should return immediately. */ -void CommandProc::sayText(const QString &text) +void CommandProc::sayText(const TQString &text) { - synth(text, QString::null, + synth(text, TQString::null, m_ttsCommand, m_stdin, m_codec, m_language); } @@ -103,7 +103,7 @@ void CommandProc::sayText(const QString &text) * * If the plugin supports asynchronous operation, it should return immediately. */ -void CommandProc::synthText(const QString& text, const QString& suggestedFilename) +void CommandProc::synthText(const TQString& text, const TQString& suggestedFilename) { synth(text, suggestedFilename, m_ttsCommand, m_stdin, m_codec, m_language); @@ -116,56 +116,56 @@ void CommandProc::synthText(const QString& text, const QString& suggestedFilenam * synthesize and audibilize the text. * @param userCmd The program that shall be executed for speaking * @param stdIn True if the program shall recieve its data via standard input -* @param codec The QTextCodec if encoding==UseCodec +* @param codec The TQTextCodec if encoding==UseCodec * @param language The language code (used for the %l macro) */ -void CommandProc::synth(const QString& inputText, const QString& suggestedFilename, - const QString& userCmd, bool stdIn, QTextCodec *codec, QString& language) +void CommandProc::synth(const TQString& inputText, const TQString& suggestedFilename, + const TQString& userCmd, bool stdIn, TQTextCodec *codec, TQString& language) { if (m_commandProc) { if (m_commandProc->isRunning()) m_commandProc->kill(); delete m_commandProc; m_commandProc = 0; - m_synthFilename = QString::null; - if (!m_textFilename.isNull()) QFile::remove(m_textFilename); - m_textFilename = QString::null; + m_synthFilename = TQString::null; + if (!m_textFilename.isNull()) TQFile::remove(m_textFilename); + m_textFilename = TQString::null; } - QString command = userCmd; - QString text = inputText.stripWhiteSpace(); + TQString command = userCmd; + TQString text = inputText.stripWhiteSpace(); if (text.isEmpty()) return; // 1. prepare the text: // 1.a) encode the text text += "\n"; - QCString encodedText; + TQCString encodedText; if (codec) encodedText = codec->fromUnicode(text); else encodedText = text.latin1(); // Should not happen, but just in case. // 1.b) quote the text as one parameter - QString escText = KShellProcess::quote(text); + TQString escText = KShellProcess::quote(text); // 1.c) create a temporary file for the text, if %f macro is used. if (command.contains("%f")) { KTempFile tempFile(locateLocal("tmp", "commandplugin-"), ".txt"); - QTextStream* fs = tempFile.textStream(); + TQTextStream* fs = tempFile.textStream(); fs->setCodec(codec); *fs << text; *fs << endl; m_textFilename = tempFile.file()->name(); tempFile.close(); - } else m_textFilename = QString::null; + } else m_textFilename = TQString::null; // 2. replace variables with values - QValueStack<bool> stack; + TQValueStack<bool> stack; bool issinglequote=false; bool isdoublequote=false; int noreplace=0; - QRegExp re_noquote("(\"|'|\\\\|`|\\$\\(|\\$\\{|\\(|\\{|\\)|\\}|%%|%t|%f|%l|%w)"); - QRegExp re_singlequote("('|%%|%t|%f|%l|%w)"); - QRegExp re_doublequote("(\"|\\\\|`|\\$\\(|\\$\\{|%%|%t|%f|%l|%w)"); + TQRegExp re_noquote("(\"|'|\\\\|`|\\$\\(|\\$\\{|\\(|\\{|\\)|\\}|%%|%t|%f|%l|%w)"); + TQRegExp re_singlequote("('|%%|%t|%f|%l|%w)"); + TQRegExp re_doublequote("(\"|\\\\|`|\\$\\(|\\$\\{|%%|%t|%f|%l|%w)"); for ( int i = re_noquote.search(command); i != -1; @@ -220,7 +220,7 @@ void CommandProc::synth(const QString& inputText, const QString& suggestedFilena { // Replace all `...` with safer $(...) command.replace (i, 1, "$("); - QRegExp re_backticks("(`|\\\\`|\\\\\\\\|\\\\\\$)"); + TQRegExp re_backticks("(`|\\\\`|\\\\\\\\|\\\\\\$)"); for ( int i2=re_backticks.search(command,i+2); i2!=-1; i2=re_backticks.search(command,i2) @@ -241,7 +241,7 @@ void CommandProc::synth(const QString& inputText, const QString& suggestedFilena } else if (noreplace == 0) // do not replace macros within ${...} { - QString match, v; + TQString match, v; // get match if (issinglequote) @@ -290,14 +290,14 @@ void CommandProc::synth(const QString& inputText, const QString& suggestedFilena m_commandProc->setEnvironment("LANG", language + "." + codec->mimeName()); m_commandProc->setEnvironment("LC_CTYPE", language + "." + codec->mimeName()); *m_commandProc << command; - connect(m_commandProc, SIGNAL(processExited(KProcess*)), - this, SLOT(slotProcessExited(KProcess*))); - connect(m_commandProc, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(slotReceivedStdout(KProcess*, char*, int))); - connect(m_commandProc, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedStderr(KProcess*, char*, int))); - connect(m_commandProc, SIGNAL(wroteStdin(KProcess*)), - this, SLOT(slotWroteStdin(KProcess* ))); + connect(m_commandProc, TQT_SIGNAL(processExited(KProcess*)), + this, TQT_SLOT(slotProcessExited(KProcess*))); + connect(m_commandProc, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedStdout(KProcess*, char*, int))); + connect(m_commandProc, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedStderr(KProcess*, char*, int))); + connect(m_commandProc, TQT_SIGNAL(wroteStdin(KProcess*)), + this, TQT_SLOT(slotWroteStdin(KProcess* ))); // 4. start the process @@ -326,7 +326,7 @@ void CommandProc::synth(const QString& inputText, const QString& suggestedFilena * * The plugin must not re-use the filename. */ -QString CommandProc::getFilename() +TQString CommandProc::getFilename() { kdDebug() << "CommandProc::getFilename: returning " << m_synthFilename << endl; return m_synthFilename; @@ -382,13 +382,13 @@ void CommandProc::slotProcessExited(KProcess*) void CommandProc::slotReceivedStdout(KProcess*, char* buffer, int buflen) { - QString buf = QString::fromLatin1(buffer, buflen); + TQString buf = TQString::fromLatin1(buffer, buflen); kdDebug() << "CommandProc::slotReceivedStdout: Received output from Command: " << buf << endl; } void CommandProc::slotReceivedStderr(KProcess*, char* buffer, int buflen) { - QString buf = QString::fromLatin1(buffer, buflen); + TQString buf = TQString::fromLatin1(buffer, buflen); kdDebug() << "CommandProc::slotReceivedStderr: Received error from Command: " << buf << endl; } @@ -420,9 +420,9 @@ void CommandProc::ackFinished() if (m_state == psFinished) { m_state = psIdle; - m_synthFilename = QString::null; - if (!m_textFilename.isNull()) QFile::remove(m_textFilename); - m_textFilename = QString::null; + m_synthFilename = TQString::null; + if (!m_textFilename.isNull()) TQFile::remove(m_textFilename); + m_textFilename = TQString::null; } } diff --git a/kttsd/plugins/command/commandproc.h b/kttsd/plugins/command/commandproc.h index 4b46fe5..d5027c5 100644 --- a/kttsd/plugins/command/commandproc.h +++ b/kttsd/plugins/command/commandproc.h @@ -19,7 +19,7 @@ #define _COMMANDPROC_H_ // Qt includes. -#include <qstringlist.h> +#include <tqstringlist.h> // KTTS includes. #include <pluginproc.h> @@ -32,20 +32,20 @@ class CommandProc : public PlugInProc{ public: /** Constructor */ - CommandProc( QObject* parent = 0, const char* name = 0, - const QStringList &args = QStringList()); + CommandProc( TQObject* parent = 0, const char* name = 0, + const TQStringList &args = TQStringList()); /** Destructor */ ~CommandProc(); /** Initializate the speech */ - bool init (KConfig *config, const QString &configGroup); + 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. @@ -57,7 +57,7 @@ class CommandProc : 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. @@ -66,7 +66,7 @@ class CommandProc : public PlugInProc{ * * The plugin must not re-use the filename. */ - virtual QString getFilename(); + virtual TQString getFilename(); /** * Stop current operation (saying or synthesizing text). @@ -134,9 +134,9 @@ class CommandProc : public PlugInProc{ * @param codec Codec for encoding the text. * @param language The language code (used for the %l macro) */ - void synth(const QString& inputText, const QString& suggestedFilename, - const QString& userCmd, bool stdIn, - QTextCodec *codec, QString& language); + void synth(const TQString& inputText, const TQString& suggestedFilename, + const TQString& userCmd, bool stdIn, + TQTextCodec *codec, TQString& language); private slots: void slotProcessExited(KProcess* proc); @@ -154,7 +154,7 @@ class CommandProc : public PlugInProc{ /** * TTS command */ - QString m_ttsCommand; + TQString m_ttsCommand; /** * True if process should use Stdin. @@ -164,12 +164,12 @@ class CommandProc : public PlugInProc{ /** * Language Group. */ - QString m_language; + TQString m_language; /** * Codec. */ - QTextCodec* m_codec; + TQTextCodec* m_codec; /** * Flite process @@ -179,12 +179,12 @@ class CommandProc : public PlugInProc{ /** * Name of temporary file containing text. */ - QString m_textFilename; + TQString m_textFilename; /** * Synthesis filename. */ - QString m_synthFilename; + TQString m_synthFilename; /** * Plugin state. diff --git a/kttsd/plugins/epos/eposconf.cpp b/kttsd/plugins/epos/eposconf.cpp index 063c9f9..8b5ccf0 100644 --- a/kttsd/plugins/epos/eposconf.cpp +++ b/kttsd/plugins/epos/eposconf.cpp @@ -25,11 +25,11 @@ #include <math.h> // Qt includes. -#include <qfile.h> -#include <qapplication.h> -#include <qtextcodec.h> -#include <qlayout.h> -#include <qslider.h> +#include <tqfile.h> +#include <tqapplication.h> +#include <tqtextcodec.h> +#include <tqlayout.h> +#include <tqslider.h> // KDE includes. #include <kdialog.h> @@ -48,14 +48,14 @@ #include "eposconf.moc" /** Constructor */ -EposConf::EposConf( QWidget* parent, const char* name, const QStringList& /*args*/) : +EposConf::EposConf( TQWidget* parent, const char* name, const TQStringList& /*args*/) : PlugInConf(parent, name) { // kdDebug() << "EposConf::EposConf: Running" << endl; m_eposProc = 0; m_progressDlg = 0; - QVBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), + TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint(), "EposConfigWidgetLayout"); layout->setAlignment (Qt::AlignTop); m_widget = new EposConfWidget(this, "EposConfigWidget"); @@ -68,41 +68,41 @@ EposConf::EposConf( QWidget* parent, const char* name, const QStringList& /*args defaults(); - connect(m_widget->eposServerPath, SIGNAL(textChanged(const QString&)), - this, SLOT(configChanged())); - connect(m_widget->eposClientPath, SIGNAL(textChanged(const QString&)), - this, SLOT(configChanged())); - connect(m_widget->timeBox, SIGNAL(valueChanged(int)), - this, SLOT(timeBox_valueChanged(int))); - connect(m_widget->frequencyBox, SIGNAL(valueChanged(int)), - this, SLOT(frequencyBox_valueChanged(int))); - connect(m_widget->timeSlider, SIGNAL(valueChanged(int)), - this, SLOT(timeSlider_valueChanged(int))); - connect(m_widget->frequencySlider, SIGNAL(valueChanged(int)), - this, SLOT(frequencySlider_valueChanged(int))); - connect(m_widget->timeBox, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(m_widget->timeSlider, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(m_widget->frequencyBox, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(m_widget->frequencySlider, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(m_widget->characterCodingBox, SIGNAL(activated(const QString&)), - this, SLOT(configChanged())); - connect(m_widget->eposServerOptions, SIGNAL(textChanged(const QString&)), - this, SLOT(configChanged())); - connect(m_widget->eposClientOptions, SIGNAL(textChanged(const QString&)), - this, SLOT(configChanged())); - connect(m_widget->eposTest, SIGNAL(clicked()), - this, SLOT(slotEposTest_clicked())); + connect(m_widget->eposServerPath, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(configChanged())); + connect(m_widget->eposClientPath, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(configChanged())); + connect(m_widget->timeBox, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(timeBox_valueChanged(int))); + connect(m_widget->frequencyBox, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(frequencyBox_valueChanged(int))); + connect(m_widget->timeSlider, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(timeSlider_valueChanged(int))); + connect(m_widget->frequencySlider, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(frequencySlider_valueChanged(int))); + connect(m_widget->timeBox, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(m_widget->timeSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(m_widget->frequencyBox, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(m_widget->frequencySlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(m_widget->characterCodingBox, TQT_SIGNAL(activated(const TQString&)), + this, TQT_SLOT(configChanged())); + connect(m_widget->eposServerOptions, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(configChanged())); + connect(m_widget->eposClientOptions, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(configChanged())); + connect(m_widget->eposTest, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotEposTest_clicked())); } /** Destructor */ EposConf::~EposConf(){ // kdDebug() << "Running: EposConf::~EposConf()" << endl; - if (!m_waveFile.isNull()) QFile::remove(m_waveFile); + if (!m_waveFile.isNull()) TQFile::remove(m_waveFile); delete m_eposProc; delete m_progressDlg; } -void EposConf::load(KConfig *config, const QString &configGroup){ +void EposConf::load(KConfig *config, const TQString &configGroup){ // kdDebug() << "EposConf::load: Running " << endl; config->setGroup(configGroup); @@ -110,7 +110,7 @@ void EposConf::load(KConfig *config, const QString &configGroup){ m_widget->eposClientPath->setURL(config->readEntry("EposClientExePath", "say-epos")); m_widget->eposServerOptions->setText(config->readEntry("EposServerOptions", "")); m_widget->eposClientOptions->setText(config->readEntry("EposClientOptions", "")); - QString codecString = config->readEntry("Codec", "ISO 8859-2"); + TQString codecString = config->readEntry("Codec", "ISO 8859-2"); int codec = PlugInProc::codecNameToListIndex(codecString, m_codecList); m_widget->timeBox->setValue(config->readNumEntry("time", 100)); m_widget->frequencyBox->setValue(config->readNumEntry("pitch", 100)); @@ -120,15 +120,15 @@ void EposConf::load(KConfig *config, const QString &configGroup){ /** * Converts a language code into the language setting passed to Epos synth. */ -QString EposConf::languageCodeToEposLanguage(const QString &languageCode) +TQString EposConf::languageCodeToEposLanguage(const TQString &languageCode) { - QString eposLanguage; + TQString eposLanguage; if (languageCode.left(2) == "cs") eposLanguage = "czech"; if (languageCode.left(2) == "sk") eposLanguage = "slovak"; return eposLanguage; } -void EposConf::save(KConfig *config, const QString &configGroup){ +void EposConf::save(KConfig *config, const TQString &configGroup){ // kdDebug() << "EposConf::save: Running" << endl; config->setGroup("Epos"); @@ -154,7 +154,7 @@ void EposConf::defaults(){ // kdDebug() << "EposConf::defaults: Running" << endl; // Epos server command changed from epos to eposd. Epos client command changed from // say to say-epos. These changes appeared around Epos v2.5.35. Try for these automatically. - QString exeName = "eposd"; + TQString exeName = "eposd"; if (realFilePath(exeName).isEmpty()) if (!realFilePath("epos").isEmpty()) exeName = "epos"; @@ -174,23 +174,23 @@ void EposConf::defaults(){ m_widget->characterCodingBox->setCurrentItem(codec); } -void EposConf::setDesiredLanguage(const QString &lang) +void EposConf::setDesiredLanguage(const TQString &lang) { m_languageCode = lang; } -QString EposConf::getTalkerCode() +TQString EposConf::getTalkerCode() { - QString eposServerExe = realFilePath(m_widget->eposServerPath->url()); - QString eposClientExe = realFilePath(m_widget->eposClientPath->url()); + TQString eposServerExe = realFilePath(m_widget->eposServerPath->url()); + TQString eposClientExe = realFilePath(m_widget->eposClientPath->url()); if (!eposServerExe.isEmpty() && !eposClientExe.isEmpty()) { if (!getLocation(eposServerExe).isEmpty() && !getLocation(eposClientExe).isEmpty()) { - QString rate = "medium"; + TQString rate = "medium"; if (m_widget->timeBox->value() < 75) rate = "slow"; if (m_widget->timeBox->value() > 125) rate = "fast"; - return QString( + return TQString( "<voice lang=\"%1\" name=\"%2\" gender=\"%3\" />" "<prosody volume=\"%4\" rate=\"%5\" />" "<kttsd synthesizer=\"%6\" />") @@ -202,7 +202,7 @@ QString EposConf::getTalkerCode() .arg("Epos TTS Synthesis System"); } } - return QString::null; + return TQString::null; } void EposConf::slotEposTest_clicked() @@ -214,15 +214,15 @@ void EposConf::slotEposTest_clicked() else { m_eposProc = new EposProc(); - connect (m_eposProc, SIGNAL(stopped()), this, SLOT(slotSynthStopped())); + connect (m_eposProc, TQT_SIGNAL(stopped()), this, TQT_SLOT(slotSynthStopped())); } // Create a temp file name for the wave file. KTempFile tempFile (locateLocal("tmp", "eposplugin-"), ".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_epos_testdlg", @@ -234,7 +234,7 @@ void EposConf::slotEposTest_clicked() // TODO: Whenever server options change, the server must be restarted. // TODO: Do codec names contain non-ASCII characters? - connect (m_eposProc, SIGNAL(synthFinished()), this, SLOT(slotSynthFinished())); + connect (m_eposProc, TQT_SIGNAL(synthFinished()), this, TQT_SLOT(slotSynthFinished())); m_eposProc->synth( testMsg, tmpWaveFile, @@ -251,7 +251,7 @@ void EposConf::slotEposTest_clicked() // Display progress dialog modally. Processing continues when plugin signals synthFinished, // or if user clicks Cancel button. m_progressDlg->exec(); - disconnect (m_eposProc, SIGNAL(synthFinished()), this, SLOT(slotSynthFinished())); + disconnect (m_eposProc, TQT_SIGNAL(synthFinished()), this, TQT_SLOT(slotSynthFinished())); if (m_progressDlg->wasCancelled()) m_eposProc->stopText(); delete m_progressDlg; m_progressDlg = 0; @@ -274,16 +274,16 @@ void EposConf::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 EposConf::slotSynthStopped() { // Clean up after canceling test. - QString filename = m_eposProc->getFilename(); - if (!filename.isNull()) QFile::remove(filename); + TQString filename = m_eposProc->getFilename(); + if (!filename.isNull()) TQFile::remove(filename); } // Basically the slider values are logarithmic (0,...,1000) whereas percent diff --git a/kttsd/plugins/epos/eposconf.h b/kttsd/plugins/epos/eposconf.h index 5c3fbe3..08cb611 100644 --- a/kttsd/plugins/epos/eposconf.h +++ b/kttsd/plugins/epos/eposconf.h @@ -25,7 +25,7 @@ #define _EPOSCONF_H_ // Qt includes. -#include <qstring.h> +#include <tqstring.h> // KDE includes. #include <kconfig.h> @@ -46,7 +46,7 @@ class EposConf : public PlugInConf { public: /** Constructor */ - EposConf( QWidget* parent = 0, const char* name = 0, const QStringList &args = QStringList()); + EposConf( TQWidget* parent = 0, const char* name = 0, const TQStringList &args = TQStringList()); /** Destructor */ ~EposConf(); @@ -58,14 +58,14 @@ class EposConf : 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 @@ -78,7 +78,7 @@ class EposConf : 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. * @@ -90,16 +90,16 @@ class EposConf : 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(){ @@ -118,13 +118,13 @@ class EposConf : public PlugInConf { /** * Converts a language code into the language setting passed to Epos synth. */ - QString languageCodeToEposLanguage(const QString &languageCode); + TQString languageCodeToEposLanguage(const TQString &languageCode); int percentToSlider(int percentValue); int sliderToPercent(int sliderValue); // Language code. - QString m_languageCode; + TQString m_languageCode; // Configuration widget. EposConfWidget* m_widget; @@ -132,10 +132,10 @@ class EposConf : public PlugInConf { // Epos synthesizer. EposProc* m_eposProc; // Synthesized wave file name. - QString m_waveFile; + TQString m_waveFile; // Progress dialog. KProgressDialog* m_progressDlg; // List of displayed codec names. - QStringList m_codecList; + TQStringList m_codecList; }; #endif // _EPOSCONF_H_ diff --git a/kttsd/plugins/epos/eposproc.cpp b/kttsd/plugins/epos/eposproc.cpp index 35bc1d3..e5fd664 100644 --- a/kttsd/plugins/epos/eposproc.cpp +++ b/kttsd/plugins/epos/eposproc.cpp @@ -26,10 +26,10 @@ #include <math.h> // Qt includes. -#include <qstring.h> -#include <qstringlist.h> -#include <qtextcodec.h> -#include <qfile.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqtextcodec.h> +#include <tqfile.h> // KDE includes. #include <kdebug.h> @@ -43,7 +43,7 @@ #include "eposproc.moc" /** Constructor */ -EposProc::EposProc( QObject* parent, const char* name, const QStringList& ) : +EposProc::EposProc( TQObject* parent, const char* name, const TQStringList& ) : PlugInProc( parent, name ){ kdDebug() << "EposProc::EposProc: Running" << endl; m_state = psIdle; @@ -64,7 +64,7 @@ EposProc::~EposProc(){ } /** Initialize the speech */ -bool EposProc::init(KConfig* config, const QString& configGroup) +bool EposProc::init(KConfig* config, const TQString& configGroup) { // kdDebug() << "EposProc::init: Running" << endl; // kdDebug() << "Initializing plug in: Epos" << endl; @@ -72,15 +72,15 @@ bool EposProc::init(KConfig* config, const QString& configGroup) config->setGroup(configGroup); m_eposServerExePath = config->readEntry("EposServerExePath", "epos"); m_eposClientExePath = config->readEntry("EposClientExePath", "say"); - m_eposLanguage = config->readEntry("Language", QString::null); + m_eposLanguage = config->readEntry("Language", TQString::null); m_time = config->readNumEntry("time", 100); m_pitch = config->readNumEntry("pitch", 100); - m_eposServerOptions = config->readEntry("EposServerOptions", QString::null); - m_eposClientOptions = config->readEntry("EposClientOptions", QString::null); + m_eposServerOptions = config->readEntry("EposServerOptions", TQString::null); + m_eposClientOptions = config->readEntry("EposClientOptions", TQString::null); kdDebug() << "EposProc::init: path to epos server: " << m_eposServerExePath << endl; kdDebug() << "EposProc::init: path to epos client: " << m_eposClientExePath << endl; - QString codecString = config->readEntry("Codec", "Local"); + TQString codecString = config->readEntry("Codec", "Local"); m_codec = codecNameToCodec(codecString); // Start the Epos server if not already started. if (!m_eposServerProc) @@ -89,10 +89,10 @@ bool EposProc::init(KConfig* config, const QString& configGroup) *m_eposServerProc << m_eposServerExePath; if (!m_eposServerOptions.isEmpty()) *m_eposServerProc << m_eposServerOptions; - connect(m_eposServerProc, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(slotReceivedStdout(KProcess*, char*, int))); - connect(m_eposServerProc, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedStderr(KProcess*, char*, int))); + connect(m_eposServerProc, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedStdout(KProcess*, char*, int))); + connect(m_eposServerProc, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedStderr(KProcess*, char*, int))); m_eposServerProc->start(KProcess::DontCare, KProcess::AllOutput); } @@ -107,9 +107,9 @@ bool EposProc::init(KConfig* config, const QString& configGroup) * * If the plugin supports asynchronous operation, it should return immediately. */ -void EposProc::sayText(const QString &text) +void EposProc::sayText(const TQString &text) { - synth(text, QString::null, m_eposServerExePath, m_eposClientExePath, + synth(text, TQString::null, m_eposServerExePath, m_eposClientExePath, m_eposServerOptions, m_eposClientOptions, m_codec, m_eposLanguage, m_time, m_pitch); } @@ -124,7 +124,7 @@ void EposProc::sayText(const QString &text) * * If the plugin supports asynchronous operation, it should return immediately. */ -void EposProc::synthText(const QString& text, const QString& suggestedFilename) +void EposProc::synthText(const TQString& text, const TQString& suggestedFilename) { synth(text, suggestedFilename, m_eposServerExePath, m_eposClientExePath, m_eposServerOptions, m_eposClientOptions, @@ -147,18 +147,18 @@ void EposProc::synthText(const QString& text, const QString& suggestedFilename) * @param pitch Pitch persentage. 50 to 200. */ void EposProc::synth( - const QString &text, - const QString &suggestedFilename, - const QString& eposServerExePath, - const QString& eposClientExePath, - const QString& eposServerOptions, - const QString& eposClientOptions, - QTextCodec *codec, - const QString& eposLanguage, + const TQString &text, + const TQString &suggestedFilename, + const TQString& eposServerExePath, + const TQString& eposClientExePath, + const TQString& eposServerOptions, + const TQString& eposClientOptions, + TQTextCodec *codec, + const TQString& eposLanguage, int time, int pitch) { - // kdDebug() << "Running: EposProc::synth(const QString &text)" << endl; + // kdDebug() << "Running: EposProc::synth(const TQString &text)" << endl; if (m_eposProc) { @@ -173,18 +173,18 @@ void EposProc::synth( *m_eposServerProc << eposServerExePath; if (!eposServerOptions.isEmpty()) *m_eposServerProc << eposServerOptions; - connect(m_eposServerProc, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(slotReceivedStdout(KProcess*, char*, int))); - connect(m_eposServerProc, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedStderr(KProcess*, char*, int))); + connect(m_eposServerProc, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedStdout(KProcess*, char*, int))); + connect(m_eposServerProc, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedStderr(KProcess*, char*, int))); m_eposServerProc->start(KProcess::DontCare, KProcess::AllOutput); kdDebug() << "EposProc:: Epos server process started" << endl; } // // Encode the text. // // 1.a) encode the text -// m_encText = QCString(); -// QTextStream ts (m_encText, IO_WriteOnly); +// m_encText = TQCString(); +// TQTextStream ts (m_encText, IO_WriteOnly); // ts.setCodec(codec); // ts << text; // ts << endl; // Some synths need this, eg. flite. @@ -197,7 +197,7 @@ void EposProc::synth( // kdDebug()<< "EposProc::synth: Creating Epos object" << endl; m_eposProc = new KProcess; m_eposProc->setUseShell(true); - QString languageCode; + TQString languageCode; if (eposLanguage == "czech") languageCode == "cz"; else if (eposLanguage == "slovak") @@ -210,7 +210,7 @@ void EposProc::synth( *m_eposProc << eposClientExePath; // Language. if (!eposLanguage.isEmpty()) - *m_eposProc << QString("--language=%1").arg(eposLanguage); + *m_eposProc << TQString("--language=%1").arg(eposLanguage); // Rate (speed). // Map 50% to 200% onto 0 to 1000. // slider = alpha * (log(percent)-log(50)) @@ -221,10 +221,10 @@ void EposProc::synth( slider = slider - 500; // Map -500 to 500 onto 45 to -45 then shift to 130 to 40 (85 midpoint). float stretchValue = (-float(slider) * 45.0 / 500.0) + 85.0; - QString timeMsg = QString("--init_t=%1").arg(stretchValue, 0, 'f', 3); + TQString timeMsg = TQString("--init_t=%1").arg(stretchValue, 0, 'f', 3); *m_eposProc << timeMsg; // Pitch. Map 50% to 200% onto 50 to 200. easy. - QString pitchMsg = QString("--init_f=%1").arg(pitch); + TQString pitchMsg = TQString("--init_f=%1").arg(pitch); *m_eposProc << pitchMsg; // Output file. if (!suggestedFilename.isEmpty()) @@ -234,14 +234,14 @@ void EposProc::synth( *m_eposProc << "-"; // Read from StdIn. if (!suggestedFilename.isEmpty()) *m_eposProc << " >" + suggestedFilename; - connect(m_eposProc, SIGNAL(processExited(KProcess*)), - this, SLOT(slotProcessExited(KProcess*))); - connect(m_eposProc, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(slotReceivedStdout(KProcess*, char*, int))); - connect(m_eposProc, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedStderr(KProcess*, char*, int))); - connect(m_eposProc, SIGNAL(wroteStdin(KProcess*)), - this, SLOT(slotWroteStdin(KProcess* ))); + connect(m_eposProc, TQT_SIGNAL(processExited(KProcess*)), + this, TQT_SLOT(slotProcessExited(KProcess*))); + connect(m_eposProc, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedStdout(KProcess*, char*, int))); + connect(m_eposProc, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedStderr(KProcess*, char*, int))); + connect(m_eposProc, TQT_SIGNAL(wroteStdin(KProcess*)), + this, TQT_SLOT(slotWroteStdin(KProcess* ))); if (suggestedFilename.isEmpty()) m_state = psSaying; else @@ -270,7 +270,7 @@ void EposProc::synth( * * The plugin must not re-use the filename. */ -QString EposProc::getFilename() +TQString EposProc::getFilename() { kdDebug() << "EposProc::getFilename: returning " << m_synthFilename << endl; return m_synthFilename; @@ -326,13 +326,13 @@ void EposProc::slotProcessExited(KProcess*) void EposProc::slotReceivedStdout(KProcess*, char* buffer, int buflen) { - QString buf = QString::fromLatin1(buffer, buflen); + TQString buf = TQString::fromLatin1(buffer, buflen); kdDebug() << "EposProc::slotReceivedStdout: Received output from Epos: " << buf << endl; } void EposProc::slotReceivedStderr(KProcess*, char* buffer, int buflen) { - QString buf = QString::fromLatin1(buffer, buflen); + TQString buf = TQString::fromLatin1(buffer, buflen); kdDebug() << "EposProc::slotReceivedStderr: Received error from Epos: " << buf << endl; } @@ -340,7 +340,7 @@ void EposProc::slotWroteStdin(KProcess*) { // kdDebug() << "EposProc::slotWroteStdin: closing Stdin" << endl; m_eposProc->closeStdin(); - m_encText = QCString(); + m_encText = TQCString(); } /** @@ -365,7 +365,7 @@ void EposProc::ackFinished() if (m_state == psFinished) { m_state = psIdle; - m_synthFilename = QString::null; + m_synthFilename = TQString::null; } } diff --git a/kttsd/plugins/epos/eposproc.h b/kttsd/plugins/epos/eposproc.h index b2d1d90..d0fe9ba 100644 --- a/kttsd/plugins/epos/eposproc.h +++ b/kttsd/plugins/epos/eposproc.h @@ -26,8 +26,8 @@ #define _EPOSPROC_H_ // Qt includes. -#include <qstringlist.h> -#include <qmutex.h> +#include <tqstringlist.h> +#include <tqmutex.h> // KTTS includes. #include <pluginproc.h> @@ -42,7 +42,7 @@ class EposProc : public PlugInProc{ /** * Constructor */ - EposProc( QObject* parent = 0, const char* name = 0, const QStringList &args = QStringList()); + EposProc( TQObject* parent = 0, const char* name = 0, const TQStringList &args = TQStringList()); /** * Destructor @@ -54,13 +54,13 @@ class EposProc : 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. @@ -72,7 +72,7 @@ class EposProc : 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. @@ -81,7 +81,7 @@ class EposProc : public PlugInProc{ * * The plugin must not re-use the filename. */ - virtual QString getFilename(); + virtual TQString getFilename(); /** * Stop current operation (saying or synthesizing text). @@ -154,14 +154,14 @@ class EposProc : public PlugInProc{ * @param pitch Pitch persentage. 50 to 200. */ void synth( - const QString &text, - const QString &suggestedFilename, - const QString& eposServerExePath, - const QString& eposClientExePath, - const QString& eposServerOptions, - const QString& eposClientOptions, - QTextCodec *codec, - const QString& eposLanguage, + const TQString &text, + const TQString &suggestedFilename, + const TQString& eposServerExePath, + const TQString& eposClientExePath, + const TQString& eposServerOptions, + const TQString& eposClientOptions, + TQTextCodec *codec, + const TQString& eposLanguage, int time, int pitch); @@ -176,14 +176,14 @@ class EposProc : public PlugInProc{ /** * Path to epos executables (from config). */ - QString m_eposServerExePath; - QString m_eposClientExePath; + TQString m_eposServerExePath; + TQString m_eposClientExePath; /** * User options passed to executables (from config). */ - QString m_eposServerOptions; - QString m_eposClientOptions; + TQString m_eposServerOptions; + TQString m_eposClientOptions; /** * Epos Server process. @@ -198,7 +198,7 @@ class EposProc : public PlugInProc{ /** * Epos language setting. "czech", "slovak", or Null (use default language). */ - QString m_eposLanguage; + TQString m_eposLanguage; /** * Rate (speed) from config file. @@ -213,17 +213,17 @@ class EposProc : public PlugInProc{ /** * Codec. */ - QTextCodec* m_codec; + TQTextCodec* m_codec; /** * Encoded buffer to be sent to Epos client. */ - QCString m_encText; + TQCString m_encText; /** * Synthesis filename. */ - QString m_synthFilename; + TQString m_synthFilename; /** * Plugin state. diff --git a/kttsd/plugins/festivalint/festivalintconf.cpp b/kttsd/plugins/festivalint/festivalintconf.cpp index 91cd24f..8464ad7 100644 --- a/kttsd/plugins/festivalint/festivalintconf.cpp +++ b/kttsd/plugins/festivalint/festivalintconf.cpp @@ -25,15 +25,15 @@ #include <math.h> // Qt includes. -#include <qlayout.h> -#include <qlabel.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qcheckbox.h> -#include <qdir.h> -#include <qslider.h> -#include <qdom.h> -#include <qtextcodec.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqcheckbox.h> +#include <tqdir.h> +#include <tqslider.h> +#include <tqdom.h> +#include <tqtextcodec.h> // KDE includes. #include <kdialog.h> @@ -57,7 +57,7 @@ #include "festivalintconf.moc" /** Constructor */ -FestivalIntConf::FestivalIntConf( QWidget* parent, const char* name, const QStringList& /*args*/) : +FestivalIntConf::FestivalIntConf( TQWidget* parent, const char* name, const TQStringList& /*args*/) : PlugInConf(parent, name) { // kdDebug() << "FestivalIntConf::FestivalIntConf: Running" << endl; @@ -65,7 +65,7 @@ FestivalIntConf::FestivalIntConf( QWidget* parent, const char* name, const QStri m_progressDlg = 0; m_supportsSSML = FestivalIntProc::ssUnknown; - QVBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), + TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint(), "FestivalIntConfigWidgetLayout"); layout->setAlignment (Qt::AlignTop); m_widget = new FestivalIntConfWidget(this, "FestivalIntConfigWidget"); @@ -81,43 +81,43 @@ FestivalIntConf::FestivalIntConf( QWidget* parent, const char* name, const QStri // defaults(); - connect(m_widget->festivalPath, SIGNAL(textChanged(const QString&)), - this, SLOT(slotFestivalPath_textChanged())); - connect(m_widget->selectVoiceCombo, SIGNAL(activated(const QString&)), - this, SLOT(slotSelectVoiceCombo_activated())); - connect(m_widget->selectVoiceCombo, SIGNAL(activated(const QString&)), - this, SLOT(configChanged())); - connect(m_widget->testButton, SIGNAL(clicked()), this, SLOT(slotTest_clicked())); - connect(m_widget->rescan, SIGNAL(clicked()), this, SLOT(scanVoices())); - connect(m_widget->volumeBox, SIGNAL(valueChanged(int)), - this, SLOT(volumeBox_valueChanged(int))); - connect(m_widget->timeBox, SIGNAL(valueChanged(int)), - this, SLOT(timeBox_valueChanged(int))); - connect(m_widget->frequencyBox, SIGNAL(valueChanged(int)), - this, SLOT(frequencyBox_valueChanged(int))); - connect(m_widget->volumeSlider, SIGNAL(valueChanged(int)), - this, SLOT(volumeSlider_valueChanged(int))); - connect(m_widget->timeSlider, SIGNAL(valueChanged(int)), - this, SLOT(timeSlider_valueChanged(int))); - connect(m_widget->frequencySlider, SIGNAL(valueChanged(int)), - this, SLOT(frequencySlider_valueChanged(int))); - connect(m_widget->volumeBox, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(m_widget->volumeSlider, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(m_widget->timeBox, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(m_widget->timeSlider, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(m_widget->frequencyBox, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(m_widget->frequencySlider, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(m_widget->preloadCheckBox, SIGNAL(clicked()), this, SLOT(configChanged())); - connect(m_widget->characterCodingBox, SIGNAL(textChanged(const QString&)), - this, SLOT(configChanged())); - connect(m_widget->characterCodingBox, SIGNAL(activated(const QString&)), - this, SLOT(configChanged())); + connect(m_widget->festivalPath, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(slotFestivalPath_textChanged())); + connect(m_widget->selectVoiceCombo, TQT_SIGNAL(activated(const TQString&)), + this, TQT_SLOT(slotSelectVoiceCombo_activated())); + connect(m_widget->selectVoiceCombo, TQT_SIGNAL(activated(const TQString&)), + this, TQT_SLOT(configChanged())); + connect(m_widget->testButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotTest_clicked())); + connect(m_widget->rescan, TQT_SIGNAL(clicked()), this, TQT_SLOT(scanVoices())); + connect(m_widget->volumeBox, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(volumeBox_valueChanged(int))); + connect(m_widget->timeBox, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(timeBox_valueChanged(int))); + connect(m_widget->frequencyBox, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(frequencyBox_valueChanged(int))); + connect(m_widget->volumeSlider, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(volumeSlider_valueChanged(int))); + connect(m_widget->timeSlider, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(timeSlider_valueChanged(int))); + connect(m_widget->frequencySlider, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(frequencySlider_valueChanged(int))); + connect(m_widget->volumeBox, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(m_widget->volumeSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(m_widget->timeBox, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(m_widget->timeSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(m_widget->frequencyBox, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(m_widget->frequencySlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(m_widget->preloadCheckBox, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(m_widget->characterCodingBox, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(configChanged())); + connect(m_widget->characterCodingBox, TQT_SIGNAL(activated(const TQString&)), + this, TQT_SLOT(configChanged())); } /** Destructor */ FestivalIntConf::~FestivalIntConf(){ // kdDebug() << "FestivalIntConf::~FestivalIntConf: Running" << endl; - if (!m_waveFile.isNull()) QFile::remove(m_waveFile); + if (!m_waveFile.isNull()) TQFile::remove(m_waveFile); delete m_festProc; delete m_progressDlg; } @@ -126,7 +126,7 @@ FestivalIntConf::~FestivalIntConf(){ * Given a voice code, returns index into m_voiceList array (and voiceCombo box). * -1 if not found. */ -int FestivalIntConf::voiceCodeToListIndex(const QString& voiceCode) const +int FestivalIntConf::voiceCodeToListIndex(const TQString& voiceCode) const { const int voiceListCount = m_voiceList.count(); for(int index = 0; index < voiceListCount; ++index){ @@ -137,18 +137,18 @@ int FestivalIntConf::voiceCodeToListIndex(const QString& voiceCode) const return -1; } -void FestivalIntConf::load(KConfig *config, const QString &configGroup){ +void FestivalIntConf::load(KConfig *config, const TQString &configGroup){ //kdDebug() << "FestivalIntConf::load: Running" << endl; config->setGroup("FestivalInt"); - QString exePath = config->readEntry("FestivalExecutablePath", "festival"); - QString exeLocation = getLocation(exePath); + TQString exePath = config->readEntry("FestivalExecutablePath", "festival"); + TQString exeLocation = getLocation(exePath); if (!exeLocation.isEmpty()) exePath = exeLocation; exePath = realFilePath(exePath); config->setGroup(configGroup); m_widget->festivalPath->setURL(config->readEntry("FestivalExecutablePath", exePath)); m_widget->preloadCheckBox->setChecked(false); scanVoices(); - QString voiceSelected(config->readEntry("Voice")); + TQString voiceSelected(config->readEntry("Voice")); int index = voiceCodeToListIndex(voiceSelected); if (index >= 0) { @@ -163,14 +163,14 @@ void FestivalIntConf::load(KConfig *config, const QString &configGroup){ m_languageCode = config->readEntry("LanguageCode", m_languageCode); m_supportsSSML = static_cast<FestivalIntProc::SupportsSSML>( config->readNumEntry("SupportsSSML", FestivalIntProc::ssUnknown)); - QString codecName = PlugInProc::codecIndexToCodecName( + TQString codecName = PlugInProc::codecIndexToCodecName( m_widget->characterCodingBox->currentItem(), m_codecList); codecName = config->readEntry("Codec", codecName); int codecNdx = PlugInProc::codecNameToListIndex(codecName, m_codecList); m_widget->characterCodingBox->setCurrentItem(codecNdx); } -void FestivalIntConf::save(KConfig *config, const QString &configGroup){ +void FestivalIntConf::save(KConfig *config, const TQString &configGroup){ // kdDebug() << "FestivalIntConf::save: Running" << endl; config->setGroup("FestivalInt"); config->writeEntry("FestivalExecutablePath", realFilePath(m_widget->festivalPath->url())); @@ -202,30 +202,30 @@ void FestivalIntConf::defaults(){ scanVoices(); } -void FestivalIntConf::setDesiredLanguage(const QString &lang) +void FestivalIntConf::setDesiredLanguage(const TQString &lang) { // kdDebug() << "FestivalIntConf::setDesiredLanguage: Running" << endl; m_languageCode = splitLanguageCode(lang, m_countryCode); } -QString FestivalIntConf::getTalkerCode() +TQString FestivalIntConf::getTalkerCode() { - if (!m_widget->selectVoiceCombo->isEnabled()) return QString::null; - QString exePath = realFilePath(m_widget->festivalPath->url()); - if (exePath.isEmpty()) return QString::null; - if (getLocation(exePath).isEmpty()) return QString::null; - if (m_voiceList.count() == 0) return QString::null; - QString normalTalkerCode; + if (!m_widget->selectVoiceCombo->isEnabled()) return TQString::null; + TQString exePath = realFilePath(m_widget->festivalPath->url()); + if (exePath.isEmpty()) return TQString::null; + if (getLocation(exePath).isEmpty()) return TQString::null; + if (m_voiceList.count() == 0) return TQString::null; + TQString normalTalkerCode; voiceStruct voiceTemp = m_voiceList[m_widget->selectVoiceCombo->currentItem()]; // Determine volume attribute. soft < 75% <= medium <= 125% < loud. - QString volume = "medium"; + TQString volume = "medium"; if (m_widget->volumeBox->value() < 75) volume = "soft"; if (m_widget->volumeBox->value() > 125) volume = "loud"; // Determine rate attribute. slow < 75% <= medium <= 125% < fast. - QString rate = "medium"; + TQString rate = "medium"; if (m_widget->timeBox->value() < 75) rate = "slow"; if (m_widget->timeBox->value() > 125) rate = "fast"; - normalTalkerCode = QString( + normalTalkerCode = TQString( "<voice lang=\"%1\" name=\"%2\" gender=\"%3\" />" "<prosody volume=\"%4\" rate=\"%5\" />" "<kttsd synthesizer=\"%6\" />") @@ -251,14 +251,14 @@ void FestivalIntConf::setDefaultVoice(int currentVoiceIndex) { bool found = false; // First search for a match on both language code and country code. - QString languageCode = m_languageCode; + TQString languageCode = m_languageCode; if (!m_countryCode.isNull()) languageCode += "_" + m_countryCode; // kdDebug() << "FestivalIntConf::setDefaultVoice:: looking for default voice to match language code " << languageCode << endl; uint index = 0; // Prefer existing voice if it matches. if (currentVoiceIndex >= 0) { - QString vlCode = m_voiceList[currentVoiceIndex].languageCode.left(languageCode.length()); + TQString vlCode = m_voiceList[currentVoiceIndex].languageCode.left(languageCode.length()); if (languageCode == vlCode) { found = true; @@ -269,7 +269,7 @@ void FestivalIntConf::setDefaultVoice(int currentVoiceIndex) { for(index = 0 ; index < m_voiceList.count(); ++index) { - QString vlCode = m_voiceList[index].languageCode.left(languageCode.length()); + TQString vlCode = m_voiceList[index].languageCode.left(languageCode.length()); // kdDebug() << "FestivalIntConf::setDefaultVoice: testing " << vlCode << endl; if(languageCode == vlCode) { @@ -285,7 +285,7 @@ void FestivalIntConf::setDefaultVoice(int currentVoiceIndex) // Prefer existing voice if it matches. if (currentVoiceIndex >= 0) { - QString vlCode = m_voiceList[currentVoiceIndex].languageCode.left(languageCode.length()); + TQString vlCode = m_voiceList[currentVoiceIndex].languageCode.left(languageCode.length()); if (languageCode == vlCode) { found = true; @@ -296,7 +296,7 @@ void FestivalIntConf::setDefaultVoice(int currentVoiceIndex) { for(index = 0 ; index < m_voiceList.count(); ++index) { - QString vlCode = m_voiceList[index].languageCode.left(languageCode.length()); + TQString vlCode = m_voiceList[index].languageCode.left(languageCode.length()); // kdDebug() << "FestivalIntConf::setDefaultVoice: testing " << vlCode << endl; if(languageCode == vlCode) { @@ -323,7 +323,7 @@ void FestivalIntConf::setDefaultVoice(int currentVoiceIndex) // kdDebug() << "FestivalIntConf::setDefaultVoice: auto picking voice code " << m_voiceList[index].code << endl; m_widget->selectVoiceCombo->setCurrentItem(index); m_widget->preloadCheckBox->setChecked(m_voiceList[index].preload); - QString codecName = m_voiceList[index].codecName; + TQString codecName = m_voiceList[index].codecName; int codecNdx = PlugInProc::codecNameToListIndex(codecName, m_codecList); m_widget->characterCodingBox->setCurrentItem(codecNdx); if (m_voiceList[index].volumeAdjustable) @@ -371,9 +371,9 @@ void FestivalIntConf::setDefaultVoice(int currentVoiceIndex) * Given an XML node and child element name, returns the string value from the child element. * If no such child element, returns def. */ -QString FestivalIntConf::readXmlString(QDomNode &node, const QString &elementName, const QString &def) +TQString FestivalIntConf::readXmlString(TQDomNode &node, const TQString &elementName, const TQString &def) { - QDomNode childNode = node.namedItem(elementName); + TQDomNode childNode = node.namedItem(elementName); if (!childNode.isNull()) return childNode.toElement().text(); else @@ -384,9 +384,9 @@ QString FestivalIntConf::readXmlString(QDomNode &node, const QString &elementNam * Given an XML node and child element name, returns the boolean value from the child element. * If no such child element, returns def. */ -bool FestivalIntConf::readXmlBool(QDomNode &node, const QString &elementName, bool def) +bool FestivalIntConf::readXmlBool(TQDomNode &node, const TQString &elementName, bool def) { - QDomNode childNode = node.namedItem(elementName); + TQDomNode childNode = node.namedItem(elementName); if (!childNode.isNull()) return (childNode.toElement().text() == "true"); else @@ -397,7 +397,7 @@ void FestivalIntConf::scanVoices() { // kdDebug() << "FestivalIntConf::scanVoices: Running" << endl; // Get existing voice code (if any). - QString currentVoiceCode; + TQString currentVoiceCode; int index = m_widget->selectVoiceCombo->currentItem(); if (index < (int)m_voiceList.count()) currentVoiceCode = m_voiceList[index].code; @@ -413,7 +413,7 @@ void FestivalIntConf::scanVoices() // m_supportedVoiceCodes.clear(); m_widget->selectVoiceCombo->clear(); - QString exePath = realFilePath(m_widget->festivalPath->url()); + TQString exePath = realFilePath(m_widget->festivalPath->url()); if (!getLocation(exePath).isEmpty()) { // Set up a progress dialog. @@ -430,10 +430,10 @@ void FestivalIntConf::scanVoices() else { m_festProc = new FestivalIntProc(); - connect (m_festProc, SIGNAL(stopped()), this, SLOT(slotSynthStopped())); + connect (m_festProc, TQT_SIGNAL(stopped()), this, TQT_SLOT(slotSynthStopped())); } - connect (m_festProc, SIGNAL(queryVoicesFinished(const QStringList&)), - this, SLOT(slotQueryVoicesFinished(const QStringList&))); + connect (m_festProc, TQT_SIGNAL(queryVoicesFinished(const TQStringList&)), + this, TQT_SLOT(slotQueryVoicesFinished(const TQStringList&))); m_festProc->queryVoices(exePath); // Display progress dialog modally. @@ -444,8 +444,8 @@ void FestivalIntConf::scanVoices() // Festival responds with the list. When Festival responds with list, // the progress dialog is closed. - disconnect (m_festProc, SIGNAL(queryVoicesFinished(const QStringList&)), - this, SLOT(slotQueryVoicesFinished(const QStringList&))); + disconnect (m_festProc, TQT_SIGNAL(queryVoicesFinished(const TQStringList&)), + this, TQT_SLOT(slotQueryVoicesFinished(const TQStringList&))); if (!m_progressDlg->wasCancelled()) m_festProc->stopText(); delete m_progressDlg; m_progressDlg = 0; @@ -455,37 +455,37 @@ void FestivalIntConf::scanVoices() if (!m_supportedVoiceCodes.isEmpty()) { // User's desktop language setting. - QString desktopLanguageCode = KGlobal::locale()->language(); - QString twoAlpha; - QString countryCode; - QString charSet; + TQString desktopLanguageCode = KGlobal::locale()->language(); + TQString twoAlpha; + TQString countryCode; + TQString charSet; KGlobal::locale()->splitLocale(desktopLanguageCode, twoAlpha, countryCode, charSet); desktopLanguageCode = twoAlpha.lower(); // Festival known voices list. - QString voicesFilename = KGlobal::dirs()->resourceDirs("data").last() + "/kttsd/festivalint/voices"; - QDomDocument voicesDoc("Festival Voices"); - QFile voicesFile(voicesFilename); + TQString voicesFilename = KGlobal::dirs()->resourceDirs("data").last() + "/kttsd/festivalint/voices"; + TQDomDocument voicesDoc("Festival Voices"); + TQFile voicesFile(voicesFilename); if (voicesFile.open(IO_ReadOnly)) voicesDoc.setContent(&voicesFile); voicesFile.close(); - QDomNodeList voices = voicesDoc.elementsByTagName("voice"); + TQDomNodeList voices = voicesDoc.elementsByTagName("voice"); uint voicesCount = voices.count(); if (voicesCount == 0) kdDebug() << "FestivalIntConf::scanVoices: Unable to open " << voicesFilename << ". Is KDEDIR defined?" << endl; // Iterate thru list of voice codes returned by Festival, // find matching entry in voices.xml file, and add to list of supported voices. - QPixmap maleIcon = KGlobal::iconLoader()->loadIcon("male", KIcon::Small); - QPixmap femaleIcon = KGlobal::iconLoader()->loadIcon("female", KIcon::Small); - QStringList::ConstIterator itEnd = m_supportedVoiceCodes.constEnd(); - for(QStringList::ConstIterator it = m_supportedVoiceCodes.begin(); it != itEnd; ++it ) + TQPixmap maleIcon = KGlobal::iconLoader()->loadIcon("male", KIcon::Small); + TQPixmap femaleIcon = KGlobal::iconLoader()->loadIcon("female", KIcon::Small); + TQStringList::ConstIterator itEnd = m_supportedVoiceCodes.constEnd(); + for(TQStringList::ConstIterator it = m_supportedVoiceCodes.begin(); it != itEnd; ++it ) { - QString code = *it; + TQString code = *it; bool found = false; for (uint index=0; index < voicesCount; ++index) { - QDomNode voiceNode = voices.item(index); - QString voiceCode = readXmlString(voiceNode, "code", QString::null); + TQDomNode voiceNode = voices.item(index); + TQString voiceCode = readXmlString(voiceNode, "code", TQString::null); // kdDebug() << "FestivalIntConf::scanVoices: Comparing code " << code << " to " << voiceCode << endl; if (voiceCode == code) { @@ -502,7 +502,7 @@ void FestivalIntConf::scanVoices() voiceTemp.rateAdjustable = readXmlBool(voiceNode, "rate-adjustable", true); voiceTemp.pitchAdjustable = readXmlBool(voiceNode, "pitch-adjustable", true); m_voiceList.append(voiceTemp); - QString voiceDisplayName = voiceTemp.name + " (" + voiceTemp.code + ")"; + TQString voiceDisplayName = voiceTemp.name + " (" + voiceTemp.code + ")"; if (voiceTemp.gender == "male") m_widget->selectVoiceCombo->insertItem(maleIcon, voiceDisplayName); else if (voiceTemp.gender == "female") @@ -536,7 +536,7 @@ void FestivalIntConf::scanVoices() if (selectVoiceComboEnabled != m_widget->selectVoiceCombo->isEnabled()) configChanged(); } -void FestivalIntConf::slotQueryVoicesFinished(const QStringList &voiceCodes) +void FestivalIntConf::slotQueryVoicesFinished(const TQStringList &voiceCodes) { // kdDebug() << "FestivalIntConf::slotQueryVoicesFinished: voiceCodes.count() = " << voiceCodes.count() << endl; m_supportedVoiceCodes = voiceCodes; @@ -552,24 +552,24 @@ void FestivalIntConf::slotTest_clicked() else { m_festProc = new FestivalIntProc(); - connect (m_festProc, SIGNAL(stopped()), this, SLOT(slotSynthStopped())); + connect (m_festProc, TQT_SIGNAL(stopped()), this, TQT_SLOT(slotSynthStopped())); } // Create a temp file name for the wave file. KTempFile tempFile (locateLocal("tmp", "festivalintplugin-"), ".wav"); - QString tmpWaveFile = tempFile.file()->name(); + TQString tmpWaveFile = tempFile.file()->name(); tempFile.close(); // Get the code for the selected voice. - QString voiceCode = m_voiceList[m_widget->selectVoiceCombo->currentItem()].code; + TQString voiceCode = m_voiceList[m_widget->selectVoiceCombo->currentItem()].code; // Get language code for the selected voice. - QString languageCode = m_voiceList[m_widget->selectVoiceCombo->currentItem()].languageCode; + TQString languageCode = m_voiceList[m_widget->selectVoiceCombo->currentItem()].languageCode; // Get test message in the language of the voice. - QString testMsg = testMessage(languageCode); + TQString testMsg = testMessage(languageCode); // Get codec. - QTextCodec* codec = PlugInProc::codecIndexToCodec( + TQTextCodec* codec = PlugInProc::codecIndexToCodec( m_widget->characterCodingBox->currentItem(), m_codecList); // Tell user to wait. @@ -581,7 +581,7 @@ void FestivalIntConf::slotTest_clicked() m_progressDlg->setAllowCancel(true); // kdDebug() << "FestivalIntConf::slotTest_clicked: calling synth with voiceCode: " << voiceCode << " time percent: " << m_widget->timeBox->value() << endl; - connect (m_festProc, SIGNAL(synthFinished()), this, SLOT(slotSynthFinished())); + connect (m_festProc, TQT_SIGNAL(synthFinished()), this, TQT_SLOT(slotSynthFinished())); m_festProc->synth( realFilePath(m_widget->festivalPath->url()), testMsg, @@ -596,7 +596,7 @@ void FestivalIntConf::slotTest_clicked() // Display progress dialog modally. Processing continues when plugin signals synthFinished, // or if user clicks Cancel button. m_progressDlg->exec(); - disconnect (m_festProc, SIGNAL(synthFinished()), this, SLOT(slotSynthFinished())); + disconnect (m_festProc, TQT_SIGNAL(synthFinished()), this, TQT_SLOT(slotSynthFinished())); if (m_progressDlg->wasCancelled()) m_festProc->stopText(); delete m_progressDlg; m_progressDlg = 0; @@ -620,22 +620,22 @@ void FestivalIntConf::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 FestivalIntConf::slotSynthStopped() { // Clean up after canceling test. - QString filename = m_festProc->getFilename(); + TQString filename = m_festProc->getFilename(); // kdDebug() << "FestivalIntConf::slotSynthStopped: filename = " << filename << endl; - if (!filename.isNull()) QFile::remove(filename); + if (!filename.isNull()) TQFile::remove(filename); } void FestivalIntConf::slotFestivalPath_textChanged() { - QString exePath = realFilePath(m_widget->festivalPath->url()); + TQString exePath = realFilePath(m_widget->festivalPath->url()); m_widget->selectVoiceCombo->setEnabled(false); if (!exePath.isEmpty() && !getLocation(exePath).isEmpty()) { @@ -646,7 +646,7 @@ void FestivalIntConf::slotFestivalPath_textChanged() void FestivalIntConf::slotSelectVoiceCombo_activated() { int index = m_widget->selectVoiceCombo->currentItem(); - QString codecName = m_voiceList[index].codecName; + TQString codecName = m_voiceList[index].codecName; int codecNdx = PlugInProc::codecNameToListIndex(codecName, m_codecList); m_widget->characterCodingBox->setCurrentItem(codecNdx); m_widget->preloadCheckBox->setChecked( diff --git a/kttsd/plugins/festivalint/festivalintconf.h b/kttsd/plugins/festivalint/festivalintconf.h index a367682..6a33009 100644 --- a/kttsd/plugins/festivalint/festivalintconf.h +++ b/kttsd/plugins/festivalint/festivalintconf.h @@ -25,8 +25,8 @@ #define _FESTIVALINTCONF_H_ // Qt includes. -#include <qstringlist.h> -#include <qvaluelist.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> // KDE includes. #include <kconfig.h> @@ -43,11 +43,11 @@ class KProgressDialog; class QDomNode; typedef struct voiceStruct{ - QString code; // Code as sent to Festival - QString name; // Name as displayed and returned in Talker Code. - QString languageCode; // Language code (en, es, etc) - QString codecName; // Character encoding codec name (eg. ISO 8859-1) - QString gender; // male, female, or neutral + TQString code; // Code as sent to Festival + TQString name; // Name as displayed and returned in Talker Code. + TQString languageCode; // Language code (en, es, etc) + TQString codecName; // Character encoding codec name (eg. ISO 8859-1) + TQString gender; // male, female, or neutral bool preload; // Start Festival and load this language when KTTSD is started. bool volumeAdjustable; // True if the voice supports volume adjustments. bool rateAdjustable; // True if the voice supports rate adjustments. @@ -59,7 +59,7 @@ class FestivalIntConf : public PlugInConf { public: /** Constructor */ - FestivalIntConf( QWidget* parent = 0, const char* name = 0, const QStringList &args = QStringList()); + FestivalIntConf( TQWidget* parent = 0, const char* name = 0, const TQStringList &args = TQStringList()); /** Destructor */ ~FestivalIntConf(); @@ -71,14 +71,14 @@ class FestivalIntConf : 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 @@ -90,7 +90,7 @@ class FestivalIntConf : 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. * @@ -102,16 +102,16 @@ class FestivalIntConf : 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: /** Scan for the different voices in festivalPath/lib */ @@ -131,7 +131,7 @@ class FestivalIntConf : public PlugInConf { void frequencySlider_valueChanged(int sliderValue); void slotFestivalPath_textChanged(); void slotSelectVoiceCombo_activated(); - void slotQueryVoicesFinished(const QStringList &voiceCodes); + void slotQueryVoicesFinished(const TQStringList &voiceCodes); private: int percentToSlider(int percentValue); @@ -141,19 +141,19 @@ class FestivalIntConf : public PlugInConf { * Given an XML node and child element name, returns the string value from the child element. * If no such child element, returns def. */ - QString readXmlString(QDomNode &node, const QString &elementName, const QString &def); + TQString readXmlString(TQDomNode &node, const TQString &elementName, const TQString &def); /** * Given an XML node and child element name, returns the boolean value from the child element. * If no such child element, returns def. */ - bool readXmlBool(QDomNode &node, const QString &elementName, bool def); + bool readXmlBool(TQDomNode &node, const TQString &elementName, bool def); /** * Given a voice code, returns index into m_voiceList array (and voiceCombo box). * -1 if not found. */ - int voiceCodeToListIndex(const QString& voiceCode) const; + int voiceCodeToListIndex(const TQString& voiceCode) const; /** * Chooses a default voice given scanned list of voices in m_voiceList and current @@ -166,21 +166,21 @@ class FestivalIntConf : public PlugInConf { FestivalIntConfWidget* m_widget; // Language code. - QString m_languageCode; + TQString m_languageCode; // Language country code (if any). - QString m_countryCode; + TQString m_countryCode; // List of voices */ - QValueList<voice> m_voiceList; + TQValueList<voice> m_voiceList; // Festival synthesizer. FestivalIntProc* m_festProc; // Synthesized wave file name. - QString m_waveFile; + TQString m_waveFile; // Progress dialog. KProgressDialog* m_progressDlg; // List of voice codes supported by Festival. - QStringList m_supportedVoiceCodes; + TQStringList m_supportedVoiceCodes; // List of displayed codec names. - QStringList m_codecList; + TQStringList m_codecList; // Whether Festival supports SSML or not. FestivalIntProc::SupportsSSML m_supportsSSML; }; diff --git a/kttsd/plugins/festivalint/festivalintproc.cpp b/kttsd/plugins/festivalint/festivalintproc.cpp index 77822ea..e48f2c4 100644 --- a/kttsd/plugins/festivalint/festivalintproc.cpp +++ b/kttsd/plugins/festivalint/festivalintproc.cpp @@ -25,10 +25,10 @@ #include <math.h> // Qt includes. -#include <qstring.h> -#include <qstringlist.h> -#include <qthread.h> -#include <qtextcodec.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqthread.h> +#include <tqtextcodec.h> // KDE includes. #include <kdebug.h> @@ -43,7 +43,7 @@ #include "festivalintproc.moc" /** Constructor */ -FestivalIntProc::FestivalIntProc( QObject* parent, const char* name, const QStringList& ) : +FestivalIntProc::FestivalIntProc( TQObject* parent, const char* name, const TQStringList& ) : PlugInProc( parent, name ){ // kdDebug() << "FestivalIntProc::FestivalIntProc: Running" << endl; m_ready = true; @@ -54,7 +54,7 @@ FestivalIntProc::FestivalIntProc( QObject* parent, const char* name, const QStri m_state = psIdle; m_supportsSSML = ssUnknown; m_languageCode = "en"; - m_codec = QTextCodec::codecForName("ISO8859-1"); + m_codec = TQTextCodec::codecForName("ISO8859-1"); } /** Destructor */ @@ -84,7 +84,7 @@ FestivalIntProc::~FestivalIntProc(){ } /** Initialize the speech */ -bool FestivalIntProc::init(KConfig *config, const QString &configGroup) +bool FestivalIntProc::init(KConfig *config, const TQString &configGroup) { // kdDebug() << "FestivalIntProc::init: Initializing plug in: Festival" << endl; @@ -99,7 +99,7 @@ bool FestivalIntProc::init(KConfig *config, const QString &configGroup) m_preload = config->readBoolEntry("Preload", false); m_languageCode = config->readEntry("LanguageCode", "en"); m_supportsSSML = static_cast<SupportsSSML>(config->readNumEntry("SupportsSSML", ssUnknown)); - QString codecName = config->readEntry("Codec", "Latin1"); + TQString codecName = config->readEntry("Codec", "Latin1"); m_codec = codecNameToCodec(codecName); if (m_preload) startEngine(m_festivalExePath, m_voiceCode, m_languageCode, m_codec); return true; @@ -111,9 +111,9 @@ bool FestivalIntProc::init(KConfig *config, const QString &configGroup) * * If the plugin supports asynchronous operation, it should return immediately. */ -void FestivalIntProc::sayText(const QString &text) +void FestivalIntProc::sayText(const TQString &text) { - synth(m_festivalExePath, text, QString::null, m_voiceCode, m_time, m_pitch, m_volume, + synth(m_festivalExePath, text, TQString::null, m_voiceCode, m_time, m_pitch, m_volume, m_languageCode, m_codec); } @@ -127,7 +127,7 @@ void FestivalIntProc::sayText(const QString &text) * * If the plugin supports asynchronous operation, it should return immediately. */ -void FestivalIntProc::synthText(const QString& text, const QString& suggestedFilename) +void FestivalIntProc::synthText(const TQString& text, const TQString& suggestedFilename) { synth(m_festivalExePath, text, suggestedFilename, m_voiceCode, m_time, m_pitch, m_volume, m_languageCode, m_codec); @@ -139,12 +139,12 @@ void FestivalIntProc::synthText(const QString& text, const QString& suggestedFil * @return False if busy doing something else and therefore cannot * do the query. */ -bool FestivalIntProc::queryVoices(const QString &festivalExePath) +bool FestivalIntProc::queryVoices(const TQString &festivalExePath) { // kdDebug() << "FestivalIntProc::queryVoices: Running" << endl; if (m_state != psIdle && m_waitingQueryVoices && m_waitingStop) return false; // Start Festival if not already running. - startEngine(festivalExePath, QString::null, m_languageCode, m_codec); + startEngine(festivalExePath, TQString::null, m_languageCode, m_codec); // Set state, waiting for voice codes list from Festival. m_waitingQueryVoices = true; // Voice rab_diphone is needed in order to support SSML. @@ -160,8 +160,8 @@ bool FestivalIntProc::queryVoices(const QString &festivalExePath) * @param voiceCode Voice code in which to speak text. * @param languageCode Language code, for example, "en". */ -void FestivalIntProc::startEngine(const QString &festivalExePath, const QString &voiceCode, - const QString &languageCode, QTextCodec* codec) +void FestivalIntProc::startEngine(const TQString &festivalExePath, const TQString &voiceCode, + const TQString &languageCode, TQTextCodec* codec) { // Initialize Festival only if it's not initialized. if (m_festProc) @@ -184,19 +184,19 @@ void FestivalIntProc::startEngine(const QString &festivalExePath, const QString m_festProc->setEnvironment("LANG", languageCode + "." + codec->mimeName()); m_festProc->setEnvironment("LC_CTYPE", languageCode + "." + codec->mimeName()); // kdDebug() << "FestivalIntProc::startEngine: setting LANG = LC_CTYPE = " << languageCode << "." << codec->mimeName() << endl; - connect(m_festProc, SIGNAL(processExited(KProcess*)), - this, SLOT(slotProcessExited(KProcess*))); - connect(m_festProc, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(slotReceivedStdout(KProcess*, char*, int))); - connect(m_festProc, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedStderr(KProcess*, char*, int))); - connect(m_festProc, SIGNAL(wroteStdin(KProcess*)), - this, SLOT(slotWroteStdin(KProcess*))); + connect(m_festProc, TQT_SIGNAL(processExited(KProcess*)), + this, TQT_SLOT(slotProcessExited(KProcess*))); + connect(m_festProc, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedStdout(KProcess*, char*, int))); + connect(m_festProc, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedStderr(KProcess*, char*, int))); + connect(m_festProc, TQT_SIGNAL(wroteStdin(KProcess*)), + this, TQT_SLOT(slotWroteStdin(KProcess*))); } if (!m_festProc->isRunning()) { // kdDebug() << "FestivalIntProc::startEngine: Starting Festival process" << endl; - m_runningVoiceCode = QString::null; + m_runningVoiceCode = TQString::null; m_runningTime = 100; m_runningPitch = 100; m_ready = false; @@ -239,15 +239,15 @@ void FestivalIntProc::startEngine(const QString &festivalExePath, const QString * @param languageCode Language code, for example, "en". */ void FestivalIntProc::synth( - const QString &festivalExePath, - const QString &text, - const QString &synthFilename, - const QString &voiceCode, + const TQString &festivalExePath, + const TQString &text, + const TQString &synthFilename, + const TQString &voiceCode, int time, int pitch, int volume, - const QString &languageCode, - QTextCodec* codec) + const TQString &languageCode, + TQTextCodec* codec) { // kdDebug() << "FestivalIntProc::synth: festivalExePath = " << festivalExePath // << " voiceCode = " << voiceCode << endl; @@ -256,7 +256,7 @@ void FestivalIntProc::synth( startEngine(festivalExePath, voiceCode, languageCode, codec); // If we just started Festival, or rate changed, tell festival. if (m_runningTime != time) { - QString timeMsg; + TQString timeMsg; if (voiceCode.contains("_hts") > 0) { // Map 50% to 200% onto 0 to 1000. @@ -268,11 +268,11 @@ void FestivalIntProc::synth( slider = slider - 500; // Map -500 to 500 onto 0.15 to -0.15. float stretchValue = -float(slider) * 0.15 / 500.0; - timeMsg = QString("(set! hts_duration_stretch %1)").arg( + timeMsg = TQString("(set! hts_duration_stretch %1)").arg( stretchValue, 0, 'f', 3); } else - timeMsg = QString("(Parameter.set 'Duration_Stretch %1)").arg( + timeMsg = TQString("(Parameter.set 'Duration_Stretch %1)").arg( 1.0/(float(time)/100.0), 0, 'f', 2); sendToFestival(timeMsg); m_runningTime = time; @@ -290,14 +290,14 @@ void FestivalIntProc::synth( { pitchValue = (((pitch - 100) * 395) / 100) + 105; } - QString pitchMsg = QString( + TQString pitchMsg = TQString( "(set! int_lr_params '((target_f0_mean %1) (target_f0_std 14)" "(model_f0_mean 170) (model_f0_std 34)))").arg(pitchValue, 0, 10); sendToFestival(pitchMsg); m_runningPitch = pitch; } - QString saidText = text; + TQString saidText = text; // Split really long sentences into shorter sentences, by looking for commas and converting // to periods. @@ -307,7 +307,7 @@ void FestivalIntProc::synth( len = saidText.findRev(", ", len - (c_tooLong * 2 / 3), true); if (len != -1) { - QString c = saidText.mid(len+2, 1); + TQString c = saidText.mid(len+2, 1); if (c != c.upper()) { saidText.replace(len, 2, ". "); @@ -329,7 +329,7 @@ void FestivalIntProc::synth( if (synthFilename.isNull()) { m_state = psSaying; - m_synthFilename = QString::null; + m_synthFilename = TQString::null; // kdDebug() << "FestivalIntProc::synth: Saying text: '" << saidText << "' using Festival plug in with voice " // << voiceCode << endl; saidText = "(SayText \"" + saidText + "\")"; @@ -351,7 +351,7 @@ void FestivalIntProc::synth( saidText = "(ktts_sabletowave \"" + saidText + "\" \"" + synthFilename + "\" " + - QString::number(volumeValue) + ")"; + TQString::number(volumeValue) + ")"; } else { @@ -362,7 +362,7 @@ void FestivalIntProc::synth( // Synth the text and adjust volume. "(set! utt1 (Utterance Text \"" + saidText + "\"))(utt.synth utt1)" + - "(utt.wave.rescale utt1 " + QString::number(volumeValue) + " t)" + + "(utt.wave.rescale utt1 " + TQString::number(volumeValue) + " t)" + "(utt.save.wave utt1 \"" + synthFilename + "\")"; } sendToFestival(saidText); @@ -374,7 +374,7 @@ void FestivalIntProc::synth( * puts it in the queue. * @param text Text to send or queue. */ -void FestivalIntProc::sendToFestival(const QString& text) +void FestivalIntProc::sendToFestival(const TQString& text) { if (text.isNull()) return; m_outputQueue.append(text); @@ -395,9 +395,9 @@ bool FestivalIntProc::sendIfReady() if (m_writingStdin) return true; if (m_outputQueue.isEmpty()) return false; if (!m_festProc->isRunning()) return false; - QString text = m_outputQueue[0]; + TQString text = m_outputQueue[0]; text += "\n"; - QCString encodedText; + TQCString encodedText; if (m_codec) encodedText = m_codec->fromUnicode(text); else @@ -414,7 +414,7 @@ bool FestivalIntProc::sendIfReady() * Determine if the text has SABLE tags. If so, we will have to use a different * synthesis method. */ -bool FestivalIntProc::isSable(const QString &text) +bool FestivalIntProc::isSable(const TQString &text) { return KttsUtils::hasRootElement( text, "SABLE" ); } @@ -426,7 +426,7 @@ bool FestivalIntProc::isSable(const QString &text) * * The plugin must not re-use the filename. */ -QString FestivalIntProc::getFilename() { return m_synthFilename; } +TQString FestivalIntProc::getFilename() { return m_synthFilename; } /** * Stop text @@ -500,11 +500,11 @@ void FestivalIntProc::slotProcessExited(KProcess*) void FestivalIntProc::slotReceivedStdout(KProcess*, char* buffer, int buflen) { - QString buf = QString::fromLatin1(buffer, buflen); + TQString buf = TQString::fromLatin1(buffer, buflen); // kdDebug() << "FestivalIntProc::slotReceivedStdout: Received from Festival: " << buf << endl; bool promptSeen = (buf.contains("festival>") > 0); bool emitQueryVoicesFinished = false; - QStringList voiceCodesList; + TQStringList voiceCodesList; if (m_waitingQueryVoices && m_outputQueue.isEmpty()) { // Look for opening ( and closing ). @@ -522,7 +522,7 @@ void FestivalIntProc::slotReceivedStdout(KProcess*, char* buffer, int buflen) // Extract contents between parens. buf = buf.mid(1, rightParen - 1); // Space separated list. - voiceCodesList = QStringList::split(" ", buf, false); + voiceCodesList = TQStringList::split(" ", buf, false); emitQueryVoicesFinished = true; } } @@ -569,7 +569,7 @@ void FestivalIntProc::slotReceivedStdout(KProcess*, char* buffer, int buflen) void FestivalIntProc::slotReceivedStderr(KProcess*, char* buffer, int buflen) { - QString buf = QString::fromLatin1(buffer, buflen); + TQString buf = TQString::fromLatin1(buffer, buflen); kdDebug() << "FestivalIntProc::slotReceivedStderr: Received error from Festival: " << buf << endl; } @@ -620,7 +620,7 @@ void FestivalIntProc::ackFinished() if (m_state == psFinished) { m_state = psIdle; - m_synthFilename = QString::null; + m_synthFilename = TQString::null; } } @@ -652,7 +652,7 @@ bool FestivalIntProc::supportsSynth() { return true; } * tags and converts the file to plain text. * @return Name of the XSLT file. */ -QString FestivalIntProc::getSsmlXsltFilename() +TQString FestivalIntProc::getSsmlXsltFilename() { if (m_supportsSSML == ssYes) return KGlobal::dirs()->resourceDirs("data").last() + "kttsd/festivalint/xslt/SSMLtoSable.xsl"; diff --git a/kttsd/plugins/festivalint/festivalintproc.h b/kttsd/plugins/festivalint/festivalintproc.h index a69642c..bae9578 100644 --- a/kttsd/plugins/festivalint/festivalintproc.h +++ b/kttsd/plugins/festivalint/festivalintproc.h @@ -24,8 +24,8 @@ #ifndef _FESTIVALINTPROC_H_ #define _FESTIVALINTPROC_H_ -#include <qstringlist.h> -#include <qmutex.h> +#include <tqstringlist.h> +#include <tqmutex.h> #include <kprocess.h> @@ -46,7 +46,7 @@ class FestivalIntProc : public PlugInProc{ /** * Constructor */ - FestivalIntProc( QObject* parent = 0, const char* name = 0, const QStringList &args = QStringList()); + FestivalIntProc( TQObject* parent = 0, const char* name = 0, const TQStringList &args = TQStringList()); /** * Destructor @@ -58,7 +58,7 @@ class FestivalIntProc : 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); /** * Returns true when festival is ready to speak a sentence. @@ -69,7 +69,7 @@ class FestivalIntProc : public PlugInProc{ * 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. @@ -84,7 +84,7 @@ class FestivalIntProc : 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. @@ -95,7 +95,7 @@ class FestivalIntProc : 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). @@ -171,10 +171,10 @@ class FestivalIntProc : public PlugInProc{ * @param volume Volume percentage. 50 to 200. * @param languageCode Language code, for example, "en". */ - void synth(const QString &festivalExePath, const QString &text, - const QString &synthFilename, const QString& voiceCode, - int time, int pitch, int volume, const QString &languageCode, - QTextCodec* codec); + void synth(const TQString &festivalExePath, const TQString &text, + const TQString &synthFilename, const TQString& voiceCode, + int time, int pitch, int volume, const TQString &languageCode, + TQTextCodec* codec); /** * Sends commands to Festival to query for a list of supported voice codes. @@ -182,7 +182,7 @@ class FestivalIntProc : public PlugInProc{ * @return False if busy doing something else and therefore cannot * do the query. */ - bool queryVoices(const QString &festivalExePath); + bool queryVoices(const TQString &festivalExePath); /** * Returns the name of an XSLT stylesheet that will convert a valid SSML file @@ -193,7 +193,7 @@ class FestivalIntProc : public PlugInProc{ * tags and converts the file to plain text. * @return Name of the XSLT file. */ - QString getSsmlXsltFilename(); + TQString getSsmlXsltFilename(); /** * Whether Festival supports SSML or not. @@ -208,7 +208,7 @@ class FestivalIntProc : public PlugInProc{ * This signal fires upon completion of a queryVoices operation. * The list of voice codes do not have "voice_" prefix. */ - void queryVoicesFinished(const QStringList &voiceCodes); + void queryVoicesFinished(const TQStringList &voiceCodes); private slots: void slotProcessExited(KProcess* proc); @@ -223,15 +223,15 @@ class FestivalIntProc : public PlugInProc{ * @param voiceCode Voice code in which to speak text. * @param languageCode Language code, for example, "en". */ - void startEngine(const QString &festivalExePath, const QString &voiceCode, - const QString &languageCode, QTextCodec* codec); + void startEngine(const TQString &festivalExePath, const TQString &voiceCode, + const TQString &languageCode, TQTextCodec* codec); /** * If ready for more output, sends the given text to Festival process, otherwise, * puts it in the queue. * @param text Text to send or queue. */ - void sendToFestival(const QString& text); + void sendToFestival(const TQString& text); /** * If Festival is ready for more input and there is more output to send, send it. @@ -247,7 +247,7 @@ class FestivalIntProc : public PlugInProc{ * Determine if the text has SABLE tags. If so, we will have to use a different * synthesis method. */ - bool isSable(const QString &text); + bool isSable(const TQString &text); /** * We attempt to shorten sentences longer than this by replacing commas with periods. @@ -257,12 +257,12 @@ class FestivalIntProc : public PlugInProc{ /** * Path to the Festival executable. */ - QString m_festivalExePath; + TQString m_festivalExePath; /** * Selected voice (from config). */ - QString m_voiceCode; + TQString m_voiceCode; /** * True if the voice is preloaded. Also used as a flag to supress killing @@ -288,7 +288,7 @@ class FestivalIntProc : public PlugInProc{ /** * Running voice. */ - QString m_runningVoiceCode; + TQString m_runningVoiceCode; /** * Running time (speed). @@ -308,7 +308,7 @@ class FestivalIntProc : public PlugInProc{ /** * Synthesis filename. */ - QString m_synthFilename; + TQString m_synthFilename; /** * True when festival is ready for another input. @@ -337,19 +337,19 @@ class FestivalIntProc : public PlugInProc{ * sending the next command, this queue allows us to queue up multiple * commands and send each one when the ReceivedStdOut signal fires. */ - QStringList m_outputQueue; + TQStringList m_outputQueue; bool m_writingStdin; /** * Language code. */ - QString m_languageCode; + TQString m_languageCode; /** * Codec. */ - QTextCodec* m_codec; + TQTextCodec* m_codec; /** * Flag if SSML is supported. Festival cannot support SABLE (and therefore SSML) 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. 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. 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) { |