mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 04:57:58 +02:00
Add non-SAPI specific functionality
This commit is contained in:
parent
524c413681
commit
66a2639fae
1 changed files with 19 additions and 4 deletions
|
@ -16,7 +16,9 @@
|
||||||
#include "SpeechRecognizer.h"
|
#include "SpeechRecognizer.h"
|
||||||
|
|
||||||
SpeechRecognizer::SpeechRecognizer() :
|
SpeechRecognizer::SpeechRecognizer() :
|
||||||
QObject() {
|
QObject(),
|
||||||
|
_enabled(false),
|
||||||
|
_commands() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,19 +27,32 @@ SpeechRecognizer::~SpeechRecognizer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpeechRecognizer::handleCommandRecognized(const char* command) {
|
void SpeechRecognizer::handleCommandRecognized(const char* command) {
|
||||||
|
emit commandRecognized(QString(command));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpeechRecognizer::setEnabled(bool enabled) {
|
void SpeechRecognizer::setEnabled(bool enabled) {
|
||||||
|
if (enabled == _enabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_enabled = enabled;
|
||||||
|
if (_enabled) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
emit enabledUpdated(_enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpeechRecognizer::addCommand(const QString& command) {
|
void SpeechRecognizer::addCommand(const QString& command) {
|
||||||
|
_commands.insert(command);
|
||||||
|
reloadCommands();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpeechRecognizer::removeCommand(const QString& command) {
|
void SpeechRecognizer::removeCommand(const QString& command) {
|
||||||
|
_commands.remove(command);
|
||||||
|
reloadCommands();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpeechRecognizer::reloadCommands() {
|
void SpeechRecognizer::reloadCommands() {
|
||||||
|
|
Loading…
Reference in a new issue