ot::SpeechModule Class Reference
[Device Input Classes]

#include <SpeechModule.h>

Inheritance diagram for ot::SpeechModule:

Inheritance graph
[legend]
Collaboration diagram for ot::SpeechModule:

Collaboration graph
[legend]
List of all members.

Detailed Description

The module and factory to drive the speech source nodes. It constructs SpeechSource nodes via the NodeFactory interface and pushes events into the tracker tree according to the nodes configuration.
Author:
Reinhard Steiner


Public Member Functions

 SpeechModule ()
virtual ~SpeechModule ()
virtual NodecreateNode (const std::string &name, StringTable &attributes)
virtual void init (StringTable &attributes, ConfigNode *localTree)
virtual void close ()
virtual void pushEvent ()
void Speak (const char *p_Sentence, bool p_Async=true)
bool GetCommand (DWORD p_CommandId, DWORD p_SpeechSetId, std::string &p_Command)

Protected Attributes

NodeVector m_Nodes
 list of SpeechSource nodes in the tree
DWORD m_NextNodeId
 next node id/rule name
SpeechCoreBasem_SpeechCore
 Speech Core (SR) component.
SpeechVoiceModulem_Voice
 Speech Voice (TTS) component.
ConfigNodem_ConfigTree
 Configuration Tree for following SpeechSources.
NodeVector m_Push2Nodes
 vector of all nodes that should push a speech event a second time


Constructor & Destructor Documentation

ot::SpeechModule::SpeechModule  )  [inline]
 

constructor method.

ot::SpeechModule::~SpeechModule  )  [virtual]
 

Destructor method, clears nodes member.


Member Function Documentation

void ot::SpeechModule::close  )  [virtual]
 

closes the module. A place for cleanup code etc. This class provides an empty implementation for subclasses not doing anything here.

Reimplemented from ot::Module.

Node * ot::SpeechModule::createNode const std::string &  name,
StringTable attributes
[virtual]
 

This method is called to construct a new Node. It compares name to the SpeechSource element name, and if it matches creates a new SpeechSource node.

Parameters:
name reference to string containing element name refenrence to StringMap containing attribute values
Returns:
pointer to new Node or NULL. The new Node must be allocated with new !

Implements ot::NodeFactory.

Reimplemented in ot::SpeechControlModule.

bool ot::SpeechModule::GetCommand DWORD  p_CommandId,
DWORD  p_SpeechSetId,
std::string &  p_Command
 

Get a command string from a command id

Returns:
true if successfull, false in case of a failure

void ot::SpeechModule::init StringTable attributes,
ConfigNode localTree
[virtual]
 

initializes the tracker module. This class provides an implementation that sets the initialization flag to true. Subclasses should call this method if they override this method. It takes the attributes of the element configuring this module and a local tree consisting of the children of the element. This tree must be build of Nodes.

Parameters:
attributes StringTable of elements attribute values. Should be possibly , but is not for convenience.
localTree pointer to root of configuration nodes tree

Reimplemented from ot::Module.

Reimplemented in ot::SpeechControlModule.

void ot::SpeechModule::pushEvent  )  [virtual]
 

pushes event information into the tracker tree. It enables the module to push new data into the tree by updating EventGenerator nodes and thereby triggering an event.

Reimplemented from ot::Module.

Reimplemented in ot::SpeechControlModule.

void ot::SpeechModule::Speak const char *  p_Sentence,
bool  p_Async = true
 

Speak a sentence with the default voice


Member Data Documentation

ConfigNode* ot::SpeechModule::m_ConfigTree [protected]
 

Configuration Tree for following SpeechSources.

DWORD ot::SpeechModule::m_NextNodeId [protected]
 

next node id/rule name

NodeVector ot::SpeechModule::m_Nodes [protected]
 

list of SpeechSource nodes in the tree

NodeVector ot::SpeechModule::m_Push2Nodes [protected]
 

vector of all nodes that should push a speech event a second time

SpeechCoreBase* ot::SpeechModule::m_SpeechCore [protected]
 

Speech Core (SR) component.

SpeechVoiceModule* ot::SpeechModule::m_Voice [protected]
 

Speech Voice (TTS) component.


The documentation for this class was generated from the following files:
Generated on Wed Feb 28 15:33:05 2007 for NaviTrack by  doxygen 1.4.6