From 28bf3cbba4139c8a0f81dc9d1a2f6c4ed724f22c Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:20:30 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaccessibility@1157633 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kttsd/plugins/festivalint/festivalintconf.cpp | 218 +++++++++++++------------- kttsd/plugins/festivalint/festivalintconf.h | 48 +++--- kttsd/plugins/festivalint/festivalintproc.cpp | 100 ++++++------ kttsd/plugins/festivalint/festivalintproc.h | 50 +++--- 4 files changed, 208 insertions(+), 208 deletions(-) (limited to 'kttsd/plugins/festivalint') diff --git a/kttsd/plugins/festivalint/festivalintconf.cpp b/kttsd/plugins/festivalint/festivalintconf.cpp index 91cd24f..8464ad7 100644 --- a/kttsd/plugins/festivalint/festivalintconf.cpp +++ b/kttsd/plugins/festivalint/festivalintconf.cpp @@ -25,15 +25,15 @@ #include // Qt includes. -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // KDE includes. #include @@ -57,7 +57,7 @@ #include "festivalintconf.moc" /** Constructor */ -FestivalIntConf::FestivalIntConf( QWidget* parent, const char* name, const QStringList& /*args*/) : +FestivalIntConf::FestivalIntConf( TQWidget* parent, const char* name, const TQStringList& /*args*/) : PlugInConf(parent, name) { // kdDebug() << "FestivalIntConf::FestivalIntConf: Running" << endl; @@ -65,7 +65,7 @@ FestivalIntConf::FestivalIntConf( QWidget* parent, const char* name, const QStri m_progressDlg = 0; m_supportsSSML = FestivalIntProc::ssUnknown; - QVBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), + TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint(), "FestivalIntConfigWidgetLayout"); layout->setAlignment (Qt::AlignTop); m_widget = new FestivalIntConfWidget(this, "FestivalIntConfigWidget"); @@ -81,43 +81,43 @@ FestivalIntConf::FestivalIntConf( QWidget* parent, const char* name, const QStri // defaults(); - connect(m_widget->festivalPath, SIGNAL(textChanged(const QString&)), - this, SLOT(slotFestivalPath_textChanged())); - connect(m_widget->selectVoiceCombo, SIGNAL(activated(const QString&)), - this, SLOT(slotSelectVoiceCombo_activated())); - connect(m_widget->selectVoiceCombo, SIGNAL(activated(const QString&)), - this, SLOT(configChanged())); - connect(m_widget->testButton, SIGNAL(clicked()), this, SLOT(slotTest_clicked())); - connect(m_widget->rescan, SIGNAL(clicked()), this, SLOT(scanVoices())); - connect(m_widget->volumeBox, SIGNAL(valueChanged(int)), - this, SLOT(volumeBox_valueChanged(int))); - connect(m_widget->timeBox, SIGNAL(valueChanged(int)), - this, SLOT(timeBox_valueChanged(int))); - connect(m_widget->frequencyBox, SIGNAL(valueChanged(int)), - this, SLOT(frequencyBox_valueChanged(int))); - connect(m_widget->volumeSlider, SIGNAL(valueChanged(int)), - this, SLOT(volumeSlider_valueChanged(int))); - connect(m_widget->timeSlider, SIGNAL(valueChanged(int)), - this, SLOT(timeSlider_valueChanged(int))); - connect(m_widget->frequencySlider, SIGNAL(valueChanged(int)), - this, SLOT(frequencySlider_valueChanged(int))); - connect(m_widget->volumeBox, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(m_widget->volumeSlider, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(m_widget->timeBox, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(m_widget->timeSlider, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(m_widget->frequencyBox, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(m_widget->frequencySlider, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(m_widget->preloadCheckBox, SIGNAL(clicked()), this, SLOT(configChanged())); - connect(m_widget->characterCodingBox, SIGNAL(textChanged(const QString&)), - this, SLOT(configChanged())); - connect(m_widget->characterCodingBox, SIGNAL(activated(const QString&)), - this, SLOT(configChanged())); + connect(m_widget->festivalPath, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(slotFestivalPath_textChanged())); + connect(m_widget->selectVoiceCombo, TQT_SIGNAL(activated(const TQString&)), + this, TQT_SLOT(slotSelectVoiceCombo_activated())); + connect(m_widget->selectVoiceCombo, TQT_SIGNAL(activated(const TQString&)), + this, TQT_SLOT(configChanged())); + connect(m_widget->testButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotTest_clicked())); + connect(m_widget->rescan, TQT_SIGNAL(clicked()), this, TQT_SLOT(scanVoices())); + connect(m_widget->volumeBox, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(volumeBox_valueChanged(int))); + connect(m_widget->timeBox, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(timeBox_valueChanged(int))); + connect(m_widget->frequencyBox, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(frequencyBox_valueChanged(int))); + connect(m_widget->volumeSlider, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(volumeSlider_valueChanged(int))); + connect(m_widget->timeSlider, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(timeSlider_valueChanged(int))); + connect(m_widget->frequencySlider, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(frequencySlider_valueChanged(int))); + connect(m_widget->volumeBox, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(m_widget->volumeSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(m_widget->timeBox, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(m_widget->timeSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(m_widget->frequencyBox, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(m_widget->frequencySlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(m_widget->preloadCheckBox, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(m_widget->characterCodingBox, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(configChanged())); + connect(m_widget->characterCodingBox, TQT_SIGNAL(activated(const TQString&)), + this, TQT_SLOT(configChanged())); } /** Destructor */ FestivalIntConf::~FestivalIntConf(){ // kdDebug() << "FestivalIntConf::~FestivalIntConf: Running" << endl; - if (!m_waveFile.isNull()) QFile::remove(m_waveFile); + if (!m_waveFile.isNull()) TQFile::remove(m_waveFile); delete m_festProc; delete m_progressDlg; } @@ -126,7 +126,7 @@ FestivalIntConf::~FestivalIntConf(){ * Given a voice code, returns index into m_voiceList array (and voiceCombo box). * -1 if not found. */ -int FestivalIntConf::voiceCodeToListIndex(const QString& voiceCode) const +int FestivalIntConf::voiceCodeToListIndex(const TQString& voiceCode) const { const int voiceListCount = m_voiceList.count(); for(int index = 0; index < voiceListCount; ++index){ @@ -137,18 +137,18 @@ int FestivalIntConf::voiceCodeToListIndex(const QString& voiceCode) const return -1; } -void FestivalIntConf::load(KConfig *config, const QString &configGroup){ +void FestivalIntConf::load(KConfig *config, const TQString &configGroup){ //kdDebug() << "FestivalIntConf::load: Running" << endl; config->setGroup("FestivalInt"); - QString exePath = config->readEntry("FestivalExecutablePath", "festival"); - QString exeLocation = getLocation(exePath); + TQString exePath = config->readEntry("FestivalExecutablePath", "festival"); + TQString exeLocation = getLocation(exePath); if (!exeLocation.isEmpty()) exePath = exeLocation; exePath = realFilePath(exePath); config->setGroup(configGroup); m_widget->festivalPath->setURL(config->readEntry("FestivalExecutablePath", exePath)); m_widget->preloadCheckBox->setChecked(false); scanVoices(); - QString voiceSelected(config->readEntry("Voice")); + TQString voiceSelected(config->readEntry("Voice")); int index = voiceCodeToListIndex(voiceSelected); if (index >= 0) { @@ -163,14 +163,14 @@ void FestivalIntConf::load(KConfig *config, const QString &configGroup){ m_languageCode = config->readEntry("LanguageCode", m_languageCode); m_supportsSSML = static_cast( config->readNumEntry("SupportsSSML", FestivalIntProc::ssUnknown)); - QString codecName = PlugInProc::codecIndexToCodecName( + TQString codecName = PlugInProc::codecIndexToCodecName( m_widget->characterCodingBox->currentItem(), m_codecList); codecName = config->readEntry("Codec", codecName); int codecNdx = PlugInProc::codecNameToListIndex(codecName, m_codecList); m_widget->characterCodingBox->setCurrentItem(codecNdx); } -void FestivalIntConf::save(KConfig *config, const QString &configGroup){ +void FestivalIntConf::save(KConfig *config, const TQString &configGroup){ // kdDebug() << "FestivalIntConf::save: Running" << endl; config->setGroup("FestivalInt"); config->writeEntry("FestivalExecutablePath", realFilePath(m_widget->festivalPath->url())); @@ -202,30 +202,30 @@ void FestivalIntConf::defaults(){ scanVoices(); } -void FestivalIntConf::setDesiredLanguage(const QString &lang) +void FestivalIntConf::setDesiredLanguage(const TQString &lang) { // kdDebug() << "FestivalIntConf::setDesiredLanguage: Running" << endl; m_languageCode = splitLanguageCode(lang, m_countryCode); } -QString FestivalIntConf::getTalkerCode() +TQString FestivalIntConf::getTalkerCode() { - if (!m_widget->selectVoiceCombo->isEnabled()) return QString::null; - QString exePath = realFilePath(m_widget->festivalPath->url()); - if (exePath.isEmpty()) return QString::null; - if (getLocation(exePath).isEmpty()) return QString::null; - if (m_voiceList.count() == 0) return QString::null; - QString normalTalkerCode; + if (!m_widget->selectVoiceCombo->isEnabled()) return TQString::null; + TQString exePath = realFilePath(m_widget->festivalPath->url()); + if (exePath.isEmpty()) return TQString::null; + if (getLocation(exePath).isEmpty()) return TQString::null; + if (m_voiceList.count() == 0) return TQString::null; + TQString normalTalkerCode; voiceStruct voiceTemp = m_voiceList[m_widget->selectVoiceCombo->currentItem()]; // Determine volume attribute. soft < 75% <= medium <= 125% < loud. - QString volume = "medium"; + TQString volume = "medium"; if (m_widget->volumeBox->value() < 75) volume = "soft"; if (m_widget->volumeBox->value() > 125) volume = "loud"; // Determine rate attribute. slow < 75% <= medium <= 125% < fast. - QString rate = "medium"; + TQString rate = "medium"; if (m_widget->timeBox->value() < 75) rate = "slow"; if (m_widget->timeBox->value() > 125) rate = "fast"; - normalTalkerCode = QString( + normalTalkerCode = TQString( "" "" "") @@ -251,14 +251,14 @@ void FestivalIntConf::setDefaultVoice(int currentVoiceIndex) { bool found = false; // First search for a match on both language code and country code. - QString languageCode = m_languageCode; + TQString languageCode = m_languageCode; if (!m_countryCode.isNull()) languageCode += "_" + m_countryCode; // kdDebug() << "FestivalIntConf::setDefaultVoice:: looking for default voice to match language code " << languageCode << endl; uint index = 0; // Prefer existing voice if it matches. if (currentVoiceIndex >= 0) { - QString vlCode = m_voiceList[currentVoiceIndex].languageCode.left(languageCode.length()); + TQString vlCode = m_voiceList[currentVoiceIndex].languageCode.left(languageCode.length()); if (languageCode == vlCode) { found = true; @@ -269,7 +269,7 @@ void FestivalIntConf::setDefaultVoice(int currentVoiceIndex) { for(index = 0 ; index < m_voiceList.count(); ++index) { - QString vlCode = m_voiceList[index].languageCode.left(languageCode.length()); + TQString vlCode = m_voiceList[index].languageCode.left(languageCode.length()); // kdDebug() << "FestivalIntConf::setDefaultVoice: testing " << vlCode << endl; if(languageCode == vlCode) { @@ -285,7 +285,7 @@ void FestivalIntConf::setDefaultVoice(int currentVoiceIndex) // Prefer existing voice if it matches. if (currentVoiceIndex >= 0) { - QString vlCode = m_voiceList[currentVoiceIndex].languageCode.left(languageCode.length()); + TQString vlCode = m_voiceList[currentVoiceIndex].languageCode.left(languageCode.length()); if (languageCode == vlCode) { found = true; @@ -296,7 +296,7 @@ void FestivalIntConf::setDefaultVoice(int currentVoiceIndex) { for(index = 0 ; index < m_voiceList.count(); ++index) { - QString vlCode = m_voiceList[index].languageCode.left(languageCode.length()); + TQString vlCode = m_voiceList[index].languageCode.left(languageCode.length()); // kdDebug() << "FestivalIntConf::setDefaultVoice: testing " << vlCode << endl; if(languageCode == vlCode) { @@ -323,7 +323,7 @@ void FestivalIntConf::setDefaultVoice(int currentVoiceIndex) // kdDebug() << "FestivalIntConf::setDefaultVoice: auto picking voice code " << m_voiceList[index].code << endl; m_widget->selectVoiceCombo->setCurrentItem(index); m_widget->preloadCheckBox->setChecked(m_voiceList[index].preload); - QString codecName = m_voiceList[index].codecName; + TQString codecName = m_voiceList[index].codecName; int codecNdx = PlugInProc::codecNameToListIndex(codecName, m_codecList); m_widget->characterCodingBox->setCurrentItem(codecNdx); if (m_voiceList[index].volumeAdjustable) @@ -371,9 +371,9 @@ void FestivalIntConf::setDefaultVoice(int currentVoiceIndex) * Given an XML node and child element name, returns the string value from the child element. * If no such child element, returns def. */ -QString FestivalIntConf::readXmlString(QDomNode &node, const QString &elementName, const QString &def) +TQString FestivalIntConf::readXmlString(TQDomNode &node, const TQString &elementName, const TQString &def) { - QDomNode childNode = node.namedItem(elementName); + TQDomNode childNode = node.namedItem(elementName); if (!childNode.isNull()) return childNode.toElement().text(); else @@ -384,9 +384,9 @@ QString FestivalIntConf::readXmlString(QDomNode &node, const QString &elementNam * Given an XML node and child element name, returns the boolean value from the child element. * If no such child element, returns def. */ -bool FestivalIntConf::readXmlBool(QDomNode &node, const QString &elementName, bool def) +bool FestivalIntConf::readXmlBool(TQDomNode &node, const TQString &elementName, bool def) { - QDomNode childNode = node.namedItem(elementName); + TQDomNode childNode = node.namedItem(elementName); if (!childNode.isNull()) return (childNode.toElement().text() == "true"); else @@ -397,7 +397,7 @@ void FestivalIntConf::scanVoices() { // kdDebug() << "FestivalIntConf::scanVoices: Running" << endl; // Get existing voice code (if any). - QString currentVoiceCode; + TQString currentVoiceCode; int index = m_widget->selectVoiceCombo->currentItem(); if (index < (int)m_voiceList.count()) currentVoiceCode = m_voiceList[index].code; @@ -413,7 +413,7 @@ void FestivalIntConf::scanVoices() // m_supportedVoiceCodes.clear(); m_widget->selectVoiceCombo->clear(); - QString exePath = realFilePath(m_widget->festivalPath->url()); + TQString exePath = realFilePath(m_widget->festivalPath->url()); if (!getLocation(exePath).isEmpty()) { // Set up a progress dialog. @@ -430,10 +430,10 @@ void FestivalIntConf::scanVoices() else { m_festProc = new FestivalIntProc(); - connect (m_festProc, SIGNAL(stopped()), this, SLOT(slotSynthStopped())); + connect (m_festProc, TQT_SIGNAL(stopped()), this, TQT_SLOT(slotSynthStopped())); } - connect (m_festProc, SIGNAL(queryVoicesFinished(const QStringList&)), - this, SLOT(slotQueryVoicesFinished(const QStringList&))); + connect (m_festProc, TQT_SIGNAL(queryVoicesFinished(const TQStringList&)), + this, TQT_SLOT(slotQueryVoicesFinished(const TQStringList&))); m_festProc->queryVoices(exePath); // Display progress dialog modally. @@ -444,8 +444,8 @@ void FestivalIntConf::scanVoices() // Festival responds with the list. When Festival responds with list, // the progress dialog is closed. - disconnect (m_festProc, SIGNAL(queryVoicesFinished(const QStringList&)), - this, SLOT(slotQueryVoicesFinished(const QStringList&))); + disconnect (m_festProc, TQT_SIGNAL(queryVoicesFinished(const TQStringList&)), + this, TQT_SLOT(slotQueryVoicesFinished(const TQStringList&))); if (!m_progressDlg->wasCancelled()) m_festProc->stopText(); delete m_progressDlg; m_progressDlg = 0; @@ -455,37 +455,37 @@ void FestivalIntConf::scanVoices() if (!m_supportedVoiceCodes.isEmpty()) { // User's desktop language setting. - QString desktopLanguageCode = KGlobal::locale()->language(); - QString twoAlpha; - QString countryCode; - QString charSet; + TQString desktopLanguageCode = KGlobal::locale()->language(); + TQString twoAlpha; + TQString countryCode; + TQString charSet; KGlobal::locale()->splitLocale(desktopLanguageCode, twoAlpha, countryCode, charSet); desktopLanguageCode = twoAlpha.lower(); // Festival known voices list. - QString voicesFilename = KGlobal::dirs()->resourceDirs("data").last() + "/kttsd/festivalint/voices"; - QDomDocument voicesDoc("Festival Voices"); - QFile voicesFile(voicesFilename); + TQString voicesFilename = KGlobal::dirs()->resourceDirs("data").last() + "/kttsd/festivalint/voices"; + TQDomDocument voicesDoc("Festival Voices"); + TQFile voicesFile(voicesFilename); if (voicesFile.open(IO_ReadOnly)) voicesDoc.setContent(&voicesFile); voicesFile.close(); - QDomNodeList voices = voicesDoc.elementsByTagName("voice"); + TQDomNodeList voices = voicesDoc.elementsByTagName("voice"); uint voicesCount = voices.count(); if (voicesCount == 0) kdDebug() << "FestivalIntConf::scanVoices: Unable to open " << voicesFilename << ". Is KDEDIR defined?" << endl; // Iterate thru list of voice codes returned by Festival, // find matching entry in voices.xml file, and add to list of supported voices. - QPixmap maleIcon = KGlobal::iconLoader()->loadIcon("male", KIcon::Small); - QPixmap femaleIcon = KGlobal::iconLoader()->loadIcon("female", KIcon::Small); - QStringList::ConstIterator itEnd = m_supportedVoiceCodes.constEnd(); - for(QStringList::ConstIterator it = m_supportedVoiceCodes.begin(); it != itEnd; ++it ) + TQPixmap maleIcon = KGlobal::iconLoader()->loadIcon("male", KIcon::Small); + TQPixmap femaleIcon = KGlobal::iconLoader()->loadIcon("female", KIcon::Small); + TQStringList::ConstIterator itEnd = m_supportedVoiceCodes.constEnd(); + for(TQStringList::ConstIterator it = m_supportedVoiceCodes.begin(); it != itEnd; ++it ) { - QString code = *it; + TQString code = *it; bool found = false; for (uint index=0; index < voicesCount; ++index) { - QDomNode voiceNode = voices.item(index); - QString voiceCode = readXmlString(voiceNode, "code", QString::null); + TQDomNode voiceNode = voices.item(index); + TQString voiceCode = readXmlString(voiceNode, "code", TQString::null); // kdDebug() << "FestivalIntConf::scanVoices: Comparing code " << code << " to " << voiceCode << endl; if (voiceCode == code) { @@ -502,7 +502,7 @@ void FestivalIntConf::scanVoices() voiceTemp.rateAdjustable = readXmlBool(voiceNode, "rate-adjustable", true); voiceTemp.pitchAdjustable = readXmlBool(voiceNode, "pitch-adjustable", true); m_voiceList.append(voiceTemp); - QString voiceDisplayName = voiceTemp.name + " (" + voiceTemp.code + ")"; + TQString voiceDisplayName = voiceTemp.name + " (" + voiceTemp.code + ")"; if (voiceTemp.gender == "male") m_widget->selectVoiceCombo->insertItem(maleIcon, voiceDisplayName); else if (voiceTemp.gender == "female") @@ -536,7 +536,7 @@ void FestivalIntConf::scanVoices() if (selectVoiceComboEnabled != m_widget->selectVoiceCombo->isEnabled()) configChanged(); } -void FestivalIntConf::slotQueryVoicesFinished(const QStringList &voiceCodes) +void FestivalIntConf::slotQueryVoicesFinished(const TQStringList &voiceCodes) { // kdDebug() << "FestivalIntConf::slotQueryVoicesFinished: voiceCodes.count() = " << voiceCodes.count() << endl; m_supportedVoiceCodes = voiceCodes; @@ -552,24 +552,24 @@ void FestivalIntConf::slotTest_clicked() else { m_festProc = new FestivalIntProc(); - connect (m_festProc, SIGNAL(stopped()), this, SLOT(slotSynthStopped())); + connect (m_festProc, TQT_SIGNAL(stopped()), this, TQT_SLOT(slotSynthStopped())); } // Create a temp file name for the wave file. KTempFile tempFile (locateLocal("tmp", "festivalintplugin-"), ".wav"); - QString tmpWaveFile = tempFile.file()->name(); + TQString tmpWaveFile = tempFile.file()->name(); tempFile.close(); // Get the code for the selected voice. - QString voiceCode = m_voiceList[m_widget->selectVoiceCombo->currentItem()].code; + TQString voiceCode = m_voiceList[m_widget->selectVoiceCombo->currentItem()].code; // Get language code for the selected voice. - QString languageCode = m_voiceList[m_widget->selectVoiceCombo->currentItem()].languageCode; + TQString languageCode = m_voiceList[m_widget->selectVoiceCombo->currentItem()].languageCode; // Get test message in the language of the voice. - QString testMsg = testMessage(languageCode); + TQString testMsg = testMessage(languageCode); // Get codec. - QTextCodec* codec = PlugInProc::codecIndexToCodec( + TQTextCodec* codec = PlugInProc::codecIndexToCodec( m_widget->characterCodingBox->currentItem(), m_codecList); // Tell user to wait. @@ -581,7 +581,7 @@ void FestivalIntConf::slotTest_clicked() m_progressDlg->setAllowCancel(true); // kdDebug() << "FestivalIntConf::slotTest_clicked: calling synth with voiceCode: " << voiceCode << " time percent: " << m_widget->timeBox->value() << endl; - connect (m_festProc, SIGNAL(synthFinished()), this, SLOT(slotSynthFinished())); + connect (m_festProc, TQT_SIGNAL(synthFinished()), this, TQT_SLOT(slotSynthFinished())); m_festProc->synth( realFilePath(m_widget->festivalPath->url()), testMsg, @@ -596,7 +596,7 @@ void FestivalIntConf::slotTest_clicked() // Display progress dialog modally. Processing continues when plugin signals synthFinished, // or if user clicks Cancel button. m_progressDlg->exec(); - disconnect (m_festProc, SIGNAL(synthFinished()), this, SLOT(slotSynthFinished())); + disconnect (m_festProc, TQT_SIGNAL(synthFinished()), this, TQT_SLOT(slotSynthFinished())); if (m_progressDlg->wasCancelled()) m_festProc->stopText(); delete m_progressDlg; m_progressDlg = 0; @@ -620,22 +620,22 @@ void FestivalIntConf::slotSynthFinished() // Play the wave file (possibly adjusting its Speed). // Player object deletes the wave file when done. if (m_player) m_player->play(m_waveFile); - QFile::remove(m_waveFile); - m_waveFile = QString::null; + TQFile::remove(m_waveFile); + m_waveFile = TQString::null; if (m_progressDlg) m_progressDlg->close(); } void FestivalIntConf::slotSynthStopped() { // Clean up after canceling test. - QString filename = m_festProc->getFilename(); + TQString filename = m_festProc->getFilename(); // kdDebug() << "FestivalIntConf::slotSynthStopped: filename = " << filename << endl; - if (!filename.isNull()) QFile::remove(filename); + if (!filename.isNull()) TQFile::remove(filename); } void FestivalIntConf::slotFestivalPath_textChanged() { - QString exePath = realFilePath(m_widget->festivalPath->url()); + TQString exePath = realFilePath(m_widget->festivalPath->url()); m_widget->selectVoiceCombo->setEnabled(false); if (!exePath.isEmpty() && !getLocation(exePath).isEmpty()) { @@ -646,7 +646,7 @@ void FestivalIntConf::slotFestivalPath_textChanged() void FestivalIntConf::slotSelectVoiceCombo_activated() { int index = m_widget->selectVoiceCombo->currentItem(); - QString codecName = m_voiceList[index].codecName; + TQString codecName = m_voiceList[index].codecName; int codecNdx = PlugInProc::codecNameToListIndex(codecName, m_codecList); m_widget->characterCodingBox->setCurrentItem(codecNdx); m_widget->preloadCheckBox->setChecked( diff --git a/kttsd/plugins/festivalint/festivalintconf.h b/kttsd/plugins/festivalint/festivalintconf.h index a367682..6a33009 100644 --- a/kttsd/plugins/festivalint/festivalintconf.h +++ b/kttsd/plugins/festivalint/festivalintconf.h @@ -25,8 +25,8 @@ #define _FESTIVALINTCONF_H_ // Qt includes. -#include -#include +#include +#include // KDE includes. #include @@ -43,11 +43,11 @@ class KProgressDialog; class QDomNode; typedef struct voiceStruct{ - QString code; // Code as sent to Festival - QString name; // Name as displayed and returned in Talker Code. - QString languageCode; // Language code (en, es, etc) - QString codecName; // Character encoding codec name (eg. ISO 8859-1) - QString gender; // male, female, or neutral + TQString code; // Code as sent to Festival + TQString name; // Name as displayed and returned in Talker Code. + TQString languageCode; // Language code (en, es, etc) + TQString codecName; // Character encoding codec name (eg. ISO 8859-1) + TQString gender; // male, female, or neutral bool preload; // Start Festival and load this language when KTTSD is started. bool volumeAdjustable; // True if the voice supports volume adjustments. bool rateAdjustable; // True if the voice supports rate adjustments. @@ -59,7 +59,7 @@ class FestivalIntConf : public PlugInConf { public: /** Constructor */ - FestivalIntConf( QWidget* parent = 0, const char* name = 0, const QStringList &args = QStringList()); + FestivalIntConf( TQWidget* parent = 0, const char* name = 0, const TQStringList &args = TQStringList()); /** Destructor */ ~FestivalIntConf(); @@ -71,14 +71,14 @@ class FestivalIntConf : public PlugInConf { * valid settings. NOTE that this is not called after the modules is loaded, * so you probably want to call this method in the constructor. */ - void load(KConfig *config, const QString &configGroup); + void load(KConfig *config, const TQString &configGroup); /** This function gets called when the user wants to save the settings in * the user interface, updating the config files or wherever the * configuration is stored. The method is called when the user clicks "Apply" * or "Ok". */ - void save(KConfig *config, const QString &configGroup); + void save(KConfig *config, const TQString &configGroup); /** This function is called to set the settings in the module to sensible * default values. It gets called when hitting the "Default" button. The @@ -90,7 +90,7 @@ class FestivalIntConf : public PlugInConf { * This function informs the plugin of the desired language to be spoken * by the plugin. The plugin should attempt to adapt itself to the * specified language code, choosing sensible defaults if necessary. - * If the passed-in code is QString::null, no specific language has + * If the passed-in code is TQString::null, no specific language has * been chosen. * @param lang The desired language code or Null if none. * @@ -102,16 +102,16 @@ class FestivalIntConf : public PlugInConf { * not the given country, treat it as though the country * code were not specified, i.e., adapt to the given language. */ - void setDesiredLanguage(const QString &lang); + void setDesiredLanguage(const TQString &lang); /** * Return fully-specified talker code for the configured plugin. This code * uniquely identifies the configured instance of the plugin and distinquishes * one instance from another. If the plugin has not been fully configured, - * i.e., cannot yet synthesize, return QString::null. + * i.e., cannot yet synthesize, return TQString::null. * @return Fully-specified talker code. */ - QString getTalkerCode(); + TQString getTalkerCode(); private slots: /** Scan for the different voices in festivalPath/lib */ @@ -131,7 +131,7 @@ class FestivalIntConf : public PlugInConf { void frequencySlider_valueChanged(int sliderValue); void slotFestivalPath_textChanged(); void slotSelectVoiceCombo_activated(); - void slotQueryVoicesFinished(const QStringList &voiceCodes); + void slotQueryVoicesFinished(const TQStringList &voiceCodes); private: int percentToSlider(int percentValue); @@ -141,19 +141,19 @@ class FestivalIntConf : public PlugInConf { * Given an XML node and child element name, returns the string value from the child element. * If no such child element, returns def. */ - QString readXmlString(QDomNode &node, const QString &elementName, const QString &def); + TQString readXmlString(TQDomNode &node, const TQString &elementName, const TQString &def); /** * Given an XML node and child element name, returns the boolean value from the child element. * If no such child element, returns def. */ - bool readXmlBool(QDomNode &node, const QString &elementName, bool def); + bool readXmlBool(TQDomNode &node, const TQString &elementName, bool def); /** * Given a voice code, returns index into m_voiceList array (and voiceCombo box). * -1 if not found. */ - int voiceCodeToListIndex(const QString& voiceCode) const; + int voiceCodeToListIndex(const TQString& voiceCode) const; /** * Chooses a default voice given scanned list of voices in m_voiceList and current @@ -166,21 +166,21 @@ class FestivalIntConf : public PlugInConf { FestivalIntConfWidget* m_widget; // Language code. - QString m_languageCode; + TQString m_languageCode; // Language country code (if any). - QString m_countryCode; + TQString m_countryCode; // List of voices */ - QValueList m_voiceList; + TQValueList m_voiceList; // Festival synthesizer. FestivalIntProc* m_festProc; // Synthesized wave file name. - QString m_waveFile; + TQString m_waveFile; // Progress dialog. KProgressDialog* m_progressDlg; // List of voice codes supported by Festival. - QStringList m_supportedVoiceCodes; + TQStringList m_supportedVoiceCodes; // List of displayed codec names. - QStringList m_codecList; + TQStringList m_codecList; // Whether Festival supports SSML or not. FestivalIntProc::SupportsSSML m_supportsSSML; }; diff --git a/kttsd/plugins/festivalint/festivalintproc.cpp b/kttsd/plugins/festivalint/festivalintproc.cpp index 77822ea..e48f2c4 100644 --- a/kttsd/plugins/festivalint/festivalintproc.cpp +++ b/kttsd/plugins/festivalint/festivalintproc.cpp @@ -25,10 +25,10 @@ #include // Qt includes. -#include -#include -#include -#include +#include +#include +#include +#include // KDE includes. #include @@ -43,7 +43,7 @@ #include "festivalintproc.moc" /** Constructor */ -FestivalIntProc::FestivalIntProc( QObject* parent, const char* name, const QStringList& ) : +FestivalIntProc::FestivalIntProc( TQObject* parent, const char* name, const TQStringList& ) : PlugInProc( parent, name ){ // kdDebug() << "FestivalIntProc::FestivalIntProc: Running" << endl; m_ready = true; @@ -54,7 +54,7 @@ FestivalIntProc::FestivalIntProc( QObject* parent, const char* name, const QStri m_state = psIdle; m_supportsSSML = ssUnknown; m_languageCode = "en"; - m_codec = QTextCodec::codecForName("ISO8859-1"); + m_codec = TQTextCodec::codecForName("ISO8859-1"); } /** Destructor */ @@ -84,7 +84,7 @@ FestivalIntProc::~FestivalIntProc(){ } /** Initialize the speech */ -bool FestivalIntProc::init(KConfig *config, const QString &configGroup) +bool FestivalIntProc::init(KConfig *config, const TQString &configGroup) { // kdDebug() << "FestivalIntProc::init: Initializing plug in: Festival" << endl; @@ -99,7 +99,7 @@ bool FestivalIntProc::init(KConfig *config, const QString &configGroup) m_preload = config->readBoolEntry("Preload", false); m_languageCode = config->readEntry("LanguageCode", "en"); m_supportsSSML = static_cast(config->readNumEntry("SupportsSSML", ssUnknown)); - QString codecName = config->readEntry("Codec", "Latin1"); + TQString codecName = config->readEntry("Codec", "Latin1"); m_codec = codecNameToCodec(codecName); if (m_preload) startEngine(m_festivalExePath, m_voiceCode, m_languageCode, m_codec); return true; @@ -111,9 +111,9 @@ bool FestivalIntProc::init(KConfig *config, const QString &configGroup) * * If the plugin supports asynchronous operation, it should return immediately. */ -void FestivalIntProc::sayText(const QString &text) +void FestivalIntProc::sayText(const TQString &text) { - synth(m_festivalExePath, text, QString::null, m_voiceCode, m_time, m_pitch, m_volume, + synth(m_festivalExePath, text, TQString::null, m_voiceCode, m_time, m_pitch, m_volume, m_languageCode, m_codec); } @@ -127,7 +127,7 @@ void FestivalIntProc::sayText(const QString &text) * * If the plugin supports asynchronous operation, it should return immediately. */ -void FestivalIntProc::synthText(const QString& text, const QString& suggestedFilename) +void FestivalIntProc::synthText(const TQString& text, const TQString& suggestedFilename) { synth(m_festivalExePath, text, suggestedFilename, m_voiceCode, m_time, m_pitch, m_volume, m_languageCode, m_codec); @@ -139,12 +139,12 @@ void FestivalIntProc::synthText(const QString& text, const QString& suggestedFil * @return False if busy doing something else and therefore cannot * do the query. */ -bool FestivalIntProc::queryVoices(const QString &festivalExePath) +bool FestivalIntProc::queryVoices(const TQString &festivalExePath) { // kdDebug() << "FestivalIntProc::queryVoices: Running" << endl; if (m_state != psIdle && m_waitingQueryVoices && m_waitingStop) return false; // Start Festival if not already running. - startEngine(festivalExePath, QString::null, m_languageCode, m_codec); + startEngine(festivalExePath, TQString::null, m_languageCode, m_codec); // Set state, waiting for voice codes list from Festival. m_waitingQueryVoices = true; // Voice rab_diphone is needed in order to support SSML. @@ -160,8 +160,8 @@ bool FestivalIntProc::queryVoices(const QString &festivalExePath) * @param voiceCode Voice code in which to speak text. * @param languageCode Language code, for example, "en". */ -void FestivalIntProc::startEngine(const QString &festivalExePath, const QString &voiceCode, - const QString &languageCode, QTextCodec* codec) +void FestivalIntProc::startEngine(const TQString &festivalExePath, const TQString &voiceCode, + const TQString &languageCode, TQTextCodec* codec) { // Initialize Festival only if it's not initialized. if (m_festProc) @@ -184,19 +184,19 @@ void FestivalIntProc::startEngine(const QString &festivalExePath, const QString m_festProc->setEnvironment("LANG", languageCode + "." + codec->mimeName()); m_festProc->setEnvironment("LC_CTYPE", languageCode + "." + codec->mimeName()); // kdDebug() << "FestivalIntProc::startEngine: setting LANG = LC_CTYPE = " << languageCode << "." << codec->mimeName() << endl; - connect(m_festProc, SIGNAL(processExited(KProcess*)), - this, SLOT(slotProcessExited(KProcess*))); - connect(m_festProc, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(slotReceivedStdout(KProcess*, char*, int))); - connect(m_festProc, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedStderr(KProcess*, char*, int))); - connect(m_festProc, SIGNAL(wroteStdin(KProcess*)), - this, SLOT(slotWroteStdin(KProcess*))); + connect(m_festProc, TQT_SIGNAL(processExited(KProcess*)), + this, TQT_SLOT(slotProcessExited(KProcess*))); + connect(m_festProc, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedStdout(KProcess*, char*, int))); + connect(m_festProc, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedStderr(KProcess*, char*, int))); + connect(m_festProc, TQT_SIGNAL(wroteStdin(KProcess*)), + this, TQT_SLOT(slotWroteStdin(KProcess*))); } if (!m_festProc->isRunning()) { // kdDebug() << "FestivalIntProc::startEngine: Starting Festival process" << endl; - m_runningVoiceCode = QString::null; + m_runningVoiceCode = TQString::null; m_runningTime = 100; m_runningPitch = 100; m_ready = false; @@ -239,15 +239,15 @@ void FestivalIntProc::startEngine(const QString &festivalExePath, const QString * @param languageCode Language code, for example, "en". */ void FestivalIntProc::synth( - const QString &festivalExePath, - const QString &text, - const QString &synthFilename, - const QString &voiceCode, + const TQString &festivalExePath, + const TQString &text, + const TQString &synthFilename, + const TQString &voiceCode, int time, int pitch, int volume, - const QString &languageCode, - QTextCodec* codec) + const TQString &languageCode, + TQTextCodec* codec) { // kdDebug() << "FestivalIntProc::synth: festivalExePath = " << festivalExePath // << " voiceCode = " << voiceCode << endl; @@ -256,7 +256,7 @@ void FestivalIntProc::synth( startEngine(festivalExePath, voiceCode, languageCode, codec); // If we just started Festival, or rate changed, tell festival. if (m_runningTime != time) { - QString timeMsg; + TQString timeMsg; if (voiceCode.contains("_hts") > 0) { // Map 50% to 200% onto 0 to 1000. @@ -268,11 +268,11 @@ void FestivalIntProc::synth( slider = slider - 500; // Map -500 to 500 onto 0.15 to -0.15. float stretchValue = -float(slider) * 0.15 / 500.0; - timeMsg = QString("(set! hts_duration_stretch %1)").arg( + timeMsg = TQString("(set! hts_duration_stretch %1)").arg( stretchValue, 0, 'f', 3); } else - timeMsg = QString("(Parameter.set 'Duration_Stretch %1)").arg( + timeMsg = TQString("(Parameter.set 'Duration_Stretch %1)").arg( 1.0/(float(time)/100.0), 0, 'f', 2); sendToFestival(timeMsg); m_runningTime = time; @@ -290,14 +290,14 @@ void FestivalIntProc::synth( { pitchValue = (((pitch - 100) * 395) / 100) + 105; } - QString pitchMsg = QString( + TQString pitchMsg = TQString( "(set! int_lr_params '((target_f0_mean %1) (target_f0_std 14)" "(model_f0_mean 170) (model_f0_std 34)))").arg(pitchValue, 0, 10); sendToFestival(pitchMsg); m_runningPitch = pitch; } - QString saidText = text; + TQString saidText = text; // Split really long sentences into shorter sentences, by looking for commas and converting // to periods. @@ -307,7 +307,7 @@ void FestivalIntProc::synth( len = saidText.findRev(", ", len - (c_tooLong * 2 / 3), true); if (len != -1) { - QString c = saidText.mid(len+2, 1); + TQString c = saidText.mid(len+2, 1); if (c != c.upper()) { saidText.replace(len, 2, ". "); @@ -329,7 +329,7 @@ void FestivalIntProc::synth( if (synthFilename.isNull()) { m_state = psSaying; - m_synthFilename = QString::null; + m_synthFilename = TQString::null; // kdDebug() << "FestivalIntProc::synth: Saying text: '" << saidText << "' using Festival plug in with voice " // << voiceCode << endl; saidText = "(SayText \"" + saidText + "\")"; @@ -351,7 +351,7 @@ void FestivalIntProc::synth( saidText = "(ktts_sabletowave \"" + saidText + "\" \"" + synthFilename + "\" " + - QString::number(volumeValue) + ")"; + TQString::number(volumeValue) + ")"; } else { @@ -362,7 +362,7 @@ void FestivalIntProc::synth( // Synth the text and adjust volume. "(set! utt1 (Utterance Text \"" + saidText + "\"))(utt.synth utt1)" + - "(utt.wave.rescale utt1 " + QString::number(volumeValue) + " t)" + + "(utt.wave.rescale utt1 " + TQString::number(volumeValue) + " t)" + "(utt.save.wave utt1 \"" + synthFilename + "\")"; } sendToFestival(saidText); @@ -374,7 +374,7 @@ void FestivalIntProc::synth( * puts it in the queue. * @param text Text to send or queue. */ -void FestivalIntProc::sendToFestival(const QString& text) +void FestivalIntProc::sendToFestival(const TQString& text) { if (text.isNull()) return; m_outputQueue.append(text); @@ -395,9 +395,9 @@ bool FestivalIntProc::sendIfReady() if (m_writingStdin) return true; if (m_outputQueue.isEmpty()) return false; if (!m_festProc->isRunning()) return false; - QString text = m_outputQueue[0]; + TQString text = m_outputQueue[0]; text += "\n"; - QCString encodedText; + TQCString encodedText; if (m_codec) encodedText = m_codec->fromUnicode(text); else @@ -414,7 +414,7 @@ bool FestivalIntProc::sendIfReady() * Determine if the text has SABLE tags. If so, we will have to use a different * synthesis method. */ -bool FestivalIntProc::isSable(const QString &text) +bool FestivalIntProc::isSable(const TQString &text) { return KttsUtils::hasRootElement( text, "SABLE" ); } @@ -426,7 +426,7 @@ bool FestivalIntProc::isSable(const QString &text) * * The plugin must not re-use the filename. */ -QString FestivalIntProc::getFilename() { return m_synthFilename; } +TQString FestivalIntProc::getFilename() { return m_synthFilename; } /** * Stop text @@ -500,11 +500,11 @@ void FestivalIntProc::slotProcessExited(KProcess*) void FestivalIntProc::slotReceivedStdout(KProcess*, char* buffer, int buflen) { - QString buf = QString::fromLatin1(buffer, buflen); + TQString buf = TQString::fromLatin1(buffer, buflen); // kdDebug() << "FestivalIntProc::slotReceivedStdout: Received from Festival: " << buf << endl; bool promptSeen = (buf.contains("festival>") > 0); bool emitQueryVoicesFinished = false; - QStringList voiceCodesList; + TQStringList voiceCodesList; if (m_waitingQueryVoices && m_outputQueue.isEmpty()) { // Look for opening ( and closing ). @@ -522,7 +522,7 @@ void FestivalIntProc::slotReceivedStdout(KProcess*, char* buffer, int buflen) // Extract contents between parens. buf = buf.mid(1, rightParen - 1); // Space separated list. - voiceCodesList = QStringList::split(" ", buf, false); + voiceCodesList = TQStringList::split(" ", buf, false); emitQueryVoicesFinished = true; } } @@ -569,7 +569,7 @@ void FestivalIntProc::slotReceivedStdout(KProcess*, char* buffer, int buflen) void FestivalIntProc::slotReceivedStderr(KProcess*, char* buffer, int buflen) { - QString buf = QString::fromLatin1(buffer, buflen); + TQString buf = TQString::fromLatin1(buffer, buflen); kdDebug() << "FestivalIntProc::slotReceivedStderr: Received error from Festival: " << buf << endl; } @@ -620,7 +620,7 @@ void FestivalIntProc::ackFinished() if (m_state == psFinished) { m_state = psIdle; - m_synthFilename = QString::null; + m_synthFilename = TQString::null; } } @@ -652,7 +652,7 @@ bool FestivalIntProc::supportsSynth() { return true; } * tags and converts the file to plain text. * @return Name of the XSLT file. */ -QString FestivalIntProc::getSsmlXsltFilename() +TQString FestivalIntProc::getSsmlXsltFilename() { if (m_supportsSSML == ssYes) return KGlobal::dirs()->resourceDirs("data").last() + "kttsd/festivalint/xslt/SSMLtoSable.xsl"; diff --git a/kttsd/plugins/festivalint/festivalintproc.h b/kttsd/plugins/festivalint/festivalintproc.h index a69642c..bae9578 100644 --- a/kttsd/plugins/festivalint/festivalintproc.h +++ b/kttsd/plugins/festivalint/festivalintproc.h @@ -24,8 +24,8 @@ #ifndef _FESTIVALINTPROC_H_ #define _FESTIVALINTPROC_H_ -#include -#include +#include +#include #include @@ -46,7 +46,7 @@ class FestivalIntProc : public PlugInProc{ /** * Constructor */ - FestivalIntProc( QObject* parent = 0, const char* name = 0, const QStringList &args = QStringList()); + FestivalIntProc( TQObject* parent = 0, const char* name = 0, const TQStringList &args = TQStringList()); /** * Destructor @@ -58,7 +58,7 @@ class FestivalIntProc : public PlugInProc{ * @param config Settings object. * @param configGroup Settings group. */ - virtual bool init(KConfig *config, const QString &configGroup); + virtual bool init(KConfig *config, const TQString &configGroup); /** * Returns true when festival is ready to speak a sentence. @@ -69,7 +69,7 @@ class FestivalIntProc : public PlugInProc{ * Say a text string. * @param text The text to speak. */ - virtual void sayText(const QString &text); + virtual void sayText(const TQString &text); /** * Synthesize text into an audio file, but do not send to the audio device. @@ -84,7 +84,7 @@ class FestivalIntProc : public PlugInProc{ * It must also implement the @ref getState method, which must return * psFinished, when synthesis is completed. */ - virtual void synthText(const QString &text, const QString &suggestedFilename); + virtual void synthText(const TQString &text, const TQString &suggestedFilename); /** * Get the generated audio filename from call to @ref synthText. @@ -95,7 +95,7 @@ class FestivalIntProc : public PlugInProc{ * be locked when this method is called. The file will be deleted when * KTTSD is finished using it. */ - virtual QString getFilename(); + virtual TQString getFilename(); /** * Stop current operation (saying or synthesizing text). @@ -171,10 +171,10 @@ class FestivalIntProc : public PlugInProc{ * @param volume Volume percentage. 50 to 200. * @param languageCode Language code, for example, "en". */ - void synth(const QString &festivalExePath, const QString &text, - const QString &synthFilename, const QString& voiceCode, - int time, int pitch, int volume, const QString &languageCode, - QTextCodec* codec); + void synth(const TQString &festivalExePath, const TQString &text, + const TQString &synthFilename, const TQString& voiceCode, + int time, int pitch, int volume, const TQString &languageCode, + TQTextCodec* codec); /** * Sends commands to Festival to query for a list of supported voice codes. @@ -182,7 +182,7 @@ class FestivalIntProc : public PlugInProc{ * @return False if busy doing something else and therefore cannot * do the query. */ - bool queryVoices(const QString &festivalExePath); + bool queryVoices(const TQString &festivalExePath); /** * Returns the name of an XSLT stylesheet that will convert a valid SSML file @@ -193,7 +193,7 @@ class FestivalIntProc : public PlugInProc{ * tags and converts the file to plain text. * @return Name of the XSLT file. */ - QString getSsmlXsltFilename(); + TQString getSsmlXsltFilename(); /** * Whether Festival supports SSML or not. @@ -208,7 +208,7 @@ class FestivalIntProc : public PlugInProc{ * This signal fires upon completion of a queryVoices operation. * The list of voice codes do not have "voice_" prefix. */ - void queryVoicesFinished(const QStringList &voiceCodes); + void queryVoicesFinished(const TQStringList &voiceCodes); private slots: void slotProcessExited(KProcess* proc); @@ -223,15 +223,15 @@ class FestivalIntProc : public PlugInProc{ * @param voiceCode Voice code in which to speak text. * @param languageCode Language code, for example, "en". */ - void startEngine(const QString &festivalExePath, const QString &voiceCode, - const QString &languageCode, QTextCodec* codec); + void startEngine(const TQString &festivalExePath, const TQString &voiceCode, + const TQString &languageCode, TQTextCodec* codec); /** * If ready for more output, sends the given text to Festival process, otherwise, * puts it in the queue. * @param text Text to send or queue. */ - void sendToFestival(const QString& text); + void sendToFestival(const TQString& text); /** * If Festival is ready for more input and there is more output to send, send it. @@ -247,7 +247,7 @@ class FestivalIntProc : public PlugInProc{ * Determine if the text has SABLE tags. If so, we will have to use a different * synthesis method. */ - bool isSable(const QString &text); + bool isSable(const TQString &text); /** * We attempt to shorten sentences longer than this by replacing commas with periods. @@ -257,12 +257,12 @@ class FestivalIntProc : public PlugInProc{ /** * Path to the Festival executable. */ - QString m_festivalExePath; + TQString m_festivalExePath; /** * Selected voice (from config). */ - QString m_voiceCode; + TQString m_voiceCode; /** * True if the voice is preloaded. Also used as a flag to supress killing @@ -288,7 +288,7 @@ class FestivalIntProc : public PlugInProc{ /** * Running voice. */ - QString m_runningVoiceCode; + TQString m_runningVoiceCode; /** * Running time (speed). @@ -308,7 +308,7 @@ class FestivalIntProc : public PlugInProc{ /** * Synthesis filename. */ - QString m_synthFilename; + TQString m_synthFilename; /** * True when festival is ready for another input. @@ -337,19 +337,19 @@ class FestivalIntProc : public PlugInProc{ * sending the next command, this queue allows us to queue up multiple * commands and send each one when the ReceivedStdOut signal fires. */ - QStringList m_outputQueue; + TQStringList m_outputQueue; bool m_writingStdin; /** * Language code. */ - QString m_languageCode; + TQString m_languageCode; /** * Codec. */ - QTextCodec* m_codec; + TQTextCodec* m_codec; /** * Flag if SSML is supported. Festival cannot support SABLE (and therefore SSML) -- cgit v1.2.1