cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mtsCMUSphinx4QtComponent.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3 
4 /*
5 
6  Author(s): Anton Deguet, Martin Kelly
7  Created on: 2011-03-07
8 
9  (C) Copyright 2011 Johns Hopkins University (JHU), All Rights Reserved.
10 
11 --- begin cisst license - do not edit ---
12 
13 This software is provided "as is" under an open source license, with
14 no warranty. The complete license can be found in license.txt and
15 http://www.cisst.org/cisst/license.txt.
16 
17 --- end cisst license ---
18 */
19 
20 #ifndef _mtsCMUSphinx4QtComponent_h
21 #define _mtsCMUSphinx4QtComponent_h
22 
28 
29 #include <QObject>
30 
31 #include <map>
32 
34 
35 // Always include last!
37 
38 class CISST_EXPORT mtsCMUSphinx4QtComponent: public QObject, public mtsComponent
39 {
40  Q_OBJECT;
42 
43  public:
44  mtsCMUSphinx4QtComponent(const std::string & componentName);
46 
47  void Configure(const std::string & CMN_UNUSED(filename) = "") {};
48  void Start(void);
49 
50  QWidget * GetWidget(void);
51 
52  signals:
53  void WordRecognizedQSignal(QString word);
54  void NoWordRecognizedQSignal(void);
55  void ContextChangedQSignal(QString word);
56  void WordAddedQSignal(QString context, QString word);
57 
58  public slots:
59  void TriggerWord(QString word);
60 
61  protected:
63 
64  void WordRecognizedHandler(const mtsStdString & word);
65  void NoWordRecognizedHandler(void);
66  void ContextChangedHandler(const mtsStdString & context);
67 
71 };
72 
74 
75 #endif // _mtsCMUSphinx4QtComponent_h
Defines the command interfaces.
Defines a function object to use a void command (mtsCommandVoid)
mtsFunctionRead GetContexts
Definition: mtsCMUSphinx4QtComponent.h:68
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
mtsCMUSphinx4QtWidget CentralWidget
Definition: mtsCMUSphinx4QtComponent.h:62
Defines the command interfaces.
Definition: mtsFunctionRead.h:37
CMN_DECLARE_SERVICES_INSTANTIATION(mtsCMUSphinx4QtComponent)
#define CMN_UNUSED(argument)
Definition: cmnPortability.h:479
~mtsCMUSphinx4QtComponent(void)
Definition: mtsCMUSphinx4QtComponent.h:45
Definition: mtsFunctionQualifiedRead.h:37
#define CMN_LOG_LOD_RUN_ERROR
Definition: cmnLogLoD.h:93
void Configure(const std::string &CMN_UNUSED(filename)="")
Definition: mtsCMUSphinx4QtComponent.h:47
Definition: mtsCMUSphinx4QtComponent.h:38
Defines the command interfaces.
Declaration of mtsComponent.
mtsFunctionQualifiedRead GetContextWords
Definition: mtsCMUSphinx4QtComponent.h:69
Definition: mtsComponent.h:150
#define CMN_DECLARE_SERVICES(hasDynamicCreation, lod)
Definition: cmnClassRegisterMacros.h:116
mtsFunctionWrite TriggerWordFromUI
Definition: mtsCMUSphinx4QtComponent.h:70
Definition: mtsFunctionWrite.h:37
const int CMN_NO_DYNAMIC_CREATION
Definition: cmnClassRegisterMacros.h:328
Definition: mtsCMUSphinx4QtWidget.h:31
Macros to export the symbols of cisstSpeechToCommands (in a Dll).
virtual void Start(void)