Public Types | |
typedef std::map< std::string, AbstractTextProcessor * > | StringToTextProcMap |
Public Member Functions | |
void | onFamily (Client &client, const std::string lang, const std::string &family) |
Notifies the command to select new voice family was received from client. | |
void | onLetter (Client &client, wchar_t c) |
Notifies the command to say one letter was received from client. | |
void | onParam (Client &client, int paramType, TextParam value) |
Notifies there was a command to set new value of speech parameter. | |
void | onProcMode (Client &client, const std::string &procMode) |
Notifies the command to select another processing mode was received. | |
void | onStop (Client &client) |
Notifies new command to stop playback was received from client. | |
void | onText (Client &client, const std::wstring &t) |
Notifies the command to say text was received from client. | |
void | onTone (Client &client, size_t freq, size_t duration) |
Notifies the new command to produce tone signal was received from client. | |
ProtocolHandler (const OutputSet &outputSet, ExecutorInterface &executorInterface) | |
The constructor. | |
void | reinit (const Configuration &c) |
Initializes all internal structures. | |
virtual | ~ProtocolHandler () |
the destructor |
ProtocolHandler::ProtocolHandler | ( | const OutputSet & | outputSet, | |
ExecutorInterface & | executorInterface | |||
) | [inline] |
[in] | outputSet | The reference to used OutputSet object |
[in] | executorInterface | The reference to used ExecutorInterface object |
void ProtocolHandler::onFamily | ( | Client & | client, | |
const std::string | lang, | |||
const std::string & | family | |||
) | [inline, virtual] |
The protocol implementation class cals this method each time when the command to select new voice family was received from client. The client object this command was received from, the language name to select family for and new voice family name are provided. The language string can be empty and it means new family must be selected for all languages in which it is registered.
[in] | client | The client this command was received from |
[in] | lang | The language name to select family for, can be empty |
[in] | family | The voice family to select |
Implements AbstractProtocolHandler.
void ProtocolHandler::onLetter | ( | Client & | client, | |
wchar_t | c | |||
) | [inline, virtual] |
The protocol implementation calls this method each time when it receives command to say one letter. The client object this command was received from is provided.
[in] | client | The client object this command was received from |
[in] | c | The character to say |
Implements AbstractProtocolHandler.
This method is called by protocol implementation object on every new command to change speech attribute value. Speech attribute can be one of three types: pitch, rate and volume.
[in] | client | The client object this command was received from |
[in] | paramType | The attribute type to change, can be ParamPitch, ParamRate and ParamVolume |
[in] | value | The new value to set |
Implements AbstractProtocolHandler.
void ProtocolHandler::onProcMode | ( | Client & | client, | |
const std::string & | procMode | |||
) | [inline, virtual] |
This method is called by protocol implementation class on each command to select new text processing mode. The client object new command was received from and new mode name are provided.
[in] | client | The client this command was received from |
[in] | procMode | The name of new text processing mode |
Implements AbstractProtocolHandler.
void ProtocolHandler::onStop | ( | Client & | client | ) | [inline, virtual] |
The protocol implementation calls this function when it receives the command to stop any playback. The client object new command was received from is provided.
[in] | client | The client object this command was received from |
Implements AbstractProtocolHandler.
void ProtocolHandler::onText | ( | Client & | client, | |
const std::wstring & | t | |||
) | [inline, virtual] |
The protocol implementation class calls this method on every command to say part of text and provides the client object this command was transmitted from.
[in] | client | The client object the command was received from |
[in] | t | The text to say |
Implements AbstractProtocolHandler.
void ProtocolHandler::onTone | ( | Client & | client, | |
size_t | freq, | |||
size_t | duration | |||
) | [inline, virtual] |
This method is called by protocol implementation object each time when new command to produce tone signal is received from a client. The client object this command was received from is provided.
[in] | client | The client object this command was received from |
[in] | freq | The frequency of tone signal to produce |
[in] | duration | The new signal duration |
Implements AbstractProtocolHandler.
void ProtocolHandler::reinit | ( | const Configuration & | c | ) | [inline] |
This method fills all internal structures with settings from provided configuration data. This method can be called so many times as it required. For example, it is called each time on cerver configuration reloading.
[in] | c | The configuration data to take settings from |