[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdeaccessibility/kttsd/kttsd
From: Gary Cramblitt <garycramblitt () comcast ! net>
Date: 2005-03-12 21:03:37
Message-ID: 20050312210337.AA7A617B90 () office ! kde ! org
[Download RAW message or body]
CVS commit by cramblitt:
Warnings and Messages are now filtered. Previously, only text jobs and notifications \
were filtered. Warnings, Messages, and notifications do not go through SBDs.
M +24 -24 speechdata.cpp 1.38
M +1 -1 speechdata.h 1.21
--- kdeaccessibility/kttsd/kttsd/speechdata.cpp #1.37:1.38
@@ -194,11 +194,16 @@ bool SpeechData::screenReaderOutputReady
void SpeechData::enqueueWarning( const QString &warning, const QString &talker, \
const QCString &appId){
// kdDebug() << "Running: SpeechData::enqueueWarning( const QString &warning )" \
<< endl;
- mlText *temp = new mlText();
- temp->jobNum = 0;
- temp->text = warning;
- temp->talker = talker;
- temp->appId = appId;
- temp->seq = 1;
- warnings.enqueue( temp );
+ mlJob* job = new mlJob();
+ ++jobCounter;
+ if (jobCounter == 0) ++jobCounter; // Overflow is OK, but don't want any 0 \
jobNums. + uint jobNum = jobCounter;
+ job->jobNum = jobNum;
+ job->talker = talker;
+ job->appId = appId;
+ job->seq = 1;
+ warnings.enqueue( job );
+ job->sentences = QStringList();
+ // Do not apply Sentence Boundary Detection filters to warnings.
+ startJobFiltering( job, warning, true );
// uint count = warnings.count();
// kdDebug() << "Adding '" << temp->text << "' with talker '" << temp->talker << \
"' from application " << appId << " to the warnings queue leaving a total of " << \
count << " items." << endl; @@ -213,5 +218,13 @@ void SpeechData::enqueueWarning( \
const Q mlText* SpeechData::dequeueWarning(){
// kdDebug() << "Running: SpeechData::dequeueWarning()" << endl;
- mlText *temp = warnings.dequeue();
+ mlJob* job = warnings.dequeue();
+ waitJobFiltering(job);
+ mlText* temp = new mlText();
+ temp->jobNum = job->jobNum;
+ temp->text = job->sentences.join("");
+ temp->talker = job->talker;
+ temp->appId = job->appId;
+ temp->seq = 1;
+ delete job;
// uint count = warnings.count();
// kdDebug() << "Removing '" << temp->text << "' with talker '" << temp->talker \
<< "' from the warnings queue leaving a total of " << count << " items." << endl; @@ \
-247,22 +260,9 @@ void SpeechData::enqueueMessage( const Q job->seq = 1;
messages.enqueue( job );
- // If message came from knotify, filter it, otherwise, do not filter.
- if (appId.left(7) == "knotify")
- {
job->sentences = QStringList();
// Do not apply Sentence Boundary Detection filters to messages.
startJobFiltering( job, message, true );
- } else
- job->sentences = message;
- /*
- mlText *temp = new mlText();
- temp->text = message;
- temp->talker = talker;
- temp->appId = appId;
- temp->seq = 1;
- messages.enqueue( temp );
// uint count = messages.count();
// kdDebug() << "Adding '" << temp->text << "' with talker '" << temp->talker << \
"' from application " << appId << " to the messages queue leaving a total of " << \
count << " items." << endl;
- */
}
--- kdeaccessibility/kttsd/kttsd/speechdata.h #1.20:1.21
@@ -580,5 +580,5 @@ class SpeechData : public QObject {
* Queue of warnings
*/
- QPtrQueue<mlText> warnings;
+ QPtrQueue<mlJob> warnings;
/**
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic