jovie
#include <filterproc.h>
Public Types | |
enum | FilterState { fsIdle = 0, fsFiltering = 1, fsStopping = 2, fsFinished = 3 } |
Signals | |
void | error (bool keepGoing, const QString &msg) |
void | filteringFinished () |
void | filteringStopped () |
Public Member Functions | |
KttsFilterProc (QObject *parent, const QVariantList &) | |
virtual | ~KttsFilterProc () |
virtual void | ackFinished () |
virtual bool | asyncConvert (const QString &inputText, TalkerCode *talkerCode, const QString &appId) |
virtual QString | convert (const QString &inputText, TalkerCode *talkerCode, const QString &appId) |
virtual QString | getOutput () |
virtual int | getState () |
virtual bool | init (KConfig *config, const QString &configGroup) |
virtual bool | isSBD () |
virtual void | setSbRegExp (const QString &re) |
virtual void | stopFiltering () |
virtual bool | supportsAsync () |
virtual void | waitForFinished () |
virtual bool | wasModified () |
Detailed Description
Definition at line 38 of file filterproc.h.
Member Enumeration Documentation
Enumerator | |
---|---|
fsIdle | |
fsFiltering | |
fsStopping | |
fsFinished |
Definition at line 43 of file filterproc.h.
Constructor & Destructor Documentation
KttsFilterProc::KttsFilterProc | ( | QObject * | parent, |
const QVariantList & | |||
) |
Constructor.
Definition at line 34 of file filterproc.cpp.
|
virtual |
Destructor.
Definition at line 43 of file filterproc.cpp.
Member Function Documentation
|
virtual |
Acknowledges the finished filtering.
Reimplemented in XmlTransformerProc.
Definition at line 131 of file filterproc.cpp.
|
virtual |
Convert input.
Runs asynchronously.
- Parameters
-
inputText Input text. talkerCode TalkerCode structure for the talker that KTTSD intends to use for synthing the text. Useful for extracting hints about how to filter the text. For example, languageCode. appId The DCOP appId of the application that queued the text. Also useful for hints about how to do the filtering.
- Returns
- False if the filter cannot perform the conversion.
When conversion is completed, emits signal filteringFinished. Calling program may then call getOutput to retrieve converted text. Calling program must call ackFinished to acknowledge the conversion.
Reimplemented in XmlTransformerProc.
Definition at line 110 of file filterproc.cpp.
|
virtual |
Convert input, returning output.
Runs synchronously.
- Parameters
-
inputText Input text. talkerCode TalkerCode structure for the talker that KTTSD intends to use for synthing the text. Useful for extracting hints about how to filter the text. For example, languageCode. appId The DCOP appId of the application that queued the text. Also useful for hints about how to do the filtering.
Reimplemented in XmlTransformerProc, TalkerChooserProc, FilterMgr, and StringReplacerProc.
Definition at line 90 of file filterproc.cpp.
|
signal |
If an error occurs, Filter should signal the error and return input as output in convert method.
If Filter should not be called in the future, perhaps because it could not find its configuration file, return False for keepGoing.
- Parameters
-
keepGoing False if the filter should not be called in the future. msg Error message.
|
signal |
Emitted when asynchronous filtering has completed.
|
signal |
Emitted when stopFiltering has been called and filtering has in fact stopped.
|
virtual |
Returns the filtered output.
Reimplemented in XmlTransformerProc.
Definition at line 126 of file filterproc.cpp.
|
virtual |
Returns the state of the Filter.
Reimplemented in XmlTransformerProc.
Definition at line 121 of file filterproc.cpp.
|
virtual |
Initialize the filter.
- Parameters
-
config Settings object. configGroup Settings Group.
- Returns
- False if filter is not ready to filter.
Note: The parameters are for reading from kttsdrc file. Plugins may wish to maintain separate configuration files of their own.
Reimplemented in XmlTransformerProc, StringReplacerProc, and TalkerChooserProc.
Definition at line 57 of file filterproc.cpp.
|
virtual |
Returns True if this filter is a Sentence Boundary Detector.
If so, the filter should implement setSbRegExp() .
- Returns
- True if this filter is a SBD.
Definition at line 67 of file filterproc.cpp.
|
virtual |
Set Sentence Boundary Regular Expression.
This method will only be called if the application overrode the default.
- Parameters
-
re The sentence delimiter regular expression.
Definition at line 151 of file filterproc.cpp.
|
virtual |
Stops filtering.
The filteringStopped signal will emit when filtering has in fact stopped and state returns to fsIdle;
Reimplemented in XmlTransformerProc.
Definition at line 137 of file filterproc.cpp.
|
virtual |
Returns True if the plugin supports asynchronous processing, i.e., supports asyncConvert method.
- Returns
- True if this plugin supports asynchronous processing.
If the plugin returns True, it must also implement getState . It must also emit filteringFinished when filtering is completed. If the plugin returns True, it must also implement stopFiltering . It must also emit filteringStopped when filtering has been stopped.
Reimplemented in XmlTransformerProc, and TalkerChooserProc.
Definition at line 79 of file filterproc.cpp.
|
virtual |
Waits for a previous call to asyncConvert to finish.
Reimplemented in XmlTransformerProc.
Definition at line 116 of file filterproc.cpp.
|
virtual |
Did this filter do anything? If the filter returns the input as output unmolested, it should return False when this method is called.
Reimplemented in XmlTransformerProc, and StringReplacerProc.
Definition at line 143 of file filterproc.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:32:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.