ot::CSpeechCore Class Reference
#include <SpeechCore.h>
Inheritance diagram for ot::CSpeechCore:


Public Member Functions | |
| void | Destroy () |
| CSpeechCore () | |
| virtual | ~CSpeechCore () |
| void | Init (void) |
| void | Init (LANGID p_LanguageId=MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT)) |
| SpeechSetBase * | GetSpeechSet (const char *p_Name, bool p_Create=true) |
| SpeechSetBase * | GetSpeechSet (DWORD p_Id) |
| void | RemoveSpeechSet (const char *p_Name) |
| void | RemoveSpeechSet (DWORD p_Id) |
| SpeechSetBase * | FindSpeechSet (const char *p_Command, bool p_Active=true) |
| SpeechSetBase * | FindSpeechSet (DWORD p_CommandId, bool p_Active=true) |
| void | NotifyWindowMessage (HWND p_hWnd, UINT p_Msg=WM_USER+1, WPARAM p_wParam=0, LPARAM p_lParam=0) |
| bool | ProcessRecognitionPoll () |
| bool | GetReco (std::string &p_Result, std::string &p_SpeechSet) |
Static Public Member Functions | |
| static void | StrToWide (const char *p_String, std::wstring &p_WideString) |
| static void | WideToStr (const WCHAR *p_WideString, std::string &p_String) |
Protected Member Functions | |
| void | Initialize () |
Protected Attributes | |
| bool | m_Initialized |
| CComPtr< ISpRecognizer > | m_RecoEngine |
| CComPtr< ISpRecoContext > | m_RecoCtxt |
| CComPtr< ISpRecoGrammar > | m_CmdGrammar |
| DWORD | m_NextRuleId |
| std::vector< CSpeechSet * > | m_SpeechSets |
Static Protected Attributes | |
| static DWORD | s_GrammarId = 1 |
Friends | |
| class | CSpeechSet |
Detailed Description
Definition at line 190 of file SpeechCore.h.
Constructor & Destructor Documentation
| ot::CSpeechCore::CSpeechCore | ( | ) | [inline] |
destroys (cleanup) all class members
Definition at line 218 of file SpeechCore.h.
References Initialize().
| virtual ot::CSpeechCore::~CSpeechCore | ( | ) | [inline, virtual] |
Member Function Documentation
| void ot::CSpeechCore::Destroy | ( | ) | [virtual] |
initializes all class members
Reimplemented from ot::SpeechCoreBase.
Definition at line 165 of file SpeechCore.cxx.
References m_CmdGrammar, m_Initialized, m_RecoCtxt, m_RecoEngine, and m_SpeechSets.
Referenced by Init(), and ~CSpeechCore().
| SpeechSetBase * ot::CSpeechCore::FindSpeechSet | ( | DWORD | p_CommandId, | |
| bool | p_Active = true | |||
| ) | [virtual] |
find a (active) SpeechSet witch recognizes this command
Reimplemented from ot::SpeechCoreBase.
Definition at line 342 of file SpeechCore.cxx.
References m_Initialized, and m_SpeechSets.
| SpeechSetBase * ot::CSpeechCore::FindSpeechSet | ( | const char * | p_Command, | |
| bool | p_Active = true | |||
| ) | [virtual] |
find a (active) SpeechSet witch recognizes this command
Reimplemented from ot::SpeechCoreBase.
Definition at line 327 of file SpeechCore.cxx.
References m_Initialized, and m_SpeechSets.
Referenced by ProcessRecognitionPoll().
| bool ot::CSpeechCore::GetReco | ( | std::string & | p_Result, | |
| std::string & | p_SpeechSet | |||
| ) |
Get the next recognized command, in any SpeechSet.
| SpeechSetBase * ot::CSpeechCore::GetSpeechSet | ( | DWORD | p_Id | ) | [virtual] |
get a SpeechSet with the appropriate id
Reimplemented from ot::SpeechCoreBase.
Definition at line 281 of file SpeechCore.cxx.
References m_Initialized, and m_SpeechSets.
| SpeechSetBase * ot::CSpeechCore::GetSpeechSet | ( | const char * | p_Name, | |
| bool | p_Create = true | |||
| ) | [virtual] |
get/create a SpeechSet with the appropriate name
Reimplemented from ot::SpeechCoreBase.
Definition at line 260 of file SpeechCore.cxx.
References CSpeechSet, m_Initialized, m_NextRuleId, and m_SpeechSets.
| void ot::CSpeechCore::Init | ( | LANGID | p_LanguageId = MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT) |
) |
Initialize the speech core with a appropriate language.
Definition at line 200 of file SpeechCore.cxx.
References Destroy(), Initialize(), m_CmdGrammar, m_Initialized, m_RecoCtxt, m_RecoEngine, and s_GrammarId.
| void ot::CSpeechCore::Init | ( | void | ) | [inline, virtual] |
Initialize the speech core with a appropriate language.
Reimplemented from ot::SpeechCoreBase.
Definition at line 232 of file SpeechCore.h.
| void ot::CSpeechCore::Initialize | ( | ) | [protected, virtual] |
a array with all speech sets of this core object
Reimplemented from ot::SpeechCoreBase.
Definition at line 158 of file SpeechCore.cxx.
References m_Initialized, and m_NextRuleId.
Referenced by CSpeechCore(), and Init().
| void ot::CSpeechCore::NotifyWindowMessage | ( | HWND | p_hWnd, | |
| UINT | p_Msg = WM_USER+1, |
|||
| WPARAM | p_wParam = 0, |
|||
| LPARAM | p_lParam = 0 | |||
| ) |
Send a windows notify message, when any sr occures.
Definition at line 357 of file SpeechCore.cxx.
References m_RecoCtxt.
| bool ot::CSpeechCore::ProcessRecognitionPoll | ( | ) | [virtual] |
Poll the recognize events, look if some commands have been recognized.
Reimplemented from ot::SpeechCoreBase.
Definition at line 366 of file SpeechCore.cxx.
References FindSpeechSet(), m_Initialized, m_RecoCtxt, ot::CSpeechSet::Recognize(), and WideToStr().
| void ot::CSpeechCore::RemoveSpeechSet | ( | DWORD | p_Id | ) | [virtual] |
remove a specified SpeechSet
Reimplemented from ot::SpeechCoreBase.
Definition at line 311 of file SpeechCore.cxx.
References m_Initialized, and m_SpeechSets.
| void ot::CSpeechCore::RemoveSpeechSet | ( | const char * | p_Name | ) | [virtual] |
remove a specified SpeechSet
Reimplemented from ot::SpeechCoreBase.
Definition at line 295 of file SpeechCore.cxx.
References m_Initialized, and m_SpeechSets.
| static void ot::CSpeechCore::StrToWide | ( | const char * | p_String, | |
| std::wstring & | p_WideString | |||
| ) | [static] |
Convert a standard string to a wide string.
Referenced by ot::CSpeechSet::Activate(), ot::CSpeechSet::AddCommand(), ot::CSpeechSet::Deactivate(), ot::CSpeechSet::Destroy(), ot::CSpeechSet::RebuildRule(), and ot::CSpeechVoice::Speak().
| static void ot::CSpeechCore::WideToStr | ( | const WCHAR * | p_WideString, | |
| std::string & | p_String | |||
| ) | [static] |
Convert a wide string to a standard string.
Referenced by ot::CSpeechVoice::GetVoices(), and ProcessRecognitionPoll().
Friends And Related Function Documentation
friend class CSpeechSet [friend] |
Member Data Documentation
CComPtr<ISpRecoGrammar> ot::CSpeechCore::m_CmdGrammar [protected] |
Pointer to our recognition context.
Definition at line 203 of file SpeechCore.h.
Referenced by ot::CSpeechSet::Activate(), ot::CSpeechSet::AddCommand(), ot::CSpeechSet::Deactivate(), ot::CSpeechSet::Destroy(), Destroy(), Init(), and ot::CSpeechSet::RebuildRule().
bool ot::CSpeechCore::m_Initialized [protected] |
Unique Grammar Id counter.
Reimplemented from ot::SpeechCoreBase.
Definition at line 199 of file SpeechCore.h.
Referenced by Destroy(), FindSpeechSet(), GetSpeechSet(), Init(), Initialize(), ProcessRecognitionPoll(), and RemoveSpeechSet().
DWORD ot::CSpeechCore::m_NextRuleId [protected] |
Pointer to our grammar object.
Reimplemented from ot::SpeechCoreBase.
Definition at line 205 of file SpeechCore.h.
Referenced by GetSpeechSet(), and Initialize().
CComPtr<ISpRecoContext> ot::CSpeechCore::m_RecoCtxt [protected] |
Pointer to our recognition engine instance.
Definition at line 202 of file SpeechCore.h.
Referenced by Destroy(), Init(), NotifyWindowMessage(), and ProcessRecognitionPoll().
CComPtr<ISpRecognizer> ot::CSpeechCore::m_RecoEngine [protected] |
std::vector<CSpeechSet*> ot::CSpeechCore::m_SpeechSets [protected] |
unique Rule Id counter for the speech sets
Reimplemented from ot::SpeechCoreBase.
Definition at line 206 of file SpeechCore.h.
Referenced by Destroy(), FindSpeechSet(), GetSpeechSet(), and RemoveSpeechSet().
DWORD ot::CSpeechCore::s_GrammarId = 1 [static, protected] |
Reimplemented from ot::SpeechCoreBase.
Definition at line 194 of file SpeechCore.h.
Referenced by Init().
The documentation for this class was generated from the following files: