diff options
Diffstat (limited to 'kttsd/kttsd')
-rw-r--r-- | kttsd/kttsd/filtermgr.cpp | 74 | ||||
-rw-r--r-- | kttsd/kttsd/filtermgr.h | 30 | ||||
-rw-r--r-- | kttsd/kttsd/kttsd.cpp | 224 | ||||
-rw-r--r-- | kttsd/kttsd/kttsd.h | 132 | ||||
-rw-r--r-- | kttsd/kttsd/speaker.cpp | 156 | ||||
-rw-r--r-- | kttsd/kttsd/speaker.h | 52 | ||||
-rw-r--r-- | kttsd/kttsd/speechdata.cpp | 180 | ||||
-rw-r--r-- | kttsd/kttsd/speechdata.h | 128 | ||||
-rw-r--r-- | kttsd/kttsd/ssmlconvert.cpp | 68 | ||||
-rw-r--r-- | kttsd/kttsd/ssmlconvert.h | 30 | ||||
-rw-r--r-- | kttsd/kttsd/talkermgr.cpp | 72 | ||||
-rw-r--r-- | kttsd/kttsd/talkermgr.h | 36 | ||||
-rw-r--r-- | kttsd/kttsd/threadedplugin.cpp | 24 | ||||
-rw-r--r-- | kttsd/kttsd/threadedplugin.h | 28 |
14 files changed, 617 insertions, 617 deletions
diff --git a/kttsd/kttsd/filtermgr.cpp b/kttsd/kttsd/filtermgr.cpp index 3b0474b..88dc6b0 100644 --- a/kttsd/kttsd/filtermgr.cpp +++ b/kttsd/kttsd/filtermgr.cpp @@ -37,7 +37,7 @@ /** * Constructor. */ -FilterMgr::FilterMgr( QObject *parent, const char *name) : +FilterMgr::FilterMgr( TQObject *parent, const char *name) : KttsFilterProc(parent, name) { // kdDebug() << "FilterMgr::FilterMgr: Running" << endl; @@ -64,11 +64,11 @@ FilterMgr::~FilterMgr() * @param config Settings object. * @return False if FilterMgr is not ready to filter. */ -bool FilterMgr::init(KConfig *config, const QString& /*configGroup*/) +bool FilterMgr::init(KConfig *config, const TQString& /*configGroup*/) { // Load each of the filters and initialize. config->setGroup("General"); - QStringList filterIDsList = config->readListEntry("FilterIDs", ','); + TQStringList filterIDsList = config->readListEntry("FilterIDs", ','); // kdDebug() << "FilterMgr::init: FilterIDs = " << filterIDsList << endl; // If no filters have been configured, automatically configure the standard SBD. if (filterIDsList.isEmpty()) @@ -87,13 +87,13 @@ bool FilterMgr::init(KConfig *config, const QString& /*configGroup*/) } if ( !filterIDsList.isEmpty() ) { - QStringList::ConstIterator itEnd = filterIDsList.constEnd(); - for (QStringList::ConstIterator it = filterIDsList.constBegin(); it != itEnd; ++it) + TQStringList::ConstIterator itEnd = filterIDsList.constEnd(); + for (TQStringList::ConstIterator it = filterIDsList.constBegin(); it != itEnd; ++it) { - QString filterID = *it; - QString groupName = "Filter_" + filterID; + TQString filterID = *it; + TQString groupName = "Filter_" + filterID; config->setGroup( groupName ); - QString desktopEntryName = config->readEntry( "DesktopEntryName" ); + TQString desktopEntryName = config->readEntry( "DesktopEntryName" ); // If a DesktopEntryName is not in the config file, it was configured before // we started using them, when we stored translated plugin names instead. // Try to convert the translated plugin name to a DesktopEntryName. @@ -101,7 +101,7 @@ bool FilterMgr::init(KConfig *config, const QString& /*configGroup*/) // and DesktopEntryName won't change. if (desktopEntryName.isEmpty()) { - QString filterPlugInName = config->readEntry("PlugInName", QString::null); + TQString filterPlugInName = config->readEntry("PlugInName", TQString::null); // See if the translated name will untranslate. If not, well, sorry. desktopEntryName = FilterNameToDesktopEntryName(filterPlugInName); // Record the DesktopEntryName from now on. @@ -154,7 +154,7 @@ bool FilterMgr::init(KConfig *config, const QString& /*configGroup*/) * Also useful for hints about how to do the filtering. * @return Converted text. */ -QString FilterMgr::convert(const QString& inputText, TalkerCode* talkerCode, const QCString& appId) +TQString FilterMgr::convert(const TQString& inputText, TalkerCode* talkerCode, const TQCString& appId) { m_text = inputText; m_talkerCode = talkerCode; @@ -180,7 +180,7 @@ QString FilterMgr::convert(const QString& inputText, TalkerCode* talkerCode, con * When the input text has been converted, filteringFinished signal will be emitted * and caller can retrieve using getOutput(); */ -bool FilterMgr::asyncConvert(const QString& inputText, TalkerCode* talkerCode, const QCString& appId) +bool FilterMgr::asyncConvert(const TQString& inputText, TalkerCode* talkerCode, const TQCString& appId) { m_text = inputText; m_talkerCode = talkerCode; @@ -202,7 +202,7 @@ void FilterMgr::nextFilter() { m_text = m_filterProc->getOutput(); m_filterProc->ackFinished(); - disconnect( m_filterProc, SIGNAL(filteringFinished()), this, SLOT(slotFilteringFinished()) ); + disconnect( m_filterProc, TQT_SIGNAL(filteringFinished()), this, TQT_SLOT(slotFilteringFinished()) ); } // if ( m_filterProc->wasModified() ) // kdDebug() << "FilterMgr::nextFilter: Filter# " << m_filterIndex << " modified the text." << endl; @@ -210,8 +210,8 @@ void FilterMgr::nextFilter() { m_state = fsFinished; // Post an event which will be later emitted as a signal. - QCustomEvent* ev = new QCustomEvent(QEvent::User + 301); - QApplication::postEvent(this, ev); + TQCustomEvent* ev = new TQCustomEvent(TQEvent::User + 301); + TQApplication::postEvent(this, ev); return; } } @@ -220,8 +220,8 @@ void FilterMgr::nextFilter() { m_state = fsFinished; // Post an event which will be later emitted as a signal. - QCustomEvent* ev = new QCustomEvent(QEvent::User + 301); - QApplication::postEvent(this, ev); + TQCustomEvent* ev = new TQCustomEvent(TQEvent::User + 301); + TQApplication::postEvent(this, ev); return; } m_filterProc = m_filterList.at(m_filterIndex); @@ -229,8 +229,8 @@ void FilterMgr::nextFilter() { m_state = fsFinished; // Post an event which will be later emitted as a signal. - QCustomEvent* ev = new QCustomEvent(QEvent::User + 301); - QApplication::postEvent(this, ev); + TQCustomEvent* ev = new TQCustomEvent(TQEvent::User + 301); + TQApplication::postEvent(this, ev); return; } m_filterProc->setSbRegExp( m_re ); @@ -239,10 +239,10 @@ void FilterMgr::nextFilter() if ( m_filterProc->supportsAsync() ) { // kdDebug() << "FilterMgr::nextFilter: calling asyncConvert on filter " << m_filterIndex << endl; - connect( m_filterProc, SIGNAL(filteringFinished()), this, SLOT(slotFilteringFinished()) ); + connect( m_filterProc, TQT_SIGNAL(filteringFinished()), this, TQT_SLOT(slotFilteringFinished()) ); if ( !m_filterProc->asyncConvert( m_text, m_talkerCode, m_appId ) ) { - disconnect( m_filterProc, SIGNAL(filteringFinished()), this, SLOT(slotFilteringFinished()) ); + disconnect( m_filterProc, TQT_SIGNAL(filteringFinished()), this, TQT_SLOT(slotFilteringFinished()) ); m_filterProc = 0; nextFilter(); } @@ -261,15 +261,15 @@ void FilterMgr::slotFilteringFinished() nextFilter(); } -bool FilterMgr::event ( QEvent * e ) +bool FilterMgr::event ( TQEvent * e ) { - if ( e->type() == (QEvent::User + 301) ) + if ( e->type() == (TQEvent::User + 301) ) { // kdDebug() << "FilterMgr::event: emitting filteringFinished signal." << endl; emit filteringFinished(); return true; } - if ( e->type() == (QEvent::User + 302) ) + if ( e->type() == (TQEvent::User + 302) ) { // kdDebug() << "FilterMgr::event: emitting filteringStopped signal." << endl; emit filteringStopped(); @@ -284,7 +284,7 @@ bool FilterMgr::event ( QEvent * e ) void FilterMgr::waitForFinished() { if ( m_state != fsFiltering ) return; - disconnect(m_filterProc, SIGNAL(filteringFinished()), this, SLOT(slotFilteringFinished()) ); + disconnect(m_filterProc, TQT_SIGNAL(filteringFinished()), this, TQT_SLOT(slotFilteringFinished()) ); m_async = false; m_filterProc->waitForFinished(); while ( m_state == fsFiltering ) @@ -299,7 +299,7 @@ int FilterMgr::getState() { return m_state; } /** * Returns the filtered output. */ -QString FilterMgr::getOutput() +TQString FilterMgr::getOutput() { return m_text; } @@ -310,7 +310,7 @@ QString FilterMgr::getOutput() void FilterMgr::ackFinished() { m_state = fsIdle; - m_text = QString::null; + m_text = TQString::null; } /** @@ -321,11 +321,11 @@ void FilterMgr::stopFiltering() { if ( m_state != fsFiltering ) return; if ( m_async ) - disconnect( m_filterProc, SIGNAL(filteringFinished()), this, SLOT(slotFilteringFinished()) ); + disconnect( m_filterProc, TQT_SIGNAL(filteringFinished()), this, TQT_SLOT(slotFilteringFinished()) ); m_filterProc->stopFiltering(); m_state = fsIdle; - QCustomEvent* ev = new QCustomEvent(QEvent::User + 302); - QApplication::postEvent(this, ev); + TQCustomEvent* ev = new TQCustomEvent(TQEvent::User + 302); + TQApplication::postEvent(this, ev); } /** @@ -334,7 +334,7 @@ void FilterMgr::stopFiltering() * * @param re The sentence delimiter regular expression. */ -/*virtual*/ void FilterMgr::setSbRegExp(const QString& re) +/*virtual*/ void FilterMgr::setSbRegExp(const TQString& re) { m_re = re; } @@ -346,13 +346,13 @@ void FilterMgr::setNoSBD(bool noSBD) { m_noSBD = noSBD; } bool FilterMgr::noSBD() { return m_noSBD; } // Loads the processing plug in for a filter plug in given its DesktopEntryName. -KttsFilterProc* FilterMgr::loadFilterPlugin(const QString& desktopEntryName) +KttsFilterProc* FilterMgr::loadFilterPlugin(const TQString& desktopEntryName) { // kdDebug() << "FilterMgr::loadFilterPlugin: Running"<< endl; // Find the plugin. KTrader::OfferList offers = KTrader::self()->query("KTTSD/FilterPlugin", - QString("DesktopEntryName == '%1'").arg(desktopEntryName)); + TQString("DesktopEntryName == '%1'").arg(desktopEntryName)); if (offers.count() == 1) { @@ -366,7 +366,7 @@ KttsFilterProc* FilterMgr::loadFilterPlugin(const QString& desktopEntryName) KttsFilterProc *plugIn = KParts::ComponentFactory::createInstanceFromLibrary<KttsFilterProc>( offers[0]->library().latin1(), NULL, offers[0]->library().latin1(), - QStringList(), &errorNo); + TQStringList(), &errorNo); if(plugIn){ // If everything went ok, return the plug in pointer. return plugIn; @@ -392,14 +392,14 @@ KttsFilterProc* FilterMgr::loadFilterPlugin(const QString& desktopEntryName) * Uses KTrader to convert a translated Filter Plugin Name to DesktopEntryName. * @param name The translated plugin name. From Name= line in .desktop file. * @return DesktopEntryName. The name of the .desktop file (less .desktop). - * QString::null if not found. + * TQString::null if not found. */ -QString FilterMgr::FilterNameToDesktopEntryName(const QString& name) +TQString FilterMgr::FilterNameToDesktopEntryName(const TQString& name) { - if (name.isEmpty()) return QString::null; + if (name.isEmpty()) return TQString::null; KTrader::OfferList offers = KTrader::self()->query("KTTSD/FilterPlugin"); for (uint ndx = 0; ndx < offers.count(); ++ndx) if (offers[ndx]->name() == name) return offers[ndx]->desktopEntryName(); - return QString::null; + return TQString::null; } diff --git a/kttsd/kttsd/filtermgr.h b/kttsd/kttsd/filtermgr.h index d909128..2a8ea23 100644 --- a/kttsd/kttsd/filtermgr.h +++ b/kttsd/kttsd/filtermgr.h @@ -27,7 +27,7 @@ #define _FILTERMGR_H_ // Qt includes. -#include <qptrlist.h> +#include <tqptrlist.h> // KTTS includes. #include "filterproc.h" @@ -35,7 +35,7 @@ class KConfig; class TalkerCode; -typedef QPtrList<KttsFilterProc> FilterList; +typedef TQPtrList<KttsFilterProc> FilterList; class FilterMgr : public KttsFilterProc { @@ -45,7 +45,7 @@ class FilterMgr : public KttsFilterProc /** * Constructor. */ - FilterMgr(QObject *parent = 0, const char *name = 0); + FilterMgr(TQObject *parent = 0, const char *name = 0); /** * Destructor. @@ -61,7 +61,7 @@ class FilterMgr : public KttsFilterProc * Note: The parameters are for reading from kttsdrc file. Plugins may wish to maintain * separate configuration files of their own. */ - virtual bool init(KConfig *config, const QString &configGroup); + virtual bool init(KConfig *config, const TQString &configGroup); /** * Returns True if this filter is a Sentence Boundary Detector. @@ -92,7 +92,7 @@ class FilterMgr : public KttsFilterProc * Also useful for hints about how to do the filtering. * @return Converted text. */ - virtual QString convert(const QString& inputText, TalkerCode* talkerCode, const QCString& appId); + virtual TQString convert(const TQString& inputText, TalkerCode* talkerCode, const TQCString& appId); /** * Asynchronously convert input. @@ -106,7 +106,7 @@ class FilterMgr : public KttsFilterProc * When the input text has been converted, filteringFinished signal will be emitted * and caller can retrieve using getOutput(); */ - virtual bool asyncConvert(const QString& inputText, TalkerCode* talkerCode, const QCString& appId); + virtual bool asyncConvert(const TQString& inputText, TalkerCode* talkerCode, const TQCString& appId); /** * Waits for filtering to finish. @@ -121,7 +121,7 @@ class FilterMgr : public KttsFilterProc /** * Returns the filtered output. */ - virtual QString getOutput(); + virtual TQString getOutput(); /** * Acknowledges the finished filtering. @@ -140,7 +140,7 @@ class FilterMgr : public KttsFilterProc * * @param re The sentence delimiter regular expression. */ - virtual void setSbRegExp(const QString& re); + virtual void setSbRegExp(const TQString& re); /** * Do not call SBD filters. @@ -154,26 +154,26 @@ class FilterMgr : public KttsFilterProc bool supportsHTML() { return m_supportsHTML; } protected: - bool event ( QEvent * e ); + bool event ( TQEvent * e ); private slots: void slotFilteringFinished(); private: // Loads the processing plug in for a named filter plug in. - KttsFilterProc* loadFilterPlugin(const QString& plugInName); + KttsFilterProc* loadFilterPlugin(const TQString& plugInName); // Finishes up with current filter (if any) and goes on to the next filter. void nextFilter(); // Uses KTrader to convert a translated Filter Plugin Name to DesktopEntryName. // @param name The translated plugin name. From Name= line in .desktop file. // @return DesktopEntryName. The name of the .desktop file (less .desktop). - // QString::null if not found. - QString FilterNameToDesktopEntryName(const QString& name); + // TQString::null if not found. + TQString FilterNameToDesktopEntryName(const TQString& name); // List of filters. FilterList m_filterList; // Text being filtered. - QString m_text; + TQString m_text; // Index to list of filters. int m_filterIndex; // Current filter. @@ -183,9 +183,9 @@ class FilterMgr : public KttsFilterProc // Talker Code. TalkerCode* m_talkerCode; // AppId. - QCString m_appId; + TQCString m_appId; // Sentence Boundary regular expression (if app overrode the default). - QString m_re; + TQString m_re; // True if any of the filters modified the text. bool m_wasModified; // FilterMgr state. diff --git a/kttsd/kttsd/kttsd.cpp b/kttsd/kttsd/kttsd.cpp index 9ee841f..5a643a1 100644 --- a/kttsd/kttsd/kttsd.cpp +++ b/kttsd/kttsd/kttsd.cpp @@ -19,11 +19,11 @@ ***************************************************************************/ // Qt includes. -#include <qcstring.h> -#include <qclipboard.h> -#include <qtextstream.h> -#include <qtextcodec.h> -#include <qfile.h> +#include <tqcstring.h> +#include <tqclipboard.h> +#include <tqtextstream.h> +#include <tqtextcodec.h> +#include <tqfile.h> // KDE includes. #include <kdebug.h> @@ -49,9 +49,9 @@ * Note that most of the real tts work occurs in Speaker. */ -KTTSD::KTTSD(const QCString& objId, QObject *parent, const char *name) : +KTTSD::KTTSD(const TQCString& objId, TQObject *parent, const char *name) : DCOPObject(objId), - QObject(parent, name) + TQObject(parent, name) { // kdDebug() << "KTTSD::KTTSD Running" << endl; m_speaker = 0; @@ -69,17 +69,17 @@ bool KTTSD::initializeSpeechData() if (!m_speechData) { m_speechData = new SpeechData(); - connect (m_speechData, SIGNAL(textSet(const QCString&, const uint)), - this, SLOT(slotTextSet(const QCString&, const uint))); - connect (m_speechData, SIGNAL(textAppended(const QCString&, const uint, const int)), - this, SLOT(slotTextAppended(const QCString&, const uint, const int))); - connect (m_speechData, SIGNAL(textRemoved(const QCString&, const uint)), - this, SLOT(slotTextRemoved(const QCString&, const uint))); + connect (m_speechData, TQT_SIGNAL(textSet(const TQCString&, const uint)), + this, TQT_SLOT(slotTextSet(const TQCString&, const uint))); + connect (m_speechData, TQT_SIGNAL(textAppended(const TQCString&, const uint, const int)), + this, TQT_SLOT(slotTextAppended(const TQCString&, const uint, const int))); + connect (m_speechData, TQT_SIGNAL(textRemoved(const TQCString&, const uint)), + this, TQT_SLOT(slotTextRemoved(const TQCString&, const uint))); // Hook KNotify signal. if (!connectDCOPSignal(0, 0, - "notifySignal(QString,QString,QString,QString,QString,int,int,int,int)", - "notificationSignal(QString,QString,QString,QString,QString,int,int,int,int)", + "notifySignal(TQString,TQString,TQString,TQString,TQString,int,int,int,int)", + "notificationSignal(TQString,TQString,TQString,TQString,TQString,int,int,int,int)", false)) kdDebug() << "KTTSD:initializeSpeechData: connectDCOPSignal for knotify failed" << endl; } // Load configuration. @@ -103,7 +103,7 @@ bool KTTSD::initializeTalkerMgr() // desktop language, but if that fails, fallback to English. if (load < 0) { - QString languageCode = KGlobal::locale()->language(); + TQString languageCode = KGlobal::locale()->language(); if (m_talkerMgr->autoconfigureTalker(languageCode, m_speechData->config)) load = m_talkerMgr->loadPlugIns(m_speechData->config); else @@ -124,7 +124,7 @@ bool KTTSD::initializeTalkerMgr() m_speechData = 0; kdDebug() << "KTTSD::initializeTalkerMgr: no Talkers have been configured." << endl; // Ask if user would like to run configuration dialog, but don't bug user unnecessarily. - QString dontAskConfigureKTTS = "DontAskConfigureKTTS"; + TQString dontAskConfigureKTTS = "DontAskConfigureKTTS"; KMessageBox::ButtonCode msgResult; if (KMessageBox::shouldBeShownYesNo(dontAskConfigureKTTS, msgResult)) { @@ -156,20 +156,20 @@ bool KTTSD::initializeSpeaker() // Create speaker object and load plug ins, checking for the return m_speaker = new Speaker(m_speechData, m_talkerMgr); - connect (m_speaker, SIGNAL(textStarted(const QCString&, const uint)), - this, SLOT(slotTextStarted(const QCString&, const uint))); - connect (m_speaker, SIGNAL(textFinished(const QCString&, const uint)), - this, SLOT(slotTextFinished(const QCString&, const uint))); - connect (m_speaker, SIGNAL(textResumed(const QCString&, const uint)), - this, SLOT(slotTextResumed(const QCString&, const uint))); - connect (m_speaker, SIGNAL(sentenceStarted(QString, QString, const QCString&, const uint, const uint)), - this, SLOT(slotSentenceStarted(QString, QString, const QCString&, const uint, const uint))); - connect (m_speaker, SIGNAL(sentenceFinished(const QCString&, const uint, const uint)), this, - SLOT(slotSentenceFinished(const QCString&, const uint, const uint))); - connect (m_speaker, SIGNAL(textStopped(const QCString&, const uint)), - this, SLOT(slotTextStopped(const QCString&, const uint))); - connect (m_speaker, SIGNAL(textPaused(const QCString&, const uint)), - this, SLOT(slotTextPaused(const QCString&, const uint))); + connect (m_speaker, TQT_SIGNAL(textStarted(const TQCString&, const uint)), + this, TQT_SLOT(slotTextStarted(const TQCString&, const uint))); + connect (m_speaker, TQT_SIGNAL(textFinished(const TQCString&, const uint)), + this, TQT_SLOT(slotTextFinished(const TQCString&, const uint))); + connect (m_speaker, TQT_SIGNAL(textResumed(const TQCString&, const uint)), + this, TQT_SLOT(slotTextResumed(const TQCString&, const uint))); + connect (m_speaker, TQT_SIGNAL(sentenceStarted(TQString, TQString, const TQCString&, const uint, const uint)), + this, TQT_SLOT(slotSentenceStarted(TQString, TQString, const TQCString&, const uint, const uint))); + connect (m_speaker, TQT_SIGNAL(sentenceFinished(const TQCString&, const uint, const uint)), this, + TQT_SLOT(slotSentenceFinished(const TQCString&, const uint, const uint))); + connect (m_speaker, TQT_SIGNAL(textStopped(const TQCString&, const uint)), + this, TQT_SLOT(slotTextStopped(const TQCString&, const uint))); + connect (m_speaker, TQT_SIGNAL(textPaused(const TQCString&, const uint)), + this, TQT_SLOT(slotTextPaused(const TQCString&, const uint))); return true; } @@ -199,7 +199,7 @@ KTTSD::~KTTSD(){ * talker supports the indicated speech markup language. * @see kttsdMarkupType */ -bool KTTSD::supportsMarkup(const QString& talker /*=NULL*/, const uint markupType /*=0*/) const +bool KTTSD::supportsMarkup(const TQString& talker /*=NULL*/, const uint markupType /*=0*/) const { if (markupType == KSpeech::mtHtml) { @@ -219,7 +219,7 @@ bool KTTSD::supportsMarkup(const QString& talker /*=NULL*/, const uint markupTyp * talker supports markers. * TODO: Waiting on plugin API. */ -bool KTTSD::supportsMarkers(const QString& /*talker=NULL*/) const { return false; } +bool KTTSD::supportsMarkers(const TQString& /*talker=NULL*/) const { return false; } /** * Say a message as soon as possible, interrupting any other speech in progress. @@ -234,7 +234,7 @@ bool KTTSD::supportsMarkers(const QString& /*talker=NULL*/) const { return false * If an existing Screen Reader output is in progress, it is stopped and discarded and * replaced with this new message. */ -void KTTSD::sayScreenReaderOutput(const QString &msg, const QString &talker /*=NULL*/) +void KTTSD::sayScreenReaderOutput(const TQString &msg, const TQString &talker /*=NULL*/) { if (!m_speaker) return; m_speechData->setScreenReaderOutput(msg, fixNullString(talker), getAppId()); @@ -252,7 +252,7 @@ void KTTSD::sayScreenReaderOutput(const QString &msg, const QString &talker /*=N * If no plugin has been configured for the specified Talker code, * defaults to the closest matching talker. */ -void KTTSD::sayWarning(const QString &warning, const QString &talker /*=NULL*/){ +void KTTSD::sayWarning(const TQString &warning, const TQString &talker /*=NULL*/){ // kdDebug() << "KTTSD::sayWarning: Running" << endl; if (!m_speaker) return; kdDebug() << "KTTSD::sayWarning: Adding '" << warning << "' to warning queue." << endl; @@ -271,7 +271,7 @@ void KTTSD::sayWarning(const QString &warning, const QString &talker /*=NULL*/){ * If no talker has been configured for the specified Talker code, * defaults to the closest matching talker. */ -void KTTSD::sayMessage(const QString &message, const QString &talker /*=NULL*/) +void KTTSD::sayMessage(const TQString &message, const TQString &talker /*=NULL*/) { // kdDebug() << "KTTSD::sayMessage: Running" << endl; if (!m_speaker) return; @@ -294,7 +294,7 @@ void KTTSD::sayMessage(const QString &message, const QString &talker /*=NULL*/) * Changing the sentence delimiter does not affect other applications. * @see sentenceparsing */ -void KTTSD::setSentenceDelimiter(const QString &delimiter) +void KTTSD::setSentenceDelimiter(const TQString &delimiter) { if (!m_speaker) return; m_speechData->setSentenceDelimiter(fixNullString(delimiter), getAppId()); @@ -322,7 +322,7 @@ void KTTSD::setSentenceDelimiter(const QString &delimiter) * @see getTextCount * @see startText */ -uint KTTSD::setText(const QString &text, const QString &talker /*=NULL*/) +uint KTTSD::setText(const TQString &text, const TQString &talker /*=NULL*/) { // kdDebug() << "KTTSD::setText: Running" << endl; if (!m_speaker) return 0; @@ -359,7 +359,7 @@ uint KTTSD::setText(const QString &text, const QString &talker /*=NULL*/) * * @since KDE 3.5 */ -uint KTTSD::sayText(const QString &text, const QString &talker) +uint KTTSD::sayText(const TQString &text, const TQString &talker) { uint jobNum = setText(text, talker); if (jobNum) startText(jobNum); @@ -381,7 +381,7 @@ uint KTTSD::sayText(const QString &text, const QString &talker) * @see setText. * @see startText. */ -int KTTSD::appendText(const QString &text, const uint jobNum /*=0*/) +int KTTSD::appendText(const TQString &text, const uint jobNum /*=0*/) { if (!m_speaker) return 0; return m_speechData->appendText(text, applyDefaultJobNum(jobNum), getAppId()); @@ -411,20 +411,20 @@ int KTTSD::appendText(const QString &text, const uint jobNum /*=0*/) * @see getTextCount * @see startText */ -uint KTTSD::setFile(const QString &filename, const QString &talker /*=NULL*/, - const QString &encoding /*=NULL*/) +uint KTTSD::setFile(const TQString &filename, const TQString &talker /*=NULL*/, + const TQString &encoding /*=NULL*/) { // kdDebug() << "KTTSD::setFile: Running" << endl; if (!m_speaker) return 0; - QFile file(filename); + TQFile file(filename); uint jobNum = 0; if ( file.open(IO_ReadOnly) ) { - QTextStream stream(&file); - QString enc = fixNullString(encoding); + TQTextStream stream(&file); + TQString enc = fixNullString(encoding); if (!enc.isEmpty()) { - QTextCodec* codec = QTextCodec::codecForName(enc.latin1()); + TQTextCodec* codec = TQTextCodec::codecForName(enc.latin1()); if (codec) stream.setCodec(codec); } jobNum = m_speechData->setText(stream.read(), fixNullString(talker), getAppId()); @@ -477,9 +477,9 @@ uint KTTSD::getTextJobCount() * Get a comma-separated list of text job numbers in the queue. * @return Comma-separated list of text job numbers in the queue. */ -QString KTTSD::getTextJobNumbers() +TQString KTTSD::getTextJobNumbers() { - if (!m_speaker) return QString::null; + if (!m_speaker) return TQString::null; return m_speechData->getTextJobNumbers(); } @@ -501,23 +501,23 @@ int KTTSD::getTextJobState(const uint jobNum /*=0*/) * Get information about a text job. * @param jobNum Job number of the text job. * If zero, applies to the last job queued by the application. -* @return A QDataStream containing information about the job. +* @return A TQDataStream containing information about the job. * Blank if no such job. * * The stream contains the following elements: * - int state Job state. -* - QCString appId DCOP senderId of the application that requested the speech job. -* - QString talker Language code in which to speak the text. +* - TQCString appId DCOP senderId of the application that requested the speech job. +* - TQString talker Language code in which to speak the text. * - int seq Current sentence being spoken. Sentences are numbered starting at 1. * - int sentenceCount Total number of sentences in the job. * * The following sample code will decode the stream: @verbatim - QByteArray jobInfo = getTextJobInfo(jobNum); - QDataStream stream(jobInfo, IO_ReadOnly); + TQByteArray jobInfo = getTextJobInfo(jobNum); + TQDataStream stream(jobInfo, IO_ReadOnly); int state; - QCString appId; - QString talker; + TQCString appId; + TQString talker; int seq; int sentenceCount; stream >> state; @@ -527,7 +527,7 @@ int KTTSD::getTextJobState(const uint jobNum /*=0*/) stream >> sentenceCount; @endverbatim */ -QByteArray KTTSD::getTextJobInfo(const uint jobNum /*=0*/) +TQByteArray KTTSD::getTextJobInfo(const uint jobNum /*=0*/) { return m_speechData->getTextJobInfo(applyDefaultJobNum(jobNum)); } @@ -538,9 +538,9 @@ QByteArray KTTSD::getTextJobInfo(const uint jobNum /*=0*/) * @param talkerCode Talker Code. * @return Talker ID of the talker that would speak the text job. */ -QString KTTSD::talkerCodeToTalkerId(const QString& talkerCode) +TQString KTTSD::talkerCodeToTalkerId(const TQString& talkerCode) { - if (!m_talkerMgr) return QString::null; + if (!m_talkerMgr) return TQString::null; return m_talkerMgr->talkerCodeToTalkerId(fixNullString(talkerCode)); } @@ -552,7 +552,7 @@ QString KTTSD::talkerCodeToTalkerId(const QString& talkerCode) * @return The specified sentence in the specified job. If no such * job or sentence, returns "". */ -QString KTTSD::getTextJobSentence(const uint jobNum /*=0*/, const uint seq /*=1*/) +TQString KTTSD::getTextJobSentence(const uint jobNum /*=0*/, const uint seq /*=1*/) { return m_speechData->getTextJobSentence(applyDefaultJobNum(jobNum), seq); } @@ -616,7 +616,7 @@ void KTTSD::startText(const uint jobNum /*=0*/) // Do not start KTTSMgr unless at least 5 sentences are queued. if (getTextCount(jNum) > 4) { - QString cmd = "kttsmgr --systray"; + TQString cmd = "kttsmgr --systray"; if (m_speechData->autoExitManager) cmd.append(" --autoexit"); // Notice this fails if KTTSMgr is already running, which is what we want. KRun::runCommand(cmd); @@ -694,14 +694,14 @@ void KTTSD::resumeText(const uint jobNum /*=0*/) /** * Get a list of the talkers configured in KTTS. -* @return A QStringList of fully-specified talker codes, one +* @return A TQStringList of fully-specified talker codes, one * for each talker user has configured. * * @see talkers */ -QStringList KTTSD::getTalkers() +TQStringList KTTSD::getTalkers() { - if (!m_talkerMgr) return QStringList(); + if (!m_talkerMgr) return TQStringList(); return m_talkerMgr->getTalkers(); } @@ -714,7 +714,7 @@ QStringList KTTSD::getTalkers() * If no plugin has been configured for the specified Talker code, * defaults to the closest matching talker. */ -void KTTSD::changeTextTalker(const QString &talker, uint jobNum) +void KTTSD::changeTextTalker(const TQString &talker, uint jobNum) { m_speechData->changeTextTalker(fixNullString(talker), applyDefaultJobNum(jobNum)); } @@ -726,9 +726,9 @@ void KTTSD::changeTextTalker(const QString &talker, uint jobNum) * @see talkers * @see getTalkers */ -QString KTTSD::userDefaultTalker() +TQString KTTSD::userDefaultTalker() { - if (!m_talkerMgr) return QString::null; + if (!m_talkerMgr) return TQString::null; return m_talkerMgr->userDefaultTalker(); } @@ -793,7 +793,7 @@ void KTTSD::speakClipboard() QClipboard *cb = kapp->clipboard(); // Copy text from the clipboard. - QString text = cb->text(); + TQString text = cb->text(); // Speak it. if ( !text.isNull() ) @@ -847,7 +847,7 @@ void KTTSD::reinit() /** * Return KTTSD daemon version number. */ -QString KTTSD::version() { return kapp->aboutData()->version(); } +TQString KTTSD::version() { return kapp->aboutData()->version(); } /* * Checks if KTTSD is ready to speak and at least one talker is configured. @@ -877,8 +877,8 @@ void KTTSD::configCommitted() { * default_presentation contains these ORed events: None=0, Sound=1, Messagebox=2, Logfile=4, Stderr=8, * PassivePopup=16, Execute=32, Taskbar=64 */ -void KTTSD::notificationSignal( const QString& event, const QString& fromApp, - const QString &text, const QString& sound, const QString& /*file*/, +void KTTSD::notificationSignal( const TQString& event, const TQString& fromApp, + const TQString &text, const TQString& sound, const TQString& /*file*/, const int present, const int /*level*/, const int /*windId*/, const int /*eventId*/) { if (!m_speaker) return; @@ -890,8 +890,8 @@ void KTTSD::notificationSignal( const QString& event, const QString& fromApp, { bool found = false; NotifyOptions notifyOptions; - QString msg; - QString talker; + TQString msg; + TQString talker; // Check for app-specific action. if ( m_speechData->notifyAppMap.contains( fromApp ) ) { @@ -906,7 +906,7 @@ void KTTSD::notificationSignal( const QString& event, const QString& fromApp, { found = true; notifyOptions = notifyEventMap[ "default" ]; - notifyOptions.eventName = QString::null; + notifyOptions.eventName = TQString::null; } } } @@ -980,7 +980,7 @@ void KTTSD::notificationSignal( const QString& event, const QString& fromApp, // Queue msg if we should speak something. if ( !msg.isEmpty() ) { - QString fromApps = fromApp + ",knotify"; + TQString fromApps = fromApp + ",knotify"; m_speechData->enqueueMessage( msg, talker, fromApps.utf8() ); m_speaker->doUtterances(); } @@ -988,65 +988,65 @@ void KTTSD::notificationSignal( const QString& event, const QString& fromApp, } // Slots for the speaker object -void KTTSD::slotSentenceStarted(QString, QString, const QCString& appId, +void KTTSD::slotSentenceStarted(TQString, TQString, const TQCString& appId, const uint jobNum, const uint seq) { // Emit DCOP signal. kdDebug() << "KTTSD::slotSentenceStarted: Emitting DCOP signal sentenceStarted with appId " << appId << " job number " << jobNum << " seq number " << seq << endl; sentenceStarted(appId, jobNum, seq); } -void KTTSD::slotSentenceFinished(const QCString& appId, const uint jobNum, const uint seq){ +void KTTSD::slotSentenceFinished(const TQCString& appId, const uint jobNum, const uint seq){ // Emit DCOP signal. kdDebug() << "KTTSD::slotSentenceFinished: Emitting DCOP signal sentenceFinished with appId " << appId << " job number " << jobNum << " seq number " << seq << endl; sentenceFinished(appId, jobNum, seq); } // Slots for the speechData and speaker objects. -void KTTSD::slotTextStarted(const QCString& appId, const uint jobNum){ +void KTTSD::slotTextStarted(const TQCString& appId, const uint jobNum){ // Emit DCOP signal. kdDebug() << "KTTSD::slotTextStarted: Emitting DCOP signal textStarted with appId " << appId << " job number " << jobNum << endl; textStarted(appId, jobNum); } -void KTTSD::slotTextFinished(const QCString& appId, const uint jobNum){ +void KTTSD::slotTextFinished(const TQCString& appId, const uint jobNum){ // Emit DCOP signal. kdDebug() << "KTTSD::slotTextFinished: Emitting DCOP signal textFinished with appId " << appId << " job number " << jobNum << endl; textFinished(appId, jobNum); } -void KTTSD::slotTextStopped(const QCString& appId, const uint jobNum){ +void KTTSD::slotTextStopped(const TQCString& appId, const uint jobNum){ // Emit DCOP signal. kdDebug() << "KTTSD::slotTextStopped: Emitting DCOP signal textStopped with appId " << appId << " job number " << jobNum << endl; textStopped(appId, jobNum); } -void KTTSD::slotTextPaused(const QCString& appId, const uint jobNum){ +void KTTSD::slotTextPaused(const TQCString& appId, const uint jobNum){ // Emit DCOP signal. kdDebug() << "KTTSD::slotTextPaused: Emitting DCOP signal textPaused with appId " << appId << " job number " << jobNum << endl; textPaused(appId, jobNum); } -void KTTSD::slotTextResumed(const QCString& appId, const uint jobNum){ +void KTTSD::slotTextResumed(const TQCString& appId, const uint jobNum){ // Emit DCOP signal. kdDebug() << "KTTSD::slotTextResumed: Emitting DCOP signal textResumed with appId " << appId << " job number " << jobNum << endl; textResumed(appId, jobNum); } -//void KTTSD::slotTextSet(const QCString& appId, const uint jobNum){ -void KTTSD::slotTextSet(const QCString& appId, const uint jobNum){ +//void KTTSD::slotTextSet(const TQCString& appId, const uint jobNum){ +void KTTSD::slotTextSet(const TQCString& appId, const uint jobNum){ // Emit DCOP signal. kdDebug() << "KTTSD::slotTextSet: Emitting DCOP signal textSet with appId " << appId << " job number " << jobNum << endl; textSet(appId, jobNum); } -void KTTSD::slotTextAppended(const QCString& appId, const uint jobNum, const int partNum){ +void KTTSD::slotTextAppended(const TQCString& appId, const uint jobNum, const int partNum){ // Emit DCOP signal. kdDebug() << "KTTSD::slotTextAppended: Emitting DCOP signal textAppended with appId " << appId << " job number " << jobNum << " part number " << partNum << endl; textAppended(appId, jobNum, partNum); } -void KTTSD::slotTextRemoved(const QCString& appId, const uint jobNum){ +void KTTSD::slotTextRemoved(const TQCString& appId, const uint jobNum){ // Emit DCOP signal. kdDebug() << "KTTSD::slotTextRemoved: Emitting DCOP signal textRemoved with appId " << appId << " job number " << jobNum << endl; textRemoved(appId, jobNum); @@ -1056,10 +1056,10 @@ void KTTSD::slotTextRemoved(const QCString& appId, const uint jobNum){ * Returns the senderId (appId) of the DCOP application that called us. * @return The DCOP sendId of calling application. */ -const QCString KTTSD::getAppId() +const TQCString KTTSD::getAppId() { DCOPClient* client = callingDcopClient(); - QCString appId; + TQCString appId; if (client) appId = client->senderId(); return appId; } @@ -1084,21 +1084,21 @@ uint KTTSD::applyDefaultJobNum(const uint jobNum) /* * Fixes a string argument passed in via dcop. -* If NULL or "0" return QString::null. +* If NULL or "0" return TQString::null. */ -QString KTTSD::fixNullString(const QString &talker) const +TQString KTTSD::fixNullString(const TQString &talker) const { - if (!talker) return QString::null; - if (talker == "0") return QString::null; + if (!talker) return TQString::null; + if (talker == "0") return TQString::null; return talker; } // kspeech is obsolete. Applications should use KSpeech instead. // Constructor. -kspeech::kspeech(const QCString& objId, QObject *parent, const char *name) : +kspeech::kspeech(const TQCString& objId, TQObject *parent, const char *name) : DCOPObject(objId), - QObject(parent, name), + TQObject(parent, name), m_kttsd("KSpeech") { } @@ -1107,26 +1107,26 @@ kspeech::kspeech(const QCString& objId, QObject *parent, const char *name) : kspeech::~kspeech() { } // Delegate all DCOP methods to KTTSD object. -/*virtual*/ bool kspeech::supportsMarkup(const QString &talker, uint markupType) const +/*virtual*/ bool kspeech::supportsMarkup(const TQString &talker, uint markupType) const { return m_kttsd.supportsMarkup(talker, markupType); } -/*virtual*/ bool kspeech::supportsMarkers(const QString &talker) const +/*virtual*/ bool kspeech::supportsMarkers(const TQString &talker) const { return m_kttsd.supportsMarkers(talker); } -/*virtual*/ ASYNC kspeech::sayScreenReaderOutput(const QString &msg, const QString &talker) +/*virtual*/ ASYNC kspeech::sayScreenReaderOutput(const TQString &msg, const TQString &talker) { m_kttsd.sayScreenReaderOutput(msg, talker); } -/*virtual*/ ASYNC kspeech::sayWarning(const QString &warning, const QString &talker) +/*virtual*/ ASYNC kspeech::sayWarning(const TQString &warning, const TQString &talker) { m_kttsd.sayWarning(warning, talker); } -/*virtual*/ ASYNC kspeech::sayMessage(const QString &message, const QString &talker) +/*virtual*/ ASYNC kspeech::sayMessage(const TQString &message, const TQString &talker) { m_kttsd.sayMessage(message, talker); } -/*virtual*/ ASYNC kspeech::setSentenceDelimiter(const QString &delimiter) +/*virtual*/ ASYNC kspeech::setSentenceDelimiter(const TQString &delimiter) { m_kttsd.setSentenceDelimiter(delimiter); } -/*virtual*/ uint kspeech::setText(const QString &text, const QString &talker) +/*virtual*/ uint kspeech::setText(const TQString &text, const TQString &talker) { return m_kttsd.setText(text, talker); } -/*virtual*/ uint kspeech::sayText(const QString &text, const QString &talker) +/*virtual*/ uint kspeech::sayText(const TQString &text, const TQString &talker) { return m_kttsd.sayText(text, talker); } -/*virtual*/ int kspeech::appendText(const QString &text, uint jobNum) +/*virtual*/ int kspeech::appendText(const TQString &text, uint jobNum) { return m_kttsd.appendText(text, jobNum); } -/*virtual*/ uint kspeech::setFile(const QString &filename, const QString &talker, - const QString& encoding) +/*virtual*/ uint kspeech::setFile(const TQString &filename, const TQString &talker, + const TQString& encoding) { return m_kttsd.setFile(filename, talker, encoding); } /*virtual*/ int kspeech::getTextCount(uint jobNum) { return m_kttsd.getTextCount(jobNum); } @@ -1134,15 +1134,15 @@ kspeech::~kspeech() { } { return m_kttsd.getCurrentTextJob(); } /*virtual*/ uint kspeech::getTextJobCount() { return m_kttsd.getTextJobCount(); } -/*virtual*/ QString kspeech::getTextJobNumbers() +/*virtual*/ TQString kspeech::getTextJobNumbers() { return m_kttsd.getTextJobNumbers(); } /*virtual*/ int kspeech::getTextJobState(uint jobNum) { return m_kttsd.getTextJobState(jobNum); } -/*virtual*/ QByteArray kspeech::getTextJobInfo(uint jobNum) +/*virtual*/ TQByteArray kspeech::getTextJobInfo(uint jobNum) { return m_kttsd.getTextJobInfo(jobNum); } -/*virtual*/ QString kspeech::talkerCodeToTalkerId(const QString& talkerCode) +/*virtual*/ TQString kspeech::talkerCodeToTalkerId(const TQString& talkerCode) { return m_kttsd.talkerCodeToTalkerId(talkerCode); } -/*virtual*/ QString kspeech::getTextJobSentence(uint jobNum, uint seq) +/*virtual*/ TQString kspeech::getTextJobSentence(uint jobNum, uint seq) { return m_kttsd.getTextJobSentence(jobNum, seq); } /*virtual*/ bool kspeech::isSpeakingText() const { return m_kttsd.isSpeakingText(); } @@ -1156,11 +1156,11 @@ kspeech::~kspeech() { } { m_kttsd.pauseText(jobNum); } /*virtual*/ ASYNC kspeech::resumeText(uint jobNum) { m_kttsd.resumeText(jobNum); } -/*virtual*/ QStringList kspeech::getTalkers() +/*virtual*/ TQStringList kspeech::getTalkers() { return m_kttsd.getTalkers(); } -/*virtual*/ ASYNC kspeech::changeTextTalker(const QString &talker, uint jobNum ) +/*virtual*/ ASYNC kspeech::changeTextTalker(const TQString &talker, uint jobNum ) { m_kttsd.changeTextTalker(talker, jobNum); } -/*virtual*/ QString kspeech::userDefaultTalker() +/*virtual*/ TQString kspeech::userDefaultTalker() { return m_kttsd.userDefaultTalker(); } /*virtual*/ ASYNC kspeech::moveTextLater(uint jobNum) { m_kttsd.moveTextLater(jobNum); } @@ -1176,7 +1176,7 @@ kspeech::~kspeech() { } { m_kttsd.kttsdExit(); } /*virtual*/ void kspeech::reinit() { m_kttsd.reinit(); } -/*virtual*/ QString kspeech::version() +/*virtual*/ TQString kspeech::version() { return m_kttsd.version(); } #include "kttsd.moc" diff --git a/kttsd/kttsd/kttsd.h b/kttsd/kttsd/kttsd.h index bdbd756..075383b 100644 --- a/kttsd/kttsd/kttsd.h +++ b/kttsd/kttsd/kttsd.h @@ -36,7 +36,7 @@ * @author Gary Cramblitt <garycramblitt@comcast.net> */ -class KTTSD : public QObject, virtual public KSpeech +class KTTSD : public TQObject, virtual public KSpeech { Q_OBJECT K_DCOP @@ -48,7 +48,7 @@ class KTTSD : public QObject, virtual public KSpeech * Create objects, speechData and speaker. * Start thread */ - KTTSD(const QCString& objId, QObject *parent=0, const char *name=0); + KTTSD(const TQCString& objId, TQObject *parent=0, const char *name=0); /** * Destructor. @@ -68,7 +68,7 @@ class KTTSD : public QObject, virtual public KSpeech * talker supports the indicated speech markup language. * @see kttsdMarkupType */ - virtual bool supportsMarkup(const QString &talker=NULL, const uint markupType = 0) const; + virtual bool supportsMarkup(const TQString &talker=NULL, const uint markupType = 0) const; /** * Determine whether the currently-configured speech plugin supports markers in speech markup. @@ -77,7 +77,7 @@ class KTTSD : public QObject, virtual public KSpeech * @return True if the plugin currently configured for the indicated * talker supports markers. */ - virtual bool supportsMarkers(const QString &talker=NULL) const; + virtual bool supportsMarkers(const TQString &talker=NULL) const; /** * Say a message as soon as possible, interrupting any other speech in progress. @@ -92,7 +92,7 @@ class KTTSD : public QObject, virtual public KSpeech * If an existing Screen Reader output is in progress, it is stopped and discarded and * replaced with this new message. */ - virtual ASYNC sayScreenReaderOutput(const QString &msg, const QString &talker=NULL); + virtual ASYNC sayScreenReaderOutput(const TQString &msg, const TQString &talker=NULL); /** * Say a warning. The warning will be spoken when the current sentence @@ -105,7 +105,7 @@ class KTTSD : public QObject, virtual public KSpeech * If no plugin has been configured for the specified Talker code, * defaults to the closest matching talker. */ - virtual ASYNC sayWarning(const QString &warning, const QString &talker=NULL); + virtual ASYNC sayWarning(const TQString &warning, const TQString &talker=NULL); /** * Say a message. The message will be spoken when the current sentence stops speaking @@ -118,7 +118,7 @@ class KTTSD : public QObject, virtual public KSpeech * If no talker has been configured for the specified Talker code, * defaults to the closest matching talker. */ - virtual ASYNC sayMessage(const QString &message, const QString &talker=NULL); + virtual ASYNC sayMessage(const TQString &message, const TQString &talker=NULL); /** * Sets the GREP pattern that will be used as the sentence delimiter. @@ -134,7 +134,7 @@ class KTTSD : public QObject, virtual public KSpeech * Changing the sentence delimiter does not affect other applications. * @see sentenceparsing */ - virtual ASYNC setSentenceDelimiter(const QString &delimiter); + virtual ASYNC setSentenceDelimiter(const TQString &delimiter); /** * Queue a text job. Does not start speaking the text. @@ -158,7 +158,7 @@ class KTTSD : public QObject, virtual public KSpeech * @see getTextCount * @see startText */ - virtual uint setText(const QString &text, const QString &talker=NULL); + virtual uint setText(const TQString &text, const TQString &talker=NULL); /** * Say a plain text job. This is a convenience method that @@ -188,7 +188,7 @@ class KTTSD : public QObject, virtual public KSpeech * * @since KDE 3.5 */ - virtual uint sayText(const QString &text, const QString &talker); + virtual uint sayText(const TQString &text, const TQString &talker); /** * Adds another part to a text job. Does not start speaking the text. @@ -205,7 +205,7 @@ class KTTSD : public QObject, virtual public KSpeech * @see setText. * @see startText. */ - int appendText(const QString &text, const uint jobNum=0); + int appendText(const TQString &text, const uint jobNum=0); /** * Queue a text job from the contents of a file. Does not start speaking the text. @@ -231,8 +231,8 @@ class KTTSD : public QObject, virtual public KSpeech * @see getTextCount * @see startText */ - virtual uint setFile(const QString &filename, const QString &talker=NULL, - const QString& encoding=NULL); + virtual uint setFile(const TQString &filename, const TQString &talker=NULL, + const TQString& encoding=NULL); /** * Get the number of sentences in a text job. @@ -267,7 +267,7 @@ class KTTSD : public QObject, virtual public KSpeech * Get a comma-separated list of text job numbers in the queue. * @return Comma-separated list of text job numbers in the queue. */ - virtual QString getTextJobNumbers(); + virtual TQString getTextJobNumbers(); /** * Get the state of a text job. @@ -285,13 +285,13 @@ class KTTSD : public QObject, virtual public KSpeech * @param jobNum Job number of the text job. * If zero, applies to the last job queued by the application, * but if no such job, applies to the current job (if any). - * @return A QDataStream containing information about the job. + * @return A TQDataStream containing information about the job. * Blank if no such job. * * The stream contains the following elements: * - int state Job state. - * - QCString appId DCOP senderId of the application that requested the speech job. - * - QString talker Language code in which to speak the text. + * - TQCString appId DCOP senderId of the application that requested the speech job. + * - TQString talker Language code in which to speak the text. * - int seq Current sentence being spoken. Sentences are numbered starting at 1. * - int sentenceCount Total number of sentences in the job. * - int partNum Current part of the job begin spoken. Parts are numbered starting at 1. @@ -302,11 +302,11 @@ class KTTSD : public QObject, virtual public KSpeech * * The following sample code will decode the stream: @verbatim - QByteArray jobInfo = getTextJobInfo(jobNum); - QDataStream stream(jobInfo, IO_ReadOnly); + TQByteArray jobInfo = getTextJobInfo(jobNum); + TQDataStream stream(jobInfo, IO_ReadOnly); int state; - QCString appId; - QString talker; + TQCString appId; + TQString talker; int seq; int sentenceCount; int partNum; @@ -320,7 +320,7 @@ class KTTSD : public QObject, virtual public KSpeech stream >> partCount; @endverbatim */ - virtual QByteArray getTextJobInfo(const uint jobNum=0); + virtual TQByteArray getTextJobInfo(const uint jobNum=0); /** * Given a Talker Code, returns the Talker ID of the talker that would speak @@ -328,7 +328,7 @@ class KTTSD : public QObject, virtual public KSpeech * @param talkerCode Talker Code. * @return Talker ID of the talker that would speak the text job. */ - virtual QString talkerCodeToTalkerId(const QString& talkerCode); + virtual TQString talkerCodeToTalkerId(const TQString& talkerCode); /** * Return a sentence of a job. @@ -339,7 +339,7 @@ class KTTSD : public QObject, virtual public KSpeech * @return The specified sentence in the specified job. If not such * job or sentence, returns "". */ - virtual QString getTextJobSentence(const uint jobNum=0, const uint seq=1); + virtual TQString getTextJobSentence(const uint jobNum=0, const uint seq=1); /** * Determine if kttsd is currently speaking any text jobs. @@ -436,12 +436,12 @@ class KTTSD : public QObject, virtual public KSpeech /** * Get a list of the talkers configured in KTTS. - * @return A QStringList of fully-specified talker codes, one + * @return A TQStringList of fully-specified talker codes, one * for each talker user has configured. * * @see talkers */ - virtual QStringList getTalkers(); + virtual TQStringList getTalkers(); /** * Change the talker for a text job. @@ -453,7 +453,7 @@ class KTTSD : public QObject, virtual public KSpeech * If no plugin has been configured for the specified Talker code, * defaults to the closest matching talker. */ - virtual ASYNC changeTextTalker(const QString &talker, uint jobNum=0); + virtual ASYNC changeTextTalker(const TQString &talker, uint jobNum=0); /** * Get the user's default talker. @@ -462,7 +462,7 @@ class KTTSD : public QObject, virtual public KSpeech * @see talkers * @see getTalkers */ - virtual QString userDefaultTalker(); + virtual TQString userDefaultTalker(); /** * Move a text job down in the queue so that it is spoken later. @@ -531,7 +531,7 @@ class KTTSD : public QObject, virtual public KSpeech * Return the KTTSD deamon version number. * @since KDE 3.5 */ - virtual QString version(); + virtual TQString version(); protected: @@ -539,8 +539,8 @@ class KTTSD : public QObject, virtual public KSpeech /** * This signal is emitted by KNotify when a notification event occurs. */ - void notificationSignal(const QString &event, const QString &fromApp, - const QString &text, const QString &sound, const QString &file, + void notificationSignal(const TQString &event, const TQString &fromApp, + const TQString &text, const TQString &sound, const TQString &file, const int present, const int level, const int winId, const int eventId ); private slots: @@ -548,22 +548,22 @@ class KTTSD : public QObject, virtual public KSpeech * These functions are called whenever * the status of the speaker object has changed */ - void slotSentenceStarted(QString text, QString language, - const QCString& appId, const uint jobNum, const uint seq); - void slotSentenceFinished(const QCString& appId, const uint jobNum, const uint seq); + void slotSentenceStarted(TQString text, TQString language, + const TQCString& appId, const uint jobNum, const uint seq); + void slotSentenceFinished(const TQCString& appId, const uint jobNum, const uint seq); /* * These functions are called whenever * the status of the speechData object has changed */ - void slotTextSet(const QCString& appId, const uint jobNum); - void slotTextAppended(const QCString& appId, const uint jobNum, const int partNum); - void slotTextStarted(const QCString& appId, const uint jobNum); - void slotTextFinished(const QCString& appId, const uint jobNum); - void slotTextStopped(const QCString& appId, const uint jobNum); - void slotTextPaused(const QCString& appId, const uint jobNum); - void slotTextResumed(const QCString& appId, const uint jobNum); - void slotTextRemoved(const QCString& appId, const uint jobNum); + void slotTextSet(const TQCString& appId, const uint jobNum); + void slotTextAppended(const TQCString& appId, const uint jobNum, const int partNum); + void slotTextStarted(const TQCString& appId, const uint jobNum); + void slotTextFinished(const TQCString& appId, const uint jobNum); + void slotTextStopped(const TQCString& appId, const uint jobNum); + void slotTextPaused(const TQCString& appId, const uint jobNum); + void slotTextResumed(const TQCString& appId, const uint jobNum); + void slotTextRemoved(const TQCString& appId, const uint jobNum); /* * Fires whenever user clicks Apply or OK buttons in Settings dialog. @@ -596,7 +596,7 @@ class KTTSD : public QObject, virtual public KSpeech * Returns the senderId (appId) of the DCOP application that called us. * @return appId The DCOP sendId of calling application. NULL if called internally by kttsd itself. */ - const QCString getAppId(); + const TQCString getAppId(); /* * If a job number is 0, returns the default job number for a command. @@ -608,9 +608,9 @@ class KTTSD : public QObject, virtual public KSpeech /* * Fixes a talker argument passed in via dcop. - * If NULL or "0" return QString::null. + * If NULL or "0" return TQString::null. */ - QString fixNullString(const QString &talker) const; + TQString fixNullString(const TQString &talker) const; /* * SpeechData containing all the data and the manipulating methods for all KTTSD @@ -629,47 +629,47 @@ class KTTSD : public QObject, virtual public KSpeech }; // kspeech is obsolete. Applications should use KSpeech instead. -class kspeech : public QObject, virtual public KSpeech +class kspeech : public TQObject, virtual public KSpeech { Q_OBJECT K_DCOP public: // Constructor. - kspeech(const QCString& objId, QObject *parent=0, const char *name=0); + kspeech(const TQCString& objId, TQObject *parent=0, const char *name=0); // Destructor. ~kspeech(); // Delegate all DCOP methods to KTTSD object. - virtual bool supportsMarkup(const QString &talker, uint markupType = 0) const; - virtual bool supportsMarkers(const QString &talker) const; - virtual ASYNC sayScreenReaderOutput(const QString &msg, const QString &talker); - virtual ASYNC sayWarning(const QString &warning, const QString &talker); - virtual ASYNC sayMessage(const QString &message, const QString &talker); - virtual ASYNC setSentenceDelimiter(const QString &delimiter); - virtual uint setText(const QString &text, const QString &talker); - virtual uint sayText(const QString &text, const QString &talker); - virtual int appendText(const QString &text, uint jobNum=0); - virtual uint setFile(const QString &filename, const QString &talker, - const QString& encoding); + virtual bool supportsMarkup(const TQString &talker, uint markupType = 0) const; + virtual bool supportsMarkers(const TQString &talker) const; + virtual ASYNC sayScreenReaderOutput(const TQString &msg, const TQString &talker); + virtual ASYNC sayWarning(const TQString &warning, const TQString &talker); + virtual ASYNC sayMessage(const TQString &message, const TQString &talker); + virtual ASYNC setSentenceDelimiter(const TQString &delimiter); + virtual uint setText(const TQString &text, const TQString &talker); + virtual uint sayText(const TQString &text, const TQString &talker); + virtual int appendText(const TQString &text, uint jobNum=0); + virtual uint setFile(const TQString &filename, const TQString &talker, + const TQString& encoding); virtual int getTextCount(uint jobNum=0); virtual uint getCurrentTextJob(); virtual uint getTextJobCount(); - virtual QString getTextJobNumbers(); + virtual TQString getTextJobNumbers(); virtual int getTextJobState(uint jobNum=0); - virtual QByteArray getTextJobInfo(uint jobNum=0); - virtual QString talkerCodeToTalkerId(const QString& talkerCode); - virtual QString getTextJobSentence(uint jobNum=0, uint seq=0); + virtual TQByteArray getTextJobInfo(uint jobNum=0); + virtual TQString talkerCodeToTalkerId(const TQString& talkerCode); + virtual TQString getTextJobSentence(uint jobNum=0, uint seq=0); virtual bool isSpeakingText() const; virtual ASYNC removeText(uint jobNum=0); virtual ASYNC startText(uint jobNum=0); virtual ASYNC stopText(uint jobNum=0); virtual ASYNC pauseText(uint jobNum=0); virtual ASYNC resumeText(uint jobNum=0); - virtual QStringList getTalkers(); - virtual ASYNC changeTextTalker(const QString &talker, uint jobNum=0 ); - virtual QString userDefaultTalker(); + virtual TQStringList getTalkers(); + virtual ASYNC changeTextTalker(const TQString &talker, uint jobNum=0 ); + virtual TQString userDefaultTalker(); virtual ASYNC moveTextLater(uint jobNum=0); virtual int jumpToTextPart(int partNum, uint jobNum=0); virtual uint moveRelTextSentence(int n, uint jobNum=0); @@ -677,7 +677,7 @@ class kspeech : public QObject, virtual public KSpeech virtual void showDialog(); virtual void kttsdExit(); virtual void reinit(); - virtual QString version(); + virtual TQString version(); private: KTTSD m_kttsd; diff --git a/kttsd/kttsd/speaker.cpp b/kttsd/kttsd/speaker.cpp index b965a9e..42fa39e 100644 --- a/kttsd/kttsd/speaker.cpp +++ b/kttsd/kttsd/speaker.cpp @@ -20,9 +20,9 @@ ******************************************************************************/ // Qt includes. -#include <qfile.h> -#include <qtimer.h> -#include <qdir.h> +#include <tqfile.h> +#include <tqtimer.h> +#include <tqdir.h> // KDE includes. #include <kdebug.h> @@ -107,8 +107,8 @@ * Loads plugins. */ Speaker::Speaker( SpeechData*speechData, TalkerMgr* talkerMgr, - QObject *parent, const char *name) : - QObject(parent, name), + TQObject *parent, const char *name) : + TQObject(parent, name), m_speechData(speechData), m_talkerMgr(talkerMgr) { @@ -119,7 +119,7 @@ Speaker::Speaker( SpeechData*speechData, TalkerMgr* talkerMgr, m_lastAppId = 0; m_lastJobNum = 0; m_lastSeq = 0; - m_timer = new QTimer(this, "kttsdAudioTimer"); + m_timer = new TQTimer(this, "kttsdAudioTimer"); m_speechData->config->setGroup("General"); m_playerOption = m_speechData->config->readNumEntry("AudioOutputMethod", 0); // default to aRts. // Map 50% to 100% onto 2.0 to 0.5. @@ -152,22 +152,22 @@ Speaker::Speaker( SpeechData*speechData, TalkerMgr* talkerMgr, break; } // Connect timer timeout signal. - connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimeout())); + connect(m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotTimeout())); // Connect plugins to slots. - QPtrList<PlugInProc> plugins = m_talkerMgr->getLoadedPlugIns(); + TQPtrList<PlugInProc> plugins = m_talkerMgr->getLoadedPlugIns(); const int pluginsCount = plugins.count(); for (int ndx = 0; ndx < pluginsCount; ++ndx) { PlugInProc* speech = plugins.at(ndx); - connect(speech, SIGNAL(synthFinished()), - this, SLOT(slotSynthFinished())); - connect(speech, SIGNAL(sayFinished()), - this, SLOT(slotSayFinished())); - connect(speech, SIGNAL(stopped()), - this, SLOT(slotStopped())); - connect(speech, SIGNAL(error(bool, const QString&)), - this, SLOT(slotError(bool, const QString&))); + connect(speech, TQT_SIGNAL(synthFinished()), + this, TQT_SLOT(slotSynthFinished())); + connect(speech, TQT_SIGNAL(sayFinished()), + this, TQT_SLOT(slotSayFinished())); + connect(speech, TQT_SIGNAL(stopped()), + this, TQT_SLOT(slotStopped())); + connect(speech, TQT_SIGNAL(error(bool, const TQString&)), + this, TQT_SLOT(slotError(bool, const TQString&))); } } @@ -228,9 +228,9 @@ void Speaker::doUtterances() // kdDebug() << "Speaker::doUtterances: queue dump:" << endl; // for (it = m_uttQueue.begin(); it != m_uttQueue.end(); ++it) // { -// QString pluginState = "no plugin"; +// TQString pluginState = "no plugin"; // if (it->plugin) pluginState = pluginStateToStr(it->plugin->getState()); -// QString jobState = +// TQString jobState = // jobStateToStr(m_speechData->getTextJobState(it->sentence->jobNum)); // kdDebug() << // " State: " << uttStateToStr(it->state) << @@ -275,8 +275,8 @@ void Speaker::doUtterances() { // Create an XSLT transformer and transform the text. it->transformer = new SSMLConvert(); - connect(it->transformer, SIGNAL(transformFinished()), - this, SLOT(slotTransformFinished())); + connect(it->transformer, TQT_SIGNAL(transformFinished()), + this, TQT_SLOT(slotTransformFinished())); if (it->transformer->transform(it->sentence->text, it->plugin->getSsmlXsltFilename())) { @@ -345,8 +345,8 @@ void Speaker::doUtterances() else { it->audioStretcher = new Stretcher(); - connect(it->audioStretcher, SIGNAL(stretchFinished()), - this, SLOT(slotStretchFinished())); + connect(it->audioStretcher, TQT_SIGNAL(stretchFinished()), + this, TQT_SLOT(slotStretchFinished())); if (it->audioStretcher->stretch(it->audioUrl, makeSuggestedFilename(), m_audioStretchFactor)) { @@ -370,7 +370,7 @@ void Speaker::doUtterances() // See if Stretcher is finished. if (it->audioStretcher->getState() == Stretcher::ssFinished) { - QFile::remove(it->audioUrl); + TQFile::remove(it->audioUrl); it->audioUrl = it->audioStretcher->getOutFilename(); it->state = usStretched; delete it->audioStretcher; @@ -786,7 +786,7 @@ uint Speaker::moveRelTextSentence(const int n, const uint jobNum) * Converts an utterance state enumerator to a displayable string. * @param state Utterance state. */ -QString Speaker::uttStateToStr(uttState state) +TQString Speaker::uttStateToStr(uttState state) { switch (state) { @@ -806,7 +806,7 @@ QString Speaker::uttStateToStr(uttState state) case usPreempted: return "usPreempted"; case usFinished: return "usFinished"; } - return QString::null; + return TQString::null; } /** @@ -814,7 +814,7 @@ QString Speaker::uttStateToStr(uttState state) * @param utType Utterance type. * @return Displayable string for utterance type. */ -QString Speaker::uttTypeToStr(uttType utType) +TQString Speaker::uttTypeToStr(uttType utType) { switch (utType) { @@ -829,7 +829,7 @@ QString Speaker::uttTypeToStr(uttType utType) case utStartOfJob: return "utStartOfJob"; case utEndOfJob: return "utEndOfJob"; } - return QString::null; + return TQString::null; } /** @@ -837,7 +837,7 @@ QString Speaker::uttTypeToStr(uttType utType) * @param state Plugin state. * @return Displayable string for plugin state. */ -QString Speaker::pluginStateToStr(pluginState state) +TQString Speaker::pluginStateToStr(pluginState state) { switch( state ) { @@ -846,7 +846,7 @@ QString Speaker::pluginStateToStr(pluginState state) case psSynthing: return "psSynthing"; case psFinished: return "psFinished"; } - return QString::null; + return TQString::null; } /** @@ -854,7 +854,7 @@ QString Speaker::pluginStateToStr(pluginState state) * @param state Job state. * @return Displayable string for job state. */ -QString Speaker::jobStateToStr(int state) +TQString Speaker::jobStateToStr(int state) { switch ( state ) { @@ -864,7 +864,7 @@ QString Speaker::jobStateToStr(int state) case KSpeech::jsPaused: return "jsPaused"; case KSpeech::jsFinished: return "jsFinished"; } - return QString::null; + return TQString::null; } /** @@ -920,7 +920,7 @@ void Speaker::pauseUtteranceByJobNum(const uint jobNum) /** * Determines whether the given text is SSML markup. */ -bool Speaker::isSsml(const QString &text) +bool Speaker::isSsml(const TQString &text) { return KttsUtils::hasRootElement( text, "speak" ); } @@ -1019,7 +1019,7 @@ bool Speaker::getNextUtterance() utt->state = usNone; utt->audioPlayer = 0; utt->audioStretcher = 0; - utt->audioUrl = QString::null; + utt->audioUrl = TQString::null; utt->plugin = m_talkerMgr->talkerToPlugin(utt->sentence->talker); // Save some time by setting initial state now. setInitialUtteranceState(*utt); @@ -1079,7 +1079,7 @@ bool Speaker::getNextUtterance() { Utt intrUtt; intrUtt.sentence = new mlText; - intrUtt.sentence->text = QString::null; + intrUtt.sentence->text = TQString::null; intrUtt.sentence->talker = utt->sentence->talker; intrUtt.sentence->appId = utt->sentence->appId; intrUtt.sentence->jobNum = utt->sentence->jobNum; @@ -1099,11 +1099,11 @@ bool Speaker::getNextUtterance() intrUtt.sentence = new mlText; intrUtt.sentence->text = m_speechData->textPreMsg; // Interruptions are spoken using default Talker. - intrUtt.sentence->talker = QString::null; + intrUtt.sentence->talker = TQString::null; intrUtt.sentence->appId = utt->sentence->appId; intrUtt.sentence->jobNum = utt->sentence->jobNum; intrUtt.sentence->seq = 0; - intrUtt.audioUrl = QString::null; + intrUtt.audioUrl = TQString::null; intrUtt.audioPlayer = 0; intrUtt.utType = utInterruptMsg; intrUtt.isSSML = isSsml(intrUtt.sentence->text); @@ -1125,7 +1125,7 @@ bool Speaker::getNextUtterance() { Utt resUtt; resUtt.sentence = new mlText; - resUtt.sentence->text = QString::null; + resUtt.sentence->text = TQString::null; resUtt.sentence->talker = utt->sentence->talker; resUtt.sentence->appId = utt->sentence->appId; resUtt.sentence->jobNum = utt->sentence->jobNum; @@ -1144,11 +1144,11 @@ bool Speaker::getNextUtterance() Utt resUtt; resUtt.sentence = new mlText; resUtt.sentence->text = m_speechData->textPostMsg; - resUtt.sentence->talker = QString::null; + resUtt.sentence->talker = TQString::null; resUtt.sentence->appId = utt->sentence->appId; resUtt.sentence->jobNum = utt->sentence->jobNum; resUtt.sentence->seq = 0; - resUtt.audioUrl = QString::null; + resUtt.audioUrl = TQString::null; resUtt.audioPlayer = 0; resUtt.utType = utResumeMsg; resUtt.isSSML = isSsml(resUtt.sentence->text); @@ -1173,12 +1173,12 @@ bool Speaker::getNextUtterance() { Utt jobUtt; jobUtt.sentence = new mlText; - jobUtt.sentence->text = QString::null; - jobUtt.sentence->talker = QString::null; + jobUtt.sentence->text = TQString::null; + jobUtt.sentence->talker = TQString::null; jobUtt.sentence->appId = m_lastAppId; jobUtt.sentence->jobNum = m_lastJobNum; jobUtt.sentence->seq = 0; - jobUtt.audioUrl = QString::null; + jobUtt.audioUrl = TQString::null; jobUtt.utType = utEndOfJob; jobUtt.isSSML = false; jobUtt.plugin = 0; @@ -1194,12 +1194,12 @@ bool Speaker::getNextUtterance() { Utt jobUtt; jobUtt.sentence = new mlText; - jobUtt.sentence->text = QString::null; - jobUtt.sentence->talker = QString::null; + jobUtt.sentence->text = TQString::null; + jobUtt.sentence->talker = TQString::null; jobUtt.sentence->appId = m_lastAppId; jobUtt.sentence->jobNum = m_lastJobNum; jobUtt.sentence->seq = utt->sentence->seq; - jobUtt.audioUrl = QString::null; + jobUtt.audioUrl = TQString::null; jobUtt.utType = utStartOfJob; jobUtt.isSSML = false; jobUtt.plugin = 0; @@ -1220,12 +1220,12 @@ bool Speaker::getNextUtterance() { Utt jobUtt; jobUtt.sentence = new mlText; - jobUtt.sentence->text = QString::null; - jobUtt.sentence->talker = QString::null; + jobUtt.sentence->text = TQString::null; + jobUtt.sentence->talker = TQString::null; jobUtt.sentence->appId = m_lastAppId; jobUtt.sentence->jobNum = m_lastJobNum; jobUtt.sentence->seq = 0; - jobUtt.audioUrl = QString::null; + jobUtt.audioUrl = TQString::null; jobUtt.utType = utEndOfJob; jobUtt.isSSML = false; jobUtt.plugin = 0; @@ -1311,14 +1311,14 @@ uttIterator Speaker::deleteUtterance(uttIterator it) { if (m_speechData->keepAudio) { - QCString seqStr; + TQCString seqStr; seqStr.sprintf("%08i", it->sentence->seq); // Zero-fill to 8 chars. - QCString jobStr; + TQCString jobStr; jobStr.sprintf("%08i", it->sentence->jobNum); - QString dest = m_speechData->keepAudioPath + "/kttsd-" + - QString("%1-%2").arg(jobStr).arg(seqStr) + ".wav"; - QFile::remove(dest); - QDir d; + TQString dest = m_speechData->keepAudioPath + "/kttsd-" + + TQString("%1-%2").arg(jobStr).arg(seqStr) + ".wav"; + TQFile::remove(dest); + TQDir d; d.rename(it->audioUrl, dest); // TODO: This is always producing the following. Why and how to fix? // It moves the files just fine. @@ -1328,7 +1328,7 @@ uttIterator Speaker::deleteUtterance(uttIterator it) // KIO::move(it->audioUrl, dest, false); } else - QFile::remove(it->audioUrl); + TQFile::remove(it->audioUrl); } } // Delete the utterance from queue. @@ -1418,7 +1418,7 @@ bool Speaker::startPlayingUtterance(uttIterator it) (m_speechData->getTextJobState(it->sentence->jobNum) != KSpeech::jsPaused)) { // kdDebug() << "Speaker::startPlayingUtterance: resuming play" << endl; - it->audioPlayer->startPlay(QString::null); // resume + it->audioPlayer->startPlay(TQString::null); // resume it->state = usPlaying; if (!m_timer->start(timerInterval, FALSE)) kdDebug() << "Speaker::startPlayingUtterance: timer.start failed" << endl; @@ -1431,7 +1431,7 @@ bool Speaker::startPlayingUtterance(uttIterator it) { // Preempted playback automatically resumes. // Note: Must call stop(), even if player not currently playing. Why? - it->audioPlayer->startPlay(QString::null); // resume + it->audioPlayer->startPlay(TQString::null); // resume it->state = usPlaying; if (!m_timer->start(timerInterval, FALSE)) kdDebug() << "Speaker::startPlayingUtterance: timer.start failed" << endl; @@ -1500,12 +1500,12 @@ void Speaker::postPlaySignals(uttIterator it) * for synthesis to write to. * @return Full pathname of suggested file. */ -QString Speaker::makeSuggestedFilename() +TQString Speaker::makeSuggestedFilename() { KTempFile tempFile (locateLocal("tmp", "kttsd-"), ".wav"); - QString waveFile = tempFile.file()->name(); + TQString waveFile = tempFile.file()->name(); tempFile.close(); - QFile::remove(waveFile); + TQFile::remove(waveFile); // kdDebug() << "Speaker::makeSuggestedFilename: Suggesting filename: " << waveFile << endl; return KStandardDirs::realFilePath(waveFile); } @@ -1516,7 +1516,7 @@ QString Speaker::makeSuggestedFilename() Player* Speaker::createPlayerObject() { Player* player = 0; - QString plugInName; + TQString plugInName; switch(m_playerOption) { case 1 : @@ -1541,7 +1541,7 @@ Player* Speaker::createPlayerObject() } } KTrader::OfferList offers = KTrader::self()->query( - "KTTSD/AudioPlugin", QString("DesktopEntryName == '%1'").arg(plugInName)); + "KTTSD/AudioPlugin", TQString("DesktopEntryName == '%1'").arg(plugInName)); if(offers.count() == 1) { @@ -1595,8 +1595,8 @@ void Speaker::slotSayFinished() { // Since this signal handler may be running from a plugin's thread, // convert to postEvent and return immediately. - QCustomEvent* ev = new QCustomEvent(QEvent::User + 101); - QApplication::postEvent(this, ev); + TQCustomEvent* ev = new TQCustomEvent(TQEvent::User + 101); + TQApplication::postEvent(this, ev); } /** @@ -1606,8 +1606,8 @@ void Speaker::slotSynthFinished() { // Since this signal handler may be running from a plugin's thread, // convert to postEvent and return immediately. - QCustomEvent* ev = new QCustomEvent(QEvent::User + 102); - QApplication::postEvent(this, ev); + TQCustomEvent* ev = new TQCustomEvent(TQEvent::User + 102); + TQApplication::postEvent(this, ev); } /** @@ -1617,8 +1617,8 @@ void Speaker::slotStopped() { // Since this signal handler may be running from a plugin's thread, // convert to postEvent and return immediately. - QCustomEvent* ev = new QCustomEvent(QEvent::User + 103); - QApplication::postEvent(this, ev); + TQCustomEvent* ev = new TQCustomEvent(TQEvent::User + 103); + TQApplication::postEvent(this, ev); } /** @@ -1627,8 +1627,8 @@ void Speaker::slotStopped() void Speaker::slotStretchFinished() { // Convert to postEvent and return immediately. - QCustomEvent* ev = new QCustomEvent(QEvent::User + 104); - QApplication::postEvent(this, ev); + TQCustomEvent* ev = new TQCustomEvent(TQEvent::User + 104); + TQApplication::postEvent(this, ev); } /** @@ -1637,8 +1637,8 @@ void Speaker::slotStretchFinished() void Speaker::slotTransformFinished() { // Convert to postEvent and return immediately. - QCustomEvent* ev = new QCustomEvent(QEvent::User + 105); - QApplication::postEvent(this, ev); + TQCustomEvent* ev = new TQCustomEvent(TQEvent::User + 105); + TQApplication::postEvent(this, ev); } /** Received from PlugIn object when they encounter an error. @@ -1647,17 +1647,17 @@ void Speaker::slotTransformFinished() * the speech engine could not be started. * @param msg Error message. */ -void Speaker::slotError(bool /*keepGoing*/, const QString& /*msg*/) +void Speaker::slotError(bool /*keepGoing*/, const TQString& /*msg*/) { // Since this signal handler may be running from a plugin's thread, // convert to postEvent and return immediately. // TODO: Do something with error messages. /* if (keepGoing) - QCustomEvent* ev = new QCustomEvent(QEvent::User + 106); + TQCustomEvent* ev = new TQCustomEvent(TQEvent::User + 106); else - QCustomEvent* ev = new QCustomEvent(QEvent::User + 107); - QApplication::postEvent(this, ev); + TQCustomEvent* ev = new TQCustomEvent(TQEvent::User + 107); + TQApplication::postEvent(this, ev); */ } @@ -1686,11 +1686,11 @@ void Speaker::slotTimeout() * Processes events posted by plugins. When asynchronous plugins emit signals * they are converted into these events. */ -bool Speaker::event ( QEvent * e ) +bool Speaker::event ( TQEvent * e ) { // TODO: Do something with event numbers 106 (error; keepGoing=True) // and 107 (error; keepGoing=False). - if ((e->type() >= (QEvent::User + 101)) && (e->type() <= (QEvent::User + 105))) + if ((e->type() >= (TQEvent::User + 101)) && (e->type() <= (TQEvent::User + 105))) { // kdDebug() << "Speaker::event: received event." << endl; doUtterances(); diff --git a/kttsd/kttsd/speaker.h b/kttsd/kttsd/speaker.h index b72e832..a3dc677 100644 --- a/kttsd/kttsd/speaker.h +++ b/kttsd/kttsd/speaker.h @@ -24,9 +24,9 @@ #define _SPEAKER_H_ // Qt includes. -#include <qobject.h> -#include <qvaluevector.h> -#include <qevent.h> +#include <tqobject.h> +#include <tqvaluevector.h> +#include <tqevent.h> // KTTSD includes. #include <speechdata.h> @@ -89,7 +89,7 @@ struct Utt{ SSMLConvert* transformer; /* XSLT transformer. */ PlugInProc* plugin; /* The plugin that synthesizes the utterance. */ Stretcher* audioStretcher; /* Audio stretcher object. Adjusts speed. */ - QString audioUrl; /* Filename containing synthesized audio. Null if + TQString audioUrl; /* Filename containing synthesized audio. Null if plugin has not yet synthesized the utterance, or if plugin does not support synthesis. */ Player* audioPlayer; /* The audio player audibilizing the utterance. Null @@ -100,7 +100,7 @@ struct Utt{ /** * Iterator for queue of utterances. */ -typedef QValueVector<Utt>::iterator uttIterator; +typedef TQValueVector<Utt>::iterator uttIterator; // Timer interval for checking whether audio playback is finished. const int timerInterval = 500; @@ -118,7 +118,7 @@ class Speaker : public QObject{ * Calls load plug ins */ Speaker(SpeechData* speechData, TalkerMgr* talkerMgr, - QObject *parent = 0, const char *name = 0); + TQObject *parent = 0, const char *name = 0); /** * Destructor @@ -296,7 +296,7 @@ class Speaker : public QObject{ * @param markerName The name of the marker seen. * @see markers */ - void markerSeen(const QCString& appId, const QString& markerName); + void markerSeen(const TQCString& appId, const TQString& markerName); /** * This signal is emitted whenever a sentence begins speaking. @@ -304,7 +304,7 @@ class Speaker : public QObject{ * @param jobNum Job number of the text job. * @param seq Sequence number of the text. */ - void sentenceStarted(QString text, QString language, const QCString& appId, + void sentenceStarted(TQString text, TQString language, const TQCString& appId, const uint jobNum, const uint seq); /** @@ -313,14 +313,14 @@ class Speaker : public QObject{ * @param jobNum Job number of the text job. * @param seq Sequence number of the text. */ - void sentenceFinished(const QCString& appId, const uint jobNum, const uint seq); + void sentenceFinished(const TQCString& appId, const uint jobNum, const uint seq); /** * This signal is emitted whenever speaking of a text job begins. * @param appId The DCOP senderId of the application that created the job. NULL if kttsd. * @param jobNum Job number of the text job. */ - void textStarted(const QCString& appId, const uint jobNum); + void textStarted(const TQCString& appId, const uint jobNum); /** * This signal is emitted whenever a text job is finished. The job has @@ -331,32 +331,32 @@ class Speaker : public QObject{ * @param appId The DCOP senderId of the application that created the job. * @param jobNum Job number of the text job. */ - void textFinished(const QCString& appId, const uint jobNum); + void textFinished(const TQCString& appId, const uint jobNum); /** * This signal is emitted whenever a speaking text job stops speaking. * @param appId The DCOP senderId of the application that created the job. * @param jobNum Job number of the text job. */ - void textStopped(const QCString& appId, const uint jobNum); + void textStopped(const TQCString& appId, const uint jobNum); /** * This signal is emitted whenever a speaking text job is paused. * @param appId The DCOP senderId of the application that created the job. * @param jobNum Job number of the text job. */ - void textPaused(const QCString& appId, const uint jobNum); + void textPaused(const TQCString& appId, const uint jobNum); /** * This signal is emitted when a text job, that was previously paused, resumes speaking. * @param appId The DCOP senderId of the application that created the job. * @param jobNum Job number of the text job. */ - void textResumed(const QCString& appId, const uint jobNum); + void textResumed(const TQCString& appId, const uint jobNum); protected: /** * Processes events posted by ThreadedPlugIns. */ - virtual bool event ( QEvent * e ); + virtual bool event ( TQEvent * e ); private slots: /** @@ -386,7 +386,7 @@ class Speaker : public QObject{ * the speech engine could not be started. * @param msg Error message. */ - void slotError(bool keepGoing, const QString &msg); + void slotError(bool keepGoing, const TQString &msg); /** * Received from Timer when it fires. * Check audio player to see if it is finished. @@ -400,33 +400,33 @@ class Speaker : public QObject{ * @param state Utterance state. * @return Displayable string for utterance state. */ - QString uttStateToStr(uttState state); + TQString uttStateToStr(uttState state); /** * Converts an utterance type enumerator to a displayable string. * @param utType Utterance type. * @return Displayable string for utterance type. */ - QString uttTypeToStr(uttType utType); + TQString uttTypeToStr(uttType utType); /** * Converts a plugin state enumerator to a displayable string. * @param state Plugin state. * @return Displayable string for plugin state. */ - QString pluginStateToStr(pluginState state); + TQString pluginStateToStr(pluginState state); /** * Converts a job state enumerator to a displayable string. * @param state Job state. * @return Displayable string for job state. */ - QString jobStateToStr(int state); + TQString jobStateToStr(int state); /** * Determines whether the given text is SSML markup. */ - bool isSsml(const QString &text); + bool isSsml(const TQString &text); /** * Determines the initial state of an utterance. If the utterance contains @@ -510,7 +510,7 @@ class Speaker : public QObject{ * for synthesis to write to. * @return Full pathname of suggested file. */ - QString makeSuggestedFilename(); + TQString makeSuggestedFilename(); /** * Creates and returns a player object based on user option. @@ -535,7 +535,7 @@ class Speaker : public QObject{ /** * Queue of utterances we are currently processing. */ - QValueVector<Utt> m_uttQueue; + TQValueVector<Utt> m_uttQueue; /** * True when text job reading has been interrupted. @@ -563,12 +563,12 @@ class Speaker : public QObject{ /** * GStreamer sink name to use, or ALSA PCM device name. */ - QString m_sinkName; + TQString m_sinkName; /** * Timer for monitoring audio player. */ - QTimer* m_timer; + TQTimer* m_timer; /** * Current Text job being processed. @@ -579,7 +579,7 @@ class Speaker : public QObject{ * Job Number, appId, and sequence number of the last text sentence queued. */ uint m_lastJobNum; - QCString m_lastAppId; + TQCString m_lastAppId; uint m_lastSeq; /** diff --git a/kttsd/kttsd/speechdata.cpp b/kttsd/kttsd/speechdata.cpp index a1bf26e..1c8f90f 100644 --- a/kttsd/kttsd/speechdata.cpp +++ b/kttsd/kttsd/speechdata.cpp @@ -26,11 +26,11 @@ #include <stdlib.h> // Qt includes. -#include <qregexp.h> -#include <qpair.h> -#include <qvaluelist.h> -#include <qdom.h> -#include <qfile.h> +#include <tqregexp.h> +#include <tqpair.h> +#include <tqvaluelist.h> +#include <tqdom.h> +#include <tqfile.h> // KDE includes. #include <kdebug.h> @@ -105,7 +105,7 @@ bool SpeechData::readConfig(){ autoExitManager = config->readBoolEntry("AutoExitManager", false); // Clear the pool of filter managers so that filters re-init themselves. - QPtrListIterator<PooledFilterMgr> it( m_pooledFilterMgrs ); + TQPtrListIterator<PooledFilterMgr> it( m_pooledFilterMgrs ); for( ; it.current(); ++it ) { PooledFilterMgr* pooledFilterMgr = it.current(); @@ -125,8 +125,8 @@ bool SpeechData::readConfig(){ pooledFilterMgr->job = 0; pooledFilterMgr->partNum = 0; // Connect signals from FilterMgr. - connect (filterMgr, SIGNAL(filteringFinished()), this, SLOT(slotFilterMgrFinished())); - connect (filterMgr, SIGNAL(filteringStopped()), this, SLOT(slotFilterMgrStopped())); + connect (filterMgr, TQT_SIGNAL(filteringFinished()), this, TQT_SLOT(slotFilterMgrFinished())); + connect (filterMgr, TQT_SIGNAL(filteringStopped()), this, TQT_SLOT(slotFilterMgrStopped())); m_pooledFilterMgrs.append(pooledFilterMgr); return true; @@ -135,16 +135,16 @@ bool SpeechData::readConfig(){ /** * Loads notify events from a file. Clearing data if clear is True. */ -void SpeechData::loadNotifyEventsFromFile( const QString& filename, bool clear) +void SpeechData::loadNotifyEventsFromFile( const TQString& filename, bool clear) { // Open existing event list. - QFile file( filename ); + TQFile file( filename ); if ( !file.open( IO_ReadOnly ) ) { kdDebug() << "SpeechData::loadNotifyEventsFromFile: Unable to open file " << filename << endl; } - // QDomDocument doc( "http://www.kde.org/share/apps/kttsd/stringreplacer/wordlist.dtd []" ); - QDomDocument doc( "" ); + // TQDomDocument doc( "http://www.kde.org/share/apps/kttsd/stringreplacer/wordlist.dtd []" ); + TQDomDocument doc( "" ); if ( !doc.setContent( &file ) ) { file.close(); kdDebug() << "SpeechData::loadNotifyEventsFromFile: File not in proper XML format. " << filename << endl; @@ -156,28 +156,28 @@ void SpeechData::loadNotifyEventsFromFile( const QString& filename, bool clear) { notifyDefaultPresent = NotifyPresent::Passive; notifyDefaultOptions.action = NotifyAction::SpeakMsg; - notifyDefaultOptions.talker = QString::null; - notifyDefaultOptions.customMsg = QString::null; + notifyDefaultOptions.talker = TQString::null; + notifyDefaultOptions.customMsg = TQString::null; notifyAppMap.clear(); } // Event list. - QDomNodeList eventList = doc.elementsByTagName("notifyEvent"); + TQDomNodeList eventList = doc.elementsByTagName("notifyEvent"); const int eventListCount = eventList.count(); for (int eventIndex = 0; eventIndex < eventListCount; ++eventIndex) { - QDomNode eventNode = eventList.item(eventIndex); - QDomNodeList propList = eventNode.childNodes(); - QString eventSrc; - QString event; - QString actionName; - QString message; + TQDomNode eventNode = eventList.item(eventIndex); + TQDomNodeList propList = eventNode.childNodes(); + TQString eventSrc; + TQString event; + TQString actionName; + TQString message; TalkerCode talkerCode; const int propListCount = propList.count(); for (int propIndex = 0; propIndex < propListCount; ++propIndex) { - QDomNode propNode = propList.item(propIndex); - QDomElement prop = propNode.toElement(); + TQDomNode propNode = propList.item(propIndex); + TQDomElement prop = propNode.toElement(); if (prop.tagName() == "eventSrc") eventSrc = prop.text(); if (prop.tagName() == "event") event = prop.text(); if (prop.tagName() == "action") actionName = prop.text(); @@ -195,7 +195,7 @@ void SpeechData::loadNotifyEventsFromFile( const QString& filename, bool clear) notifyEventMap[ event ] = notifyOptions; notifyAppMap[ eventSrc ] = notifyEventMap; } else { - notifyOptions.eventName = QString::null; + notifyOptions.eventName = TQString::null; notifyDefaultPresent = NotifyPresent::present( event ); notifyDefaultOptions = notifyOptions; } @@ -213,7 +213,7 @@ SpeechData::~SpeechData(){ emit textRemoved(job->appId, job->jobNum); } - QPtrListIterator<PooledFilterMgr> it( m_pooledFilterMgrs ); + TQPtrListIterator<PooledFilterMgr> it( m_pooledFilterMgrs ); for( ; it.current(); ++it ) { PooledFilterMgr* pooledFilterMgr = it.current(); @@ -239,7 +239,7 @@ SpeechData::~SpeechData(){ * If an existing Screen Reader output is in progress, it is stopped and discarded and * replaced with this new message. */ -void SpeechData::setScreenReaderOutput(const QString &msg, const QString &talker, const QCString &appId) +void SpeechData::setScreenReaderOutput(const TQString &msg, const TQString &talker, const TQCString &appId) { screenReaderOutput.text = msg; screenReaderOutput.talker = talker; @@ -273,8 +273,8 @@ bool SpeechData::screenReaderOutputReady() /** * Add a new warning to the queue. */ -void SpeechData::enqueueWarning( const QString &warning, const QString &talker, const QCString &appId){ - // kdDebug() << "Running: SpeechData::enqueueWarning( const QString &warning )" << endl; +void SpeechData::enqueueWarning( const TQString &warning, const TQString &talker, const TQCString &appId){ + // kdDebug() << "Running: SpeechData::enqueueWarning( const TQString &warning )" << endl; mlJob* job = new mlJob(); ++jobCounter; if (jobCounter == 0) ++jobCounter; // Overflow is OK, but don't want any 0 jobNums. @@ -285,7 +285,7 @@ void SpeechData::enqueueWarning( const QString &warning, const QString &talker, job->seq = 1; job->partCount = 1; warnings.enqueue( job ); - job->sentences = QStringList(); + job->sentences = TQStringList(); // Do not apply Sentence Boundary Detection filters to warnings. startJobFiltering( job, warning, true ); // uint count = warnings.count(); @@ -331,7 +331,7 @@ bool SpeechData::warningInQueue(){ /** * Add a new message to the queue. */ -void SpeechData::enqueueMessage( const QString &message, const QString &talker, const QCString& appId){ +void SpeechData::enqueueMessage( const TQString &message, const TQString &talker, const TQCString& appId){ // kdDebug() << "Running: SpeechData::enqueueMessage" << endl; mlJob* job = new mlJob(); ++jobCounter; @@ -343,7 +343,7 @@ void SpeechData::enqueueMessage( const QString &message, const QString &talker, job->seq = 1; job->partCount = 1; messages.enqueue( job ); - job->sentences = QStringList(); + job->sentences = TQStringList(); // Do not apply Sentence Boundary Detection filters to messages. startJobFiltering( job, message, true ); // uint count = messages.count(); @@ -390,13 +390,13 @@ bool SpeechData::messageInQueue(){ /** * Determines whether the given text is SSML markup. */ -bool SpeechData::isSsml(const QString &text) +bool SpeechData::isSsml(const TQString &text) { /// This checks to see if the root tag of the text is a <speak> tag. - QDomDocument ssml; + TQDomDocument ssml; ssml.setContent(text, false); // No namespace processing. /// Check to see if this is SSML - QDomElement root = ssml.documentElement(); + TQDomElement root = ssml.documentElement(); return (root.tagName() == "speak"); } @@ -412,39 +412,39 @@ bool SpeechData::isSsml(const QString &text) * We will walk before we run for now and not sentence parse. */ -QStringList SpeechData::parseText(const QString &text, const QCString &appId /*=NULL*/) +TQStringList SpeechData::parseText(const TQString &text, const TQCString &appId /*=NULL*/) { // There has to be a better way // kdDebug() << "I'm getting: " << endl << text << " from application " << appId << endl; if (isSsml(text)) { - QString tempList(text); + TQString tempList(text); return tempList; } // See if app has specified a custom sentence delimiter and use it, otherwise use default. - QRegExp sentenceDelimiter; + TQRegExp sentenceDelimiter; if (sentenceDelimiters.find(appId) != sentenceDelimiters.end()) - sentenceDelimiter = QRegExp(sentenceDelimiters[appId]); + sentenceDelimiter = TQRegExp(sentenceDelimiters[appId]); else - sentenceDelimiter = QRegExp("([\\.\\?\\!\\:\\;]\\s)|(\\n *\\n)"); - QString temp = text; + sentenceDelimiter = TQRegExp("([\\.\\?\\!\\:\\;]\\s)|(\\n *\\n)"); + TQString temp = text; // Replace spaces, tabs, and formfeeds with a single space. - temp.replace(QRegExp("[ \\t\\f]+"), " "); + temp.replace(TQRegExp("[ \\t\\f]+"), " "); // Replace sentence delimiters with tab. temp.replace(sentenceDelimiter, "\\1\t"); // Replace remaining newlines with spaces. temp.replace("\n"," "); temp.replace("\r"," "); // Remove leading spaces. - temp.replace(QRegExp("\\t +"), "\t"); + temp.replace(TQRegExp("\\t +"), "\t"); // Remove trailing spaces. - temp.replace(QRegExp(" +\\t"), "\t"); + temp.replace(TQRegExp(" +\\t"), "\t"); // Remove blank lines. - temp.replace(QRegExp("\t\t+"),"\t"); + temp.replace(TQRegExp("\t\t+"),"\t"); // Split into sentences. - QStringList tempList = QStringList::split("\t", temp, false); + TQStringList tempList = TQStringList::split("\t", temp, false); -// for ( QStringList::Iterator it = tempList.begin(); it != tempList.end(); ++it ) { +// for ( TQStringList::Iterator it = tempList.begin(); it != tempList.end(); ++it ) { // kdDebug() << "'" << *it << "'" << endl; // } return tempList; @@ -453,7 +453,7 @@ QStringList SpeechData::parseText(const QString &text, const QCString &appId /*= /** * Queues a text job. */ -uint SpeechData::setText( const QString &text, const QString &talker, const QCString &appId) +uint SpeechData::setText( const TQString &text, const TQString &talker, const TQCString &appId) { // kdDebug() << "Running: SpeechData::setText" << endl; mlJob* job = new mlJob; @@ -467,14 +467,14 @@ uint SpeechData::setText( const QString &text, const QString &talker, const QCSt job->seq = 0; job->partCount = 1; #if NO_FILTERS - QStringList tempList = parseText(text, appId); + TQStringList tempList = parseText(text, appId); job->sentences = tempList; job->partSeqNums.append(tempList.count()); textJobs.append(job); emit textSet(appId, jobNum); #else - job->sentences = QStringList(); - job->partSeqNums = QValueList<int>(); + job->sentences = TQStringList(); + job->partSeqNums = TQValueList<int>(); textJobs.append(job); startJobFiltering(job, text, false); #endif @@ -497,7 +497,7 @@ uint SpeechData::setText( const QString &text, const QString &talker, const QCSt * @see setText. * @see startText. */ -int SpeechData::appendText(const QString &text, const uint jobNum, const QCString& /*appId*/) +int SpeechData::appendText(const TQString &text, const uint jobNum, const TQCString& /*appId*/) { // kdDebug() << "Running: SpeechData::appendText" << endl; int newPartNum = 0; @@ -506,7 +506,7 @@ int SpeechData::appendText(const QString &text, const uint jobNum, const QCStrin { job->partCount++; #if NO_FILTERS - QStringList tempList = parseText(text, appId); + TQStringList tempList = parseText(text, appId); int sentenceCount = job->sentences.count(); job->sentences += tempList; job->partSeqNums.append(sentenceCount + tempList.count()); @@ -528,13 +528,13 @@ int SpeechData::appendText(const QString &text, const uint jobNum, const QCStrin * If appId is NULL, returns the last job in the queue. * Does not change textJobs.current(). */ -mlJob* SpeechData::findLastJobByAppId(const QCString& appId) +mlJob* SpeechData::findLastJobByAppId(const TQCString& appId) { if (appId == NULL) return textJobs.getLast(); else { - QPtrListIterator<mlJob> it(textJobs); + TQPtrListIterator<mlJob> it(textJobs); for (it.toLast() ; it.current(); --it ) { if (it.current()->appId == appId) @@ -555,7 +555,7 @@ mlJob* SpeechData::findLastJobByAppId(const QCString& appId) * If appId is NULL, returns the last job in the queue. * Does not change textJobs.current(). */ -mlJob* SpeechData::findAJobByAppId(const QCString& appId) +mlJob* SpeechData::findAJobByAppId(const TQCString& appId) { mlJob* job = findLastJobByAppId(appId); // if (!job) job = textJobs.getLast(); @@ -571,7 +571,7 @@ mlJob* SpeechData::findAJobByAppId(const QCString& appId) * If appId is NULL, returns the Job Number of the last job in the queue. * Does not change textJobs.current(). */ -uint SpeechData::findAJobNumByAppId(const QCString& appId) +uint SpeechData::findAJobNumByAppId(const TQCString& appId) { mlJob* job = findAJobByAppId(appId); if (job) @@ -588,7 +588,7 @@ uint SpeechData::findAJobNumByAppId(const QCString& appId) */ mlJob* SpeechData::findJobByJobNum(const uint jobNum) { - QPtrListIterator<mlJob> it(textJobs); + TQPtrListIterator<mlJob> it(textJobs); for ( ; it.current(); ++it ) { if (it.current()->jobNum == jobNum) @@ -606,9 +606,9 @@ mlJob* SpeechData::findJobByJobNum(const uint jobNum) * If no such job, returns "". * Does not change textJobs.current(). */ -QCString SpeechData::getAppIdByJobNum(const uint jobNum) +TQCString SpeechData::getAppIdByJobNum(const uint jobNum) { - QCString appId; + TQCString appId; mlJob* job = findJobByJobNum(jobNum); if (job) appId = job->appId; return appId; @@ -630,14 +630,14 @@ void SpeechData::removeText(const uint jobNum) { // kdDebug() << "Running: SpeechData::removeText" << endl; uint removeJobNum = 0; - QCString removeAppId; // The appId of the removed (and stopped) job. + TQCString removeAppId; // The appId of the removed (and stopped) job. mlJob* removeJob = findJobByJobNum(jobNum); if (removeJob) { removeAppId = removeJob->appId; removeJobNum = removeJob->jobNum; // If filtering on the job, cancel it. - QPtrListIterator<PooledFilterMgr> it( m_pooledFilterMgrs ); + TQPtrListIterator<PooledFilterMgr> it( m_pooledFilterMgrs ); for ( ; it.current(); ++it ) { PooledFilterMgr* pooledFilterMgr = it.current(); if (pooledFilterMgr->job && (pooledFilterMgr->job->jobNum == removeJobNum)) @@ -695,8 +695,8 @@ int SpeechData::getJobPartNumFromSeq(const mlJob& job, const int seq) void SpeechData::deleteExpiredJobs(const uint finishedJobNum) { // Save current pointer. - typedef QPair<QCString, uint> removedJob; - typedef QValueList<removedJob> removedJobsList; + typedef QPair<TQCString, uint> removedJob; + typedef TQValueList<removedJob> removedJobsList; removedJobsList removedJobs; // Walk through jobs and delete any other finished jobs. for (mlJob* job = textJobs.first(); (job); job = textJobs.next()) @@ -712,7 +712,7 @@ void SpeechData::deleteExpiredJobs(const uint finishedJobNum) removedJobsList::const_iterator endRemovedJobsList(removedJobs.constEnd()); for (it = removedJobs.constBegin(); it != endRemovedJobsList ; ++it) { - QCString appId = (*it).first; + TQCString appId = (*it).first; uint jobNum = (*it).second; textRemoved(appId, jobNum); } @@ -841,7 +841,7 @@ uint SpeechData::getJobSequenceNum(const uint jobNum) * Changing the sentence delimiter does not affect other applications. * @see sentenceparsing */ -void SpeechData::setSentenceDelimiter(const QString &delimiter, const QCString appId) +void SpeechData::setSentenceDelimiter(const TQString &delimiter, const TQCString appId) { sentenceDelimiters[appId] = delimiter; } @@ -882,14 +882,14 @@ uint SpeechData::getTextJobCount() * Get a comma-separated list of text job numbers in the queue. * @return Comma-separated list of text job numbers in the queue. */ -QString SpeechData::getTextJobNumbers() +TQString SpeechData::getTextJobNumbers() { - QString jobs; - QPtrListIterator<mlJob> it(textJobs); + TQString jobs; + TQPtrListIterator<mlJob> it(textJobs); for ( ; it.current(); ++it ) { if (!jobs.isEmpty()) jobs.append(","); - jobs.append(QString::number(it.current()->jobNum)); + jobs.append(TQString::number(it.current()->jobNum)); } return jobs; } @@ -932,13 +932,13 @@ void SpeechData::setTextJobState(const uint jobNum, const KSpeech::kttsdJobState /** * Get information about a text job. * @param jobNum Job number of the text job. -* @return A QDataStream containing information about the job. +* @return A TQDataStream containing information about the job. * Blank if no such job. * * The stream contains the following elements: * - int state Job state. -* - QCString appId DCOP senderId of the application that requested the speech job. -* - QString talker Language code in which to speak the text. +* - TQCString appId DCOP senderId of the application that requested the speech job. +* - TQString talker Language code in which to speak the text. * - int seq Current sentence being spoken. Sentences are numbered starting at 1. * - int sentenceCount Total number of sentences in the job. * - int partNum Current part of the job begin spoken. Parts are numbered starting at 1. @@ -949,11 +949,11 @@ void SpeechData::setTextJobState(const uint jobNum, const KSpeech::kttsdJobState * * The following sample code will decode the stream: @verbatim - QByteArray jobInfo = getTextJobInfo(jobNum); - QDataStream stream(jobInfo, IO_ReadOnly); + TQByteArray jobInfo = getTextJobInfo(jobNum); + TQDataStream stream(jobInfo, IO_ReadOnly); int state; - QCString appId; - QString talker; + TQCString appId; + TQString talker; int seq; int sentenceCount; int partNum; @@ -967,14 +967,14 @@ void SpeechData::setTextJobState(const uint jobNum, const KSpeech::kttsdJobState stream >> partCount; @endverbatim */ -QByteArray SpeechData::getTextJobInfo(const uint jobNum) +TQByteArray SpeechData::getTextJobInfo(const uint jobNum) { mlJob* job = findJobByJobNum(jobNum); - QByteArray temp; + TQByteArray temp; if (job) { waitJobFiltering(job); - QDataStream stream(temp, IO_WriteOnly); + TQDataStream stream(temp, IO_WriteOnly); stream << job->state; stream << job->appId; stream << job->talker; @@ -993,10 +993,10 @@ QByteArray SpeechData::getTextJobInfo(const uint jobNum) * @return The specified sentence in the specified job. If no such * job or sentence, returns "". */ -QString SpeechData::getTextJobSentence(const uint jobNum, const uint seq /*=1*/) +TQString SpeechData::getTextJobSentence(const uint jobNum, const uint seq /*=1*/) { mlJob* job = findJobByJobNum(jobNum); - QString temp; + TQString temp; if (job) { waitJobFiltering(job); @@ -1015,7 +1015,7 @@ QString SpeechData::getTextJobSentence(const uint jobNum, const uint seq /*=1*/) * If no plugin has been configured for the specified Talker code, * defaults to the closest matching talker. */ -void SpeechData::changeTextTalker(const QString &talker, uint jobNum) +void SpeechData::changeTextTalker(const TQString &talker, uint jobNum) { mlJob* job = findJobByJobNum(jobNum); if (job) job->talker = talker; @@ -1110,7 +1110,7 @@ uint SpeechData::moveRelTextSentence(const int n, const uint jobNum /*=0*/) /** * Assigns a FilterMgr to a job and starts filtering on it. */ -void SpeechData::startJobFiltering(mlJob* job, const QString& text, bool noSBD) +void SpeechData::startJobFiltering(mlJob* job, const TQString& text, bool noSBD) { uint jobNum = job->jobNum; int partNum = job->partCount; @@ -1118,7 +1118,7 @@ void SpeechData::startJobFiltering(mlJob* job, const QString& text, bool noSBD) // Find an idle FilterMgr, if any. // If filtering is already in progress for this job and part, do nothing. PooledFilterMgr* pooledFilterMgr = 0; - QPtrListIterator<PooledFilterMgr> it( m_pooledFilterMgrs ); + TQPtrListIterator<PooledFilterMgr> it( m_pooledFilterMgrs ); for( ; it.current(); ++it ) { if (it.current()->busy) { @@ -1136,8 +1136,8 @@ void SpeechData::startJobFiltering(mlJob* job, const QString& text, bool noSBD) filterMgr->init(config, "General"); pooledFilterMgr->filterMgr = filterMgr; // Connect signals from FilterMgr. - connect (filterMgr, SIGNAL(filteringFinished()), this, SLOT(slotFilterMgrFinished())); - connect (filterMgr, SIGNAL(filteringStopped()), this, SLOT(slotFilterMgrStopped())); + connect (filterMgr, TQT_SIGNAL(filteringFinished()), this, TQT_SLOT(slotFilterMgrFinished())); + connect (filterMgr, TQT_SIGNAL(filteringStopped()), this, TQT_SLOT(slotFilterMgrStopped())); m_pooledFilterMgrs.append(pooledFilterMgr); } // else kdDebug() << "SpeechData::startJobFiltering: re-using idle pooledFilterMgr for job " << jobNum << " part " << partNum << endl; @@ -1166,7 +1166,7 @@ void SpeechData::waitJobFiltering(const mlJob* job) #endif uint jobNum = job->jobNum; bool waited = false; - QPtrListIterator<PooledFilterMgr> it(m_pooledFilterMgrs); + TQPtrListIterator<PooledFilterMgr> it(m_pooledFilterMgrs); for ( ; it.current(); ++it ) { PooledFilterMgr* pooledFilterMgr = it.current(); @@ -1198,7 +1198,7 @@ void SpeechData::doFiltering() while (again) { again = false; - QPtrListIterator<PooledFilterMgr> it( m_pooledFilterMgrs ); + TQPtrListIterator<PooledFilterMgr> it( m_pooledFilterMgrs ); for( ; it.current(); ++it ) { PooledFilterMgr* pooledFilterMgr = it.current(); @@ -1216,7 +1216,7 @@ void SpeechData::doFiltering() { pooledFilterMgr->busy = false; // Retrieve text from FilterMgr. - QString text = filterMgr->getOutput(); + TQString text = filterMgr->getOutput(); // kdDebug() << "SpeechData::doFiltering: text.left(500) = " << text.left(500) << endl; filterMgr->ackFinished(); // Convert the TalkerCode back into string. @@ -1231,7 +1231,7 @@ void SpeechData::doFiltering() // Split the text into sentences and store in the job. // The SBD plugin does all the real sentence parsing, inserting tabs at each // sentence boundary. - QStringList sentences = QStringList::split("\t", text, false); + TQStringList sentences = TQStringList::split("\t", text, false); int sentenceCount = job->sentences.count(); job->sentences += sentences; job->partSeqNums.append(sentenceCount + sentences.count()); diff --git a/kttsd/kttsd/speechdata.h b/kttsd/kttsd/speechdata.h index 40294bf..5f5b92a 100644 --- a/kttsd/kttsd/speechdata.h +++ b/kttsd/kttsd/speechdata.h @@ -26,11 +26,11 @@ #define _SPEECHDATA_H_ // Qt includes. -#include <qptrqueue.h> -#include <qptrlist.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qmap.h> +#include <tqptrqueue.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqmap.h> // KDE includes. #include <kconfig.h> @@ -48,9 +48,9 @@ class TalkerMgr; * the ID of the application that requested it be spoken, and a sequence number. */ struct mlText{ - QString talker; /* Requested Talker code for the sentence. */ - QString text; /* Text of sentence. */ - QCString appId; /* DCOP senderId of the application that requested the speech. */ + TQString talker; /* Requested Talker code for the sentence. */ + TQString text; /* Text of sentence. */ + TQCString appId; /* DCOP senderId of the application that requested the speech. */ uint jobNum; /* Text jobNum. Only applies to text messages; not warning and messages. */ uint seq; /* Sequence number. */ }; @@ -61,11 +61,11 @@ struct mlText{ struct mlJob { uint jobNum; /* Job number. */ KSpeech::kttsdJobState state; /* Job state. */ - QCString appId; /* DCOP senderId of the application that requested the speech job. */ - QString talker; /* Requested Talker code in which to speak the text. */ + TQCString appId; /* DCOP senderId of the application that requested the speech job. */ + TQString talker; /* Requested Talker code in which to speak the text. */ int seq; /* Current sentence being spoken. */ - QValueList<int> partSeqNums; /* List containing last sequence number for each part of a job. */ - QStringList sentences; /* List of sentences in the job. */ + TQValueList<int> partSeqNums; /* List containing last sequence number for each part of a job. */ + TQStringList sentences; /* List of sentences in the job. */ int partCount; /* Number of parts in the job. */ }; @@ -84,21 +84,21 @@ struct PooledFilterMgr { * Struct used to keep notification options. */ struct NotifyOptions { - QString eventName; + TQString eventName; int action; - QString talker; - QString customMsg; + TQString talker; + TQString customMsg; }; /** * A list of notification options for a single app, indexed by event. */ -typedef QMap<QString, NotifyOptions> NotifyEventMap; +typedef TQMap<TQString, NotifyOptions> NotifyEventMap; /** * A list of notification event maps for all apps, indexed by app. */ -typedef QMap<QString, NotifyEventMap> NotifyAppMap; +typedef TQMap<TQString, NotifyEventMap> NotifyAppMap; /** * SpeechData class which is in charge of maintaining all the data on the memory. @@ -108,7 +108,7 @@ typedef QMap<QString, NotifyEventMap> NotifyAppMap; * (dcop service) and the Speaker class (speaker, loads plug ins, call plug in * functions) */ -class SpeechData : public QObject { +class SpeechData : public TQObject { Q_OBJECT public: @@ -142,8 +142,8 @@ class SpeechData : public QObject { * If an existing Screen Reader output is in progress, it is stopped and discarded and * replaced with this new message. */ - void setScreenReaderOutput(const QString &msg, const QString &talker, - const QCString& appId); + void setScreenReaderOutput(const TQString &msg, const TQString &talker, + const TQCString& appId); /** * Given an appId, returns the last (most recently queued) Job Number with that appId, @@ -154,7 +154,7 @@ class SpeechData : public QObject { * If appId is NULL, returns the Job Number of the last job in the queue. * Does not change textJobs.current(). */ - uint findAJobNumByAppId(const QCString& appId); + uint findAJobNumByAppId(const TQCString& appId); /** * Retrieves the Screen Reader Output. @@ -169,8 +169,8 @@ class SpeechData : public QObject { /** * Add a new warning to the queue. */ - void enqueueWarning( const QString &, const QString &talker, - const QCString& appId); + void enqueueWarning( const TQString &, const TQString &talker, + const TQCString& appId); /** * Pop (get and erase) a warning from the queue. @@ -188,8 +188,8 @@ class SpeechData : public QObject { /** * Add a new message to the queue. */ - void enqueueMessage( const QString &, const QString &talker, - const QCString&); + void enqueueMessage( const TQString &, const TQString &talker, + const TQCString&); /** * Pop (get and erase) a message from the queue. @@ -219,7 +219,7 @@ class SpeechData : public QObject { * Changing the sentence delimiter does not affect other applications. * @see sentenceparsing */ - void setSentenceDelimiter(const QString &delimiter, const QCString appId); + void setSentenceDelimiter(const TQString &delimiter, const TQCString appId); /* The following methods correspond to the methods in KSpeech interface. */ @@ -239,7 +239,7 @@ class SpeechData : public QObject { * job is the first speakable job in the queue, speaking will begin. * @see startText. */ - uint setText(const QString &text, const QString &talker, const QCString& appId); + uint setText(const TQString &text, const TQString &talker, const TQCString& appId); /** * Adds another part to a text job. Does not start speaking the text. @@ -255,7 +255,7 @@ class SpeechData : public QObject { * @see setText. * @see startText. */ - int appendText(const QString &text, const uint jobNum, const QCString& appId); + int appendText(const TQString &text, const uint jobNum, const TQCString& appId); /** * Get the number of sentences in a text job. @@ -279,7 +279,7 @@ class SpeechData : public QObject { * Get a comma-separated list of text job numbers in the queue. * @return Comma-separated list of text job numbers in the queue. */ - QString getTextJobNumbers(); + TQString getTextJobNumbers(); /** * Get the state of a text job. @@ -300,13 +300,13 @@ class SpeechData : public QObject { /** * Get information about a text job. * @param jobNum Job number of the text job. - * @return A QDataStream containing information about the job. + * @return A TQDataStream containing information about the job. * Blank if no such job. * * The stream contains the following elements: * - int state Job state. - * - QCString appId DCOP senderId of the application that requested the speech job. - * - QString talker Talker code as requested by application. + * - TQCString appId DCOP senderId of the application that requested the speech job. + * - TQString talker Talker code as requested by application. * - int seq Current sentence being spoken. Sentences are numbered starting at 1. * - int sentenceCount Total number of sentences in the job. * - int partNum Current part of the job begin spoken. Parts are numbered starting at 1. @@ -317,11 +317,11 @@ class SpeechData : public QObject { * * The following sample code will decode the stream: @verbatim - QByteArray jobInfo = getTextJobInfo(jobNum); - QDataStream stream(jobInfo, IO_ReadOnly); + TQByteArray jobInfo = getTextJobInfo(jobNum); + TQDataStream stream(jobInfo, IO_ReadOnly); int state; - QCString appId; - QString talker; + TQCString appId; + TQString talker; int seq; int sentenceCount; int partNum; @@ -335,7 +335,7 @@ class SpeechData : public QObject { stream >> partCount; @endverbatim */ - QByteArray getTextJobInfo(const uint jobNum); + TQByteArray getTextJobInfo(const uint jobNum); /** * Return a sentence of a job. @@ -344,7 +344,7 @@ class SpeechData : public QObject { * @return The specified sentence in the specified job. If no such * job or sentence, returns "". */ - QString getTextJobSentence(const uint jobNum, const uint seq=1); + TQString getTextJobSentence(const uint jobNum, const uint seq=1); /** * Remove a text job from the queue. @@ -363,7 +363,7 @@ class SpeechData : public QObject { * If no plugin has been configured for the specified Talker code, * defaults to the closest matching talker. */ - void changeTextTalker(const QString &talker, uint jobNum); + void changeTextTalker(const TQString &talker, uint jobNum); /** * Move a text job down in the queue so that it is spoken later. @@ -451,7 +451,7 @@ class SpeechData : public QObject { * If no such job, returns "". * Does not change textJobs.current(). */ - QCString getAppIdByJobNum(const uint jobNum); + TQCString getAppIdByJobNum(const uint jobNum); /** * Sets pointer to the TalkerMgr object. @@ -463,7 +463,7 @@ class SpeechData : public QObject { /** * Text pre message */ - QString textPreMsg; + TQString textPreMsg; /** * Text pre message enabled ? @@ -473,7 +473,7 @@ class SpeechData : public QObject { /** * Text pre sound */ - QString textPreSnd; + TQString textPreSnd; /** * Text pre sound enabled ? @@ -483,7 +483,7 @@ class SpeechData : public QObject { /** * Text post message */ - QString textPostMsg; + TQString textPostMsg; /** * Text post message enabled ? @@ -493,7 +493,7 @@ class SpeechData : public QObject { /** * Text post sound */ - QString textPostSnd; + TQString textPostSnd; /** * Text post sound enabled ? @@ -503,7 +503,7 @@ class SpeechData : public QObject { /** * Paragraph pre message */ - QString parPreMsg; + TQString parPreMsg; /** * Paragraph pre message enabled ? @@ -513,7 +513,7 @@ class SpeechData : public QObject { /** * Paragraph pre sound */ - QString parPreSnd; + TQString parPreSnd; /** * Paragraph pre sound enabled ? @@ -523,7 +523,7 @@ class SpeechData : public QObject { /** * Paragraph post message */ - QString parPostMsg; + TQString parPostMsg; /** * Paragraph post message enabled ? @@ -533,7 +533,7 @@ class SpeechData : public QObject { /** * Paragraph post sound */ - QString parPostSnd; + TQString parPostSnd; /** * Paragraph post sound enabled ? @@ -544,7 +544,7 @@ class SpeechData : public QObject { * Keep audio files. Do not delete generated tmp wav files. */ bool keepAudio; - QString keepAudioPath; + TQString keepAudioPath; /** * Notification settings. @@ -581,7 +581,7 @@ class SpeechData : public QObject { * @param appId The DCOP senderId of the application that created the job. * @param jobNum Job number of the text job. */ - void textSet(const QCString& appId, const uint jobNum); + void textSet(const TQCString& appId, const uint jobNum); /** * This signal is emitted whenever a new part is appended to a text job. @@ -590,7 +590,7 @@ class SpeechData : public QObject { * @param partNum Part number of the new part. Parts are numbered starting * at 1. */ - void textAppended(const QCString& appId, const uint jobNum, const int partNum); + void textAppended(const TQCString& appId, const uint jobNum, const int partNum); /** * This signal is emitted whenever a text job is deleted from the queue. @@ -598,7 +598,7 @@ class SpeechData : public QObject { * @param appId The DCOP senderId of the application that created the job. * @param jobNum Job number of the text job. */ - void textRemoved(const QCString& appId, const uint jobNum); + void textRemoved(const TQCString& appId, const uint jobNum); private: /** @@ -609,17 +609,17 @@ class SpeechData : public QObject { /** * Queue of warnings */ - QPtrQueue<mlJob> warnings; + TQPtrQueue<mlJob> warnings; /** * Queue of messages */ - QPtrQueue<mlJob> messages; + TQPtrQueue<mlJob> messages; /** * Queue of text jobs. */ - QPtrList<mlJob> textJobs; + TQPtrList<mlJob> textJobs; /** * TalkerMgr object local pointer. @@ -629,7 +629,7 @@ class SpeechData : public QObject { /** * Pool of FilterMgrs. */ - QPtrList<PooledFilterMgr> m_pooledFilterMgrs; + TQPtrList<PooledFilterMgr> m_pooledFilterMgrs; /** * Job counter. Each new job increments this counter. @@ -639,17 +639,17 @@ class SpeechData : public QObject { /** * Talker of the text */ - QString textTalker; + TQString textTalker; /** * Map of sentence delimiters. One per app. If none specified for an app, uses default. */ - QMap<QCString, QString> sentenceDelimiters; + TQMap<TQCString, TQString> sentenceDelimiters; /** * Determines whether the given text is SSML markup. */ - bool isSsml(const QString &text); + bool isSsml(const TQString &text); /** * Given an appId, returns the last (most recently queued) job with that appId. @@ -659,7 +659,7 @@ class SpeechData : public QObject { * If appId is NULL, returns the last job in the queue. * Does not change textJobs.current(). */ - mlJob* findLastJobByAppId(const QCString& appId); + mlJob* findLastJobByAppId(const TQCString& appId); /** * Given an appId, returns the last (most recently queued) job with that appId, @@ -670,7 +670,7 @@ class SpeechData : public QObject { * If appId is NULL, returns the last job in the queue. * Does not change textJobs.current(). */ - mlJob* findAJobByAppId(const QCString& appId); + mlJob* findAJobByAppId(const TQCString& appId); /** * Given a job and a sequence number, returns the part that sentence is in. @@ -690,7 +690,7 @@ class SpeechData : public QObject { * @return List of parsed sentences. */ - QStringList parseText(const QString &text, const QCString &appId); + TQStringList parseText(const TQString &text, const TQCString &appId); /** * Delete expired jobs. At most, one finished job is kept on the queue. @@ -703,7 +703,7 @@ class SpeechData : public QObject { /** * Assigns a FilterMgr to a job and starts filtering on it. */ - void startJobFiltering(mlJob* job, const QString& text, bool noSBD); + void startJobFiltering(mlJob* job, const TQString& text, bool noSBD); /** * Waits for filtering to be completed on a job. @@ -721,7 +721,7 @@ class SpeechData : public QObject { /** * Loads notify events from a file. Clearing data if clear is True. */ - void loadNotifyEventsFromFile( const QString& filename, bool clear); + void loadNotifyEventsFromFile( const TQString& filename, bool clear); private slots: void slotFilterMgrFinished(); diff --git a/kttsd/kttsd/ssmlconvert.cpp b/kttsd/kttsd/ssmlconvert.cpp index 521a9a6..d33eaf3 100644 --- a/kttsd/kttsd/ssmlconvert.cpp +++ b/kttsd/kttsd/ssmlconvert.cpp @@ -20,11 +20,11 @@ ***************************************************************************/ // Qt includes. -#include <qstring.h> -#include <qstringlist.h> -#include <qdom.h> -#include <qfile.h> -#include <qtextstream.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqdom.h> +#include <tqfile.h> +#include <tqtextstream.h> // KDE includes. #include <kdeversion.h> @@ -39,13 +39,13 @@ /// Constructor. SSMLConvert::SSMLConvert() { - m_talkers = QStringList(); + m_talkers = TQStringList(); m_xsltProc = 0; m_state = tsIdle; } /// Constructor. Set the talkers to be used as reference for entered text. -SSMLConvert::SSMLConvert(const QStringList &talkers) { +SSMLConvert::SSMLConvert(const TQStringList &talkers) { m_talkers = talkers; m_xsltProc = 0; m_state = tsIdle; @@ -54,17 +54,17 @@ SSMLConvert::SSMLConvert(const QStringList &talkers) { /// Destructor. SSMLConvert::~SSMLConvert() { delete m_xsltProc; - if (!m_inFilename.isEmpty()) QFile::remove(m_inFilename); - if (!m_outFilename.isEmpty()) QFile::remove(m_outFilename); + if (!m_inFilename.isEmpty()) TQFile::remove(m_inFilename); + if (!m_outFilename.isEmpty()) TQFile::remove(m_outFilename); } /// Set the talkers to be used as reference for entered text. -void SSMLConvert::setTalkers(const QStringList &talkers) { +void SSMLConvert::setTalkers(const TQStringList &talkers) { m_talkers = talkers; } -QString SSMLConvert::extractTalker(const QString &talkercode) { - QString t = talkercode.section("synthesizer=", 1, 1); +TQString SSMLConvert::extractTalker(const TQString &talkercode) { + TQString t = talkercode.section("synthesizer=", 1, 1); t = t.section('"', 1, 1); if(t.contains("flite")) return "flite"; @@ -103,17 +103,17 @@ QString SSMLConvert::extractTalker(const QString &talkercode) { * * QDom is the item of choice for the matching. Just walk the tree.. */ -QString SSMLConvert::appropriateTalker(const QString &text) const { - QDomDocument ssml; +TQString SSMLConvert::appropriateTalker(const TQString &text) const { + TQDomDocument ssml; ssml.setContent(text, false); // No namespace processing. /// Matches are stored here. Obviously to begin with every talker matches. - QStringList matches = m_talkers; + TQStringList matches = m_talkers; /// Check that this is (well formed) SSML and all our searching will not be in vain. - QDomElement root = ssml.documentElement(); + TQDomElement root = ssml.documentElement(); if(root.tagName() != "speak") { // Not SSML. - return QString::null; + return TQString::null; } /** @@ -122,14 +122,14 @@ QString SSMLConvert::appropriateTalker(const QString &text) const { * * Storage for talker code components. */ - QString talklang, talkvoice, talkgender, talkvolume, talkrate, talkname; + TQString talklang, talkvoice, talkgender, talkvolume, talkrate, talkname; kdDebug() << "SSMLConvert::appropriateTalker: BEFORE LANGUAGE SEARCH: " << matches.join(" ") << endl;; /** * Language searching */ if(root.hasAttribute("xml:lang")) { - QString lang = root.attribute("xml:lang"); + TQString lang = root.attribute("xml:lang"); kdDebug() << "SSMLConvert::appropriateTalker: xml:lang found (" << lang << ")" << endl; /// If it is set to en*, then match all english speakers. They all sound the same anyways. if(lang.contains("en-")) { @@ -153,7 +153,7 @@ QString SSMLConvert::appropriateTalker(const QString &text) const { * ignore the choice and just use female. */ if(root.hasAttribute("gender")) { - QString gender = root.attribute("gender"); + TQString gender = root.attribute("gender"); kdDebug() << "SSMLConvert::appropriateTalker: gender found (" << gender << ")" << endl; /// If the gender found is not 'male' or 'female' then ignore it. if(!(gender == "male" || gender == "female")) { @@ -178,7 +178,7 @@ QString SSMLConvert::appropriateTalker(const QString &text) const { matches.grep("synthesizer=\"Hadifix").count() >= 1) { kdDebug() << "SSMLConvert::appropriateTalker: Prosody allowed" << endl; - QStringList tmpmatches = matches.grep("synthesizer=\"Festival Interactive"); + TQStringList tmpmatches = matches.grep("synthesizer=\"Festival Interactive"); matches = matches.grep("synthesizer=\"Hadifix"); matches = tmpmatches + matches; } @@ -203,12 +203,12 @@ QString SSMLConvert::appropriateTalker(const QString &text) const { * the transformed text. */ -bool SSMLConvert::transform(const QString &text, const QString &xsltFilename) { +bool SSMLConvert::transform(const TQString &text, const TQString &xsltFilename) { m_xsltFilename = xsltFilename; /// Write @param text to a temporary file. KTempFile inFile(locateLocal("tmp", "kttsd-"), ".ssml"); m_inFilename = inFile.file()->name(); - QTextStream* wstream = inFile.textStream(); + TQTextStream* wstream = inFile.textStream(); if (wstream == 0) { /// wtf... kdDebug() << "SSMLConvert::transform: Can't write to " << m_inFilename << endl;; @@ -239,8 +239,8 @@ bool SSMLConvert::transform(const QString &text, const QString &xsltFilename) { // kdDebug() << "SSMLConvert::transform: executing command: " << // m_xsltProc->args() << endl; - connect(m_xsltProc, SIGNAL(processExited(KProcess*)), - this, SLOT(slotProcessExited(KProcess*))); + connect(m_xsltProc, TQT_SIGNAL(processExited(KProcess*)), + this, TQT_SLOT(slotProcessExited(KProcess*))); if (!m_xsltProc->start(KProcess::NotifyOnExit, KProcess::NoCommunication)) { kdDebug() << "SSMLConvert::transform: Error starting xsltproc" << endl; @@ -266,26 +266,26 @@ int SSMLConvert::getState() { return m_state; } /** * Returns the output from call to transform. */ -QString SSMLConvert::getOutput() +TQString SSMLConvert::getOutput() { /// Read back the data that was written to /tmp/fileName.output. - QFile readfile(m_outFilename); + TQFile readfile(m_outFilename); if(!readfile.open(IO_ReadOnly)) { /// uhh yeah... Issues writing to the SSML file. kdDebug() << "SSMLConvert::slotProcessExited: Could not read file " << m_outFilename << endl; - return QString::null; + return TQString::null; } - QTextStream rstream(&readfile); - QString convertedData = rstream.read(); + TQTextStream rstream(&readfile); + TQString convertedData = rstream.read(); readfile.close(); // kdDebug() << "SSMLConvert::slotProcessExited: Read SSML file at " + m_inFilename + " and created " + m_outFilename + " based on the stylesheet at " << m_xsltFilename << endl; // Clean up. - QFile::remove(m_inFilename); - m_inFilename = QString::null; - QFile::remove(m_outFilename); - m_outFilename = QString::null; + TQFile::remove(m_inFilename); + m_inFilename = TQString::null; + TQFile::remove(m_outFilename); + m_outFilename = TQString::null; // Ready for another transform. m_state = tsIdle; diff --git a/kttsd/kttsd/ssmlconvert.h b/kttsd/kttsd/ssmlconvert.h index 1ee332c..b9f57bf 100644 --- a/kttsd/kttsd/ssmlconvert.h +++ b/kttsd/kttsd/ssmlconvert.h @@ -24,25 +24,25 @@ /** * SsmlConvert class: - * Receives a QStringList of talkers and, based on that information, + * Receives a TQStringList of talkers and, based on that information, * evaluates received SSML to discover which of the given talkers best * suits it. It can then convert the given SSML into a format understandable * by the talker. */ // Qt includes -#include <qobject.h> -#include <qstringlist.h> +#include <tqobject.h> +#include <tqstringlist.h> class KProcess; class QString; -class SSMLConvert : public QObject { +class SSMLConvert : public TQObject { Q_OBJECT public: /** Constructors */ SSMLConvert(); - SSMLConvert(const QStringList &talkers); + SSMLConvert(const TQStringList &talkers); /** Destructor */ virtual ~SSMLConvert(); @@ -56,19 +56,19 @@ public: * Set the talker codes to be used. * @param talkers talker codes to be used. */ - void setTalkers(const QStringList &talkers); + void setTalkers(const TQStringList &talkers); /** * Extract the synth name from a talker code (i.e festival, flite, freetts). * @param talkercode the talker code to extract the talker from. * @returns the talker. */ - QString extractTalker(const QString &talkercode); + TQString extractTalker(const TQString &talkercode); /** * Returns the most appropriate talker for the text to synth's talker code. * @param text the text that will be parsed. - * @returns the appropriate talker for the job as a talker code QString. + * @returns the appropriate talker for the job as a talker code TQString. * * The appropriate talker is the one that has the most features that are required in some * SSML markup. In the future i'm hoping to make the importance of individual features @@ -79,7 +79,7 @@ public: * * See the implementation file for more detail. */ - QString appropriateTalker(const QString &text) const; + TQString appropriateTalker(const TQString &text) const; /** * Applies the spreadsheet for a talker to the SSML and returns the talker-native output. @@ -90,7 +90,7 @@ public: * This converts a piece of SSML into a format the given talker can understand. It applies * an XSLT spreadsheet to the SSML and returns the output. */ - bool transform(const QString &text, const QString &xsltFilename); + bool transform(const TQString &text, const TQString &xsltFilename); /** * Returns current processing state. @@ -100,7 +100,7 @@ public: /** * Returns the output from call to transform. */ - QString getOutput(); + TQString getOutput(); signals: /** @@ -115,15 +115,15 @@ private: /// The XSLT processor. KProcess *m_xsltProc; /// Current talkers. - QStringList m_talkers; + TQStringList m_talkers; // Current state. int m_state; // Name of XSLT file. - QString m_xsltFilename; + TQString m_xsltFilename; // Name of temporary input file. - QString m_inFilename; + TQString m_inFilename; // Name of temporary output file. - QString m_outFilename; + TQString m_outFilename; }; #endif // _SSMLCONVERT_H_ diff --git a/kttsd/kttsd/talkermgr.cpp b/kttsd/kttsd/talkermgr.cpp index 345f12b..f10281c 100644 --- a/kttsd/kttsd/talkermgr.cpp +++ b/kttsd/kttsd/talkermgr.cpp @@ -37,8 +37,8 @@ /** * Constructor. */ -TalkerMgr::TalkerMgr(QObject *parent, const char *name) : - QObject( parent, name ) +TalkerMgr::TalkerMgr(TQObject *parent, const char *name) : + TQObject( parent, name ) { m_loadedPlugIns.setAutoDelete(true); } @@ -66,23 +66,23 @@ int TalkerMgr::loadPlugIns(KConfig* config) m_loadedTalkerIds.clear(); config->setGroup("General"); - QStringList talkerIDsList = config->readListEntry("TalkerIDs", ','); + TQStringList talkerIDsList = config->readListEntry("TalkerIDs", ','); if (!talkerIDsList.isEmpty()) { KLibFactory *factory; - QStringList::ConstIterator itEnd(talkerIDsList.constEnd()); - for( QStringList::ConstIterator it = talkerIDsList.constBegin(); it != itEnd; ++it ) + TQStringList::ConstIterator itEnd(talkerIDsList.constEnd()); + for( TQStringList::ConstIterator it = talkerIDsList.constBegin(); it != itEnd; ++it ) { // kdDebug() << "Loading plugInProc for Talker ID " << *it << endl; // Talker ID. - QString talkerID = *it; + TQString talkerID = *it; // Set the group for the language we're loading config->setGroup("Talker_" + talkerID); // Get the DesktopEntryName of the plugin we will try to load. - QString desktopEntryName = config->readEntry("DesktopEntryName", QString::null); + TQString desktopEntryName = config->readEntry("DesktopEntryName", TQString::null); // If a DesktopEntryName is not in the config file, it was configured before // we started using them, when we stored translated plugin names instead. @@ -91,7 +91,7 @@ int TalkerMgr::loadPlugIns(KConfig* config) // and DesktopEntryName won't change. if (desktopEntryName.isEmpty()) { - QString synthName = config->readEntry("PlugIn", QString::null); + TQString synthName = config->readEntry("PlugIn", TQString::null); // See if the translated name will untranslate. If not, well, sorry. desktopEntryName = TalkerCode::TalkerNameToDesktopEntryName(synthName); // Record the DesktopEntryName from now on. @@ -99,15 +99,15 @@ int TalkerMgr::loadPlugIns(KConfig* config) } // Get the talker code. - QString talkerCode = config->readEntry("TalkerCode", QString::null); + TQString talkerCode = config->readEntry("TalkerCode", TQString::null); // Normalize the talker code. - QString fullLanguageCode; + TQString fullLanguageCode; talkerCode = TalkerCode::normalizeTalkerCode(talkerCode, fullLanguageCode); // Find the KTTSD SynthPlugin. KTrader::OfferList offers = KTrader::self()->query( - "KTTSD/SynthPlugin", QString("DesktopEntryName == '%1'").arg(desktopEntryName)); + "KTTSD/SynthPlugin", TQString("DesktopEntryName == '%1'").arg(desktopEntryName)); if(offers.count() > 1){ ++bad; @@ -134,7 +134,7 @@ int TalkerMgr::loadPlugIns(KConfig* config) } else { // Synchronous plugins are run in a separate thread. // Init will start the thread and it will immediately go to sleep. - QString threadedPlugInName = QString::fromLatin1("threaded") + desktopEntryName; + TQString threadedPlugInName = TQString::fromLatin1("threaded") + desktopEntryName; ThreadedPlugIn* speechThread = new ThreadedPlugIn(speech, this, threadedPlugInName.latin1()); speechThread->init(config, "Talker_" + talkerCode); @@ -172,12 +172,12 @@ int TalkerMgr::loadPlugIns(KConfig* config) /** * Get a list of the talkers configured in KTTS. - * @return A QStringList of fully-specified talker codes, one + * @return A TQStringList of fully-specified talker codes, one * for each talker user has configured. */ -QStringList TalkerMgr::getTalkers() +TQStringList TalkerMgr::getTalkers() { - QStringList talkerList; + TQStringList talkerList; for (int ndx = 0; ndx < int(m_loadedPlugIns.count()); ++ndx) { talkerList.append(m_loadedTalkerCodes[ndx].getTalkerCode()); @@ -188,7 +188,7 @@ QStringList TalkerMgr::getTalkers() /** * Returns a list of all the loaded plugins. */ -QPtrList<PlugInProc> TalkerMgr::getLoadedPlugIns() +TQPtrList<PlugInProc> TalkerMgr::getLoadedPlugIns() { return m_loadedPlugIns; } @@ -201,7 +201,7 @@ QPtrList<PlugInProc> TalkerMgr::getLoadedPlugIns() * If a plugin has not been loaded to match the talker, returns the default * plugin. */ -int TalkerMgr::talkerToPluginIndex(const QString& talker) const +int TalkerMgr::talkerToPluginIndex(const TQString& talker) const { // kdDebug() << "TalkerMgr::talkerToPluginIndex: matching talker " << talker << " to closest matching plugin." << endl; // If we have a cached match, return that. @@ -228,10 +228,10 @@ int TalkerMgr::talkerToPluginIndex(const QString& talker) const * overrides all other attributes, i.e, it is treated as an automatic "top priority" * attribute. */ -PlugInProc* TalkerMgr::talkerToPlugin(const QString& talker) const +PlugInProc* TalkerMgr::talkerToPlugin(const TQString& talker) const { int talkerNdx = talkerToPluginIndex(talker); - return const_cast< QPtrList<PlugInProc>* >(&m_loadedPlugIns)->at(talkerNdx); + return const_cast< TQPtrList<PlugInProc>* >(&m_loadedPlugIns)->at(talkerNdx); } /** @@ -249,7 +249,7 @@ PlugInProc* TalkerMgr::talkerToPlugin(const QString& talker) const * overrides all other attributes, i.e, it is treated as an automatic "top priority" * attribute. */ -TalkerCode* TalkerMgr::talkerToTalkerCode(const QString& talker) +TalkerCode* TalkerMgr::talkerToTalkerCode(const TQString& talker) { int talkerNdx = talkerToPluginIndex(talker); return new TalkerCode(&m_loadedTalkerCodes[talkerNdx]); @@ -261,7 +261,7 @@ TalkerCode* TalkerMgr::talkerToTalkerCode(const QString& talker) * @param talkerCode Talker Code. * @return Talker ID of the talker that would speak the text job. */ -QString TalkerMgr::talkerCodeToTalkerId(const QString& talkerCode) +TQString TalkerMgr::talkerCodeToTalkerId(const TQString& talkerCode) { int talkerNdx = talkerToPluginIndex(talkerCode); return m_loadedTalkerIds[talkerNdx]; @@ -274,7 +274,7 @@ QString TalkerMgr::talkerCodeToTalkerId(const QString& talkerCode) * @see talkers * @see getTalkers */ -QString TalkerMgr::userDefaultTalker() const +TQString TalkerMgr::userDefaultTalker() const { return m_loadedTalkerCodes[0].getTalkerCode(); } @@ -288,25 +288,25 @@ QString TalkerMgr::userDefaultTalker() const * talker supports the indicated speech markup language. * @see kttsdMarkupType */ -bool TalkerMgr::supportsMarkup(const QString& talker, const uint /*markupType*/) const +bool TalkerMgr::supportsMarkup(const TQString& talker, const uint /*markupType*/) const { kdDebug() << "TalkerMgr::supportsMarkup: Testing talker " << talker << endl; - QString matchingTalker = talker; + TQString matchingTalker = talker; if (matchingTalker.isEmpty()) matchingTalker = userDefaultTalker(); PlugInProc* plugin = talkerToPlugin(matchingTalker); return ( plugin->getSsmlXsltFilename() != KGlobal::dirs()->resourceDirs("data").last() + "kttsd/xslt/SSMLtoPlainText.xsl"); } -bool TalkerMgr::autoconfigureTalker(const QString& langCode, KConfig* config) +bool TalkerMgr::autoconfigureTalker(const TQString& langCode, KConfig* config) { // Not yet implemented. // return false; - QString languageCode = langCode; + TQString languageCode = langCode; // Get last TalkerID from config. - QStringList talkerIDsList = config->readListEntry("TalkerIDs", ','); + TQStringList talkerIDsList = config->readListEntry("TalkerIDs", ','); int lastTalkerID = 0; for (uint talkerIdNdx = 0; talkerIdNdx < talkerIDsList.count(); ++talkerIdNdx) { @@ -315,7 +315,7 @@ bool TalkerMgr::autoconfigureTalker(const QString& langCode, KConfig* config) } // Assign a new Talker ID for the talker. Wraps around to 1. - QString talkerID = QString::number(lastTalkerID + 1); + TQString talkerID = TQString::number(lastTalkerID + 1); // Query for all the KTTSD SynthPlugins. KTrader::OfferList offers = KTrader::self()->query("KTTSD/SynthPlugin"); @@ -324,10 +324,10 @@ bool TalkerMgr::autoconfigureTalker(const QString& langCode, KConfig* config) for(unsigned int i=0; i < offers.count() ; ++i) { // See if this plugin supports the desired language. - QStringList languageCodes = offers[i]->property("X-KDE-Languages").toStringList(); + TQStringList languageCodes = offers[i]->property("X-KDE-Languages").toStringList(); if (languageCodes.contains(languageCode)) { - QString desktopEntryName = offers[i]->desktopEntryName(); + TQString desktopEntryName = offers[i]->desktopEntryName(); // Load the plugin. KLibFactory *factory = KLibLoader::self()->factory(offers[0]->library().latin1()); @@ -342,22 +342,22 @@ bool TalkerMgr::autoconfigureTalker(const QString& langCode, KConfig* config) { // Give plugin the language code and permit plugin to autoconfigure itself. loadedTalkerPlugIn->setDesiredLanguage(languageCode); - loadedTalkerPlugIn->load(config, QString("Talker_")+talkerID); + loadedTalkerPlugIn->load(config, TQString("Talker_")+talkerID); // If plugin was able to configure itself, it returns a full talker code. - QString talkerCode = loadedTalkerPlugIn->getTalkerCode(); + TQString talkerCode = loadedTalkerPlugIn->getTalkerCode(); if (!talkerCode.isEmpty()) { // Erase extraneous Talker configuration entries that might be there. - config->deleteGroup(QString("Talker_")+talkerID); + config->deleteGroup(TQString("Talker_")+talkerID); // Let plugin save its configuration. - config->setGroup(QString("Talker_")+talkerID); - loadedTalkerPlugIn->save(config, QString("Talker_"+talkerID)); + config->setGroup(TQString("Talker_")+talkerID); + loadedTalkerPlugIn->save(config, TQString("Talker_"+talkerID)); // Record configuration data. - config->setGroup(QString("Talker_")+talkerID); + config->setGroup(TQString("Talker_")+talkerID); config->writeEntry("DesktopEntryName", desktopEntryName); talkerCode = TalkerCode::normalizeTalkerCode(talkerCode, languageCode); config->writeEntry("TalkerCode", talkerCode); diff --git a/kttsd/kttsd/talkermgr.h b/kttsd/kttsd/talkermgr.h index 5b890ae..52ddc4d 100644 --- a/kttsd/kttsd/talkermgr.h +++ b/kttsd/kttsd/talkermgr.h @@ -25,10 +25,10 @@ #define _TALKERMGR_H_ // Qt includes. -#include <qstring.h> -#include <qstringlist.h> -#include <qmap.h> -#include <qptrlist.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqmap.h> +#include <tqptrlist.h> // KTTS includes. #include "talkercode.h" @@ -41,7 +41,7 @@ public: /** * Constructor. */ - TalkerMgr(QObject *parent = 0, const char *name = 0); + TalkerMgr(TQObject *parent = 0, const char *name = 0); /** * Destructor. @@ -55,15 +55,15 @@ public: /** * Get a list of the talkers configured in KTTS. - * @return A QStringList of fully-specified talker codes, one + * @return A TQStringList of fully-specified talker codes, one * for each talker user has configured. */ - QStringList getTalkers(); + TQStringList getTalkers(); /** * Returns a list of all the loaded plugins. */ - QPtrList<PlugInProc> getLoadedPlugIns(); + TQPtrList<PlugInProc> getLoadedPlugIns(); /** * Given a talker code, returns pointer to the closest matching plugin. @@ -73,7 +73,7 @@ public: * If a plugin has not been loaded to match the talker, returns the default * plugin. */ - int talkerToPluginIndex(const QString& talker) const; + int talkerToPluginIndex(const TQString& talker) const; /** * Given a talker code, returns pointer to the closest matching plugin. @@ -83,7 +83,7 @@ public: * If a plugin has not been loaded to match the talker, returns the default * plugin. */ - PlugInProc* talkerToPlugin(const QString& talker) const; + PlugInProc* talkerToPlugin(const TQString& talker) const; /** * Given a talker code, returns the parsed TalkerCode of the closest matching Talker. @@ -100,7 +100,7 @@ public: * overrides all other attributes, i.e, it is treated as an automatic "top priority" * attribute. */ - TalkerCode* talkerToTalkerCode(const QString& talker); + TalkerCode* talkerToTalkerCode(const TQString& talker); /** * Given a Talker Code, returns the Talker ID of the talker that would speak @@ -108,7 +108,7 @@ public: * @param talkerCode Talker Code. * @return Talker ID of the talker that would speak the text job. */ - QString talkerCodeToTalkerId(const QString& talkerCode); + TQString talkerCodeToTalkerId(const TQString& talkerCode); /** * Get the user's default talker. @@ -117,7 +117,7 @@ public: * @see talkers * @see getTalkers */ - QString userDefaultTalker() const; + TQString userDefaultTalker() const; /** * Determine whether the currently-configured speech plugin supports a speech markup language. @@ -128,7 +128,7 @@ public: * talker supports the indicated speech markup language. * @see kttsdMarkupType */ - bool supportsMarkup(const QString& talker, const uint markupType) const; + bool supportsMarkup(const TQString& talker, const uint markupType) const; /** * Try to automatically configure a Talker in the specified language. @@ -138,7 +138,7 @@ public: * * If successful, the KConfig rc file is updated but the talker has not been loaded. */ - bool autoconfigureTalker(const QString& langCode, KConfig* config); + bool autoconfigureTalker(const TQString& langCode, KConfig* config); private: @@ -146,14 +146,14 @@ private: * Array of the loaded plug ins for different Talkers. * Array of parsed Talker Codes for the plugins. */ - QPtrList<PlugInProc> m_loadedPlugIns; - QStringList m_loadedTalkerIds; + TQPtrList<PlugInProc> m_loadedPlugIns; + TQStringList m_loadedTalkerIds; TalkerCode::TalkerCodeList m_loadedTalkerCodes; /** * Cache of talker codes and index of closest matching Talker. */ - mutable QMap<QString,int> m_talkerToPlugInCache; + mutable TQMap<TQString,int> m_talkerToPlugInCache; }; #endif // _TALKERMGR_H_ diff --git a/kttsd/kttsd/threadedplugin.cpp b/kttsd/kttsd/threadedplugin.cpp index babc792..eacd598 100644 --- a/kttsd/kttsd/threadedplugin.cpp +++ b/kttsd/kttsd/threadedplugin.cpp @@ -21,8 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ******************************************************************************/ -#include <qevent.h> -#include <qapplication.h> +#include <tqevent.h> +#include <tqapplication.h> #include <kdebug.h> @@ -33,11 +33,11 @@ * Constructor. */ ThreadedPlugIn::ThreadedPlugIn(PlugInProc* plugin, - QObject *parent /*= 0*/, const char *name /*= 0*/): + TQObject *parent /*= 0*/, const char *name /*= 0*/): PlugInProc(parent, name), - QThread(), + TQThread(), m_plugin(plugin), - m_filename(QString::null), + m_filename(TQString::null), m_requestExit(false), m_supportsSynth(false) { @@ -71,7 +71,7 @@ ThreadedPlugIn::~ThreadedPlugIn() /** * Initialize the speech plugin. */ -bool ThreadedPlugIn::init(KConfig *config, const QString &configGroup) +bool ThreadedPlugIn::init(KConfig *config, const TQString &configGroup) { bool stat = m_plugin->init(config, configGroup); m_supportsSynth = m_plugin->supportsSynth(); @@ -87,7 +87,7 @@ bool ThreadedPlugIn::init(KConfig *config, const QString &configGroup) * If the plugin supports asynchronous operation, it should return immediately * and emit sayFinished signal when synthesis and audibilizing is finished. */ -void ThreadedPlugIn::sayText(const QString &text) +void ThreadedPlugIn::sayText(const TQString &text) { kdDebug() << "ThreadedPlugin::sayText running with text " << text << endl; waitThreadNotBusy(); @@ -108,7 +108,7 @@ void ThreadedPlugIn::sayText(const QString &text) * If the plugin supports asynchronous operation, it should return immediately * and emit synthFinished signal when synthesis is completed. */ -void ThreadedPlugIn::synthText(const QString &text, const QString &suggestedFilename) +void ThreadedPlugIn::synthText(const TQString &text, const TQString &suggestedFilename) { waitThreadNotBusy(); m_action = paSynthText; @@ -125,7 +125,7 @@ void ThreadedPlugIn::synthText(const QString &text, const QString &suggestedFile * * The plugin must not re-use the filename. */ -QString ThreadedPlugIn::getFilename() +TQString ThreadedPlugIn::getFilename() { return m_filename; } @@ -188,7 +188,7 @@ void ThreadedPlugIn::ackFinished() { // Since plugin should not be running, don't bother with Mutex here. if (m_state == psFinished) m_state = psIdle; - m_filename = QString::null; + m_filename = TQString::null; } /** @@ -264,8 +264,8 @@ void ThreadedPlugIn::run() m_stateMutex.lock(); m_state = psSynthing; m_stateMutex.unlock(); - QString filename = m_filename; - m_filename = QString::null; + TQString filename = m_filename; + m_filename = TQString::null; kdDebug() << "ThreadedPlugIn::run calling synthText" << endl; m_plugin->synthText(m_text, filename); kdDebug() << "ThreadedPlugIn::run back from synthText" << endl; diff --git a/kttsd/kttsd/threadedplugin.h b/kttsd/kttsd/threadedplugin.h index bc9ed6a..1a1b13e 100644 --- a/kttsd/kttsd/threadedplugin.h +++ b/kttsd/kttsd/threadedplugin.h @@ -24,15 +24,15 @@ #ifndef _THREADEDPLUGIN_H_ #define _THREADEDPLUGIN_H_ -#include <qthread.h> -#include <qmutex.h> -#include <qwaitcondition.h> +#include <tqthread.h> +#include <tqmutex.h> +#include <tqwaitcondition.h> #include "pluginproc.h" class Speaker; -class ThreadedPlugIn : public PlugInProc, public QThread +class ThreadedPlugIn : public PlugInProc, public TQThread { public: enum pluginAction @@ -45,7 +45,7 @@ class ThreadedPlugIn : public PlugInProc, public QThread /** * Constructor. */ - ThreadedPlugIn(PlugInProc* plugin, QObject *parent = 0, const char *name = 0); + ThreadedPlugIn(PlugInProc* plugin, TQObject *parent = 0, const char *name = 0); /** * Destructor. @@ -55,7 +55,7 @@ class ThreadedPlugIn : public PlugInProc, public QThread /** * Initializate the speech plugin. */ - virtual bool init(KConfig *config, const QString &configGroup); + virtual bool init(KConfig *config, const TQString &configGroup); /** * Say a text. Synthesize and audibilize it. @@ -64,7 +64,7 @@ class ThreadedPlugIn : public PlugInProc, public QThread * If the plugin supports asynchronous operation, it should return immediately * and emit sayFinished signal when synthesis and audibilizing is finished. */ - 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. @@ -77,7 +77,7 @@ class ThreadedPlugIn : public PlugInProc, public QThread * If the plugin supports asynchronous operation, it should return immediately * and emit synthFinished signal 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 synthText. @@ -86,7 +86,7 @@ class ThreadedPlugIn : public PlugInProc, public QThread * * The plugin must not re-use the filename. */ - virtual QString getFilename(); + virtual TQString getFilename(); /** * Stop current operation (saying or synthesizing text). @@ -154,7 +154,7 @@ class ThreadedPlugIn : public PlugInProc, public QThread /** * A text buffer to go with an action (if applicable). */ - QString m_text; + TQString m_text; /** * Current state of the plugin. @@ -164,7 +164,7 @@ class ThreadedPlugIn : public PlugInProc, public QThread /** * Mutext for accessing state variable. */ - QMutex m_stateMutex; + TQMutex m_stateMutex; /** * True when stopText was called but the plugin did not stop. @@ -174,17 +174,17 @@ class ThreadedPlugIn : public PlugInProc, public QThread /** * Locked when thread is running. */ - QMutex m_threadRunningMutex; + TQMutex m_threadRunningMutex; /** * Filename for generated synthesized text. */ - QString m_filename; + TQString m_filename; /** * Thread wait condition. */ - QWaitCondition m_waitCondition; + TQWaitCondition m_waitCondition; /** * Thread exit flag. |