Mercurial > hg > easaier-soundaccess
view widgets/SpeechRecognitionUI.cpp @ 268:ee047fc1a552
if no title is present in the results list, it is replace by "unknown"
when a new TIMELINE INFORMATION layer is loaded the sample rate is set up to the main model (WaveFileModel) sample rate.
author | lbajardsilogic |
---|---|
date | Wed, 25 Jun 2008 09:47:11 +0000 |
parents | 63a485275ed6 |
children | 119d89cb65cb |
line wrap: on
line source
#include "SpeechRecognitionUI.h" #include <QGridLayout> #include <QVBoxLayout> #include <QLabel> #include "../sv/main/MainWindow.h" #include "../sv/main/EasaierSessionManager.h" SpeechRecognitionUI::SpeechRecognitionUI(QWidget *parent) : QWidget(parent){ _audioRecorder = new AudioRecording(); connect(this, SIGNAL(startRect()),_audioRecorder, SLOT(rect())); connect(this, SIGNAL(stopRect()),_audioRecorder, SLOT(stopRect())); _bRect = new QPushButton; _bPlay = new QPushButton; _bSend = new QPushButton; _bRect->setMaximumSize(24,24); _bPlay->setMaximumSize(24,24); _bSend->setMaximumSize(24,24); _bPlay->setEnabled(false); _bSend->setEnabled(false); _bRect->setIcon(QIcon(":icons/rect.png")); _bPlay->setIcon(QIcon(":icons/playpause.png")); _bSend->setIcon(QIcon(":icons/addToLayer.png")); _textEdit = new QTextEdit(); _textEdit->setMinimumWidth(200); QVBoxLayout *truc = new QVBoxLayout(); truc->addWidget(new QLabel); truc->addStretch(); QGridLayout *layout = new QGridLayout; this->setLayout(layout); layout->addWidget(new QLabel(tr("Speech Recognition")),1,1,1,2,Qt::AlignTop); layout->addWidget(_bRect,2,1,1,1,Qt::AlignTop); //layout->addWidget(_bPlay,2,1,1,1,Qt::AlignTop); layout->addWidget(_bSend,3,1,1,1,Qt::AlignTop); layout->addLayout(truc,4,1,1,1,Qt::AlignTop); layout->addWidget(_textEdit,2,2,3,1); //SLOTs end SIGNALs connect(_bRect, SIGNAL(pressed ()), this,SLOT(rect())); connect(_bSend, SIGNAL(pressed ()), this,SLOT(sendQuery())); } SpeechRecognitionUI::~SpeechRecognitionUI(){ } void SpeechRecognitionUI::play(){ } void SpeechRecognitionUI::rect(){ if(_audioRecorder->isRecording()){ emit(stopRect()); _bRect->setIcon(QIcon(":icons/rect.png")); _bPlay->setEnabled(true); _bSend->setEnabled(true); }else{ emit(startRect()); _bRect->setIcon(QIcon(":icons/stop.png")); _bPlay->setEnabled(false); _bSend->setEnabled(false); } } void SpeechRecognitionUI::sendQuery(){ MainWindow::instance()->getEasaierSessionManager()->speechRecognition("SpeechRecognition"); } void SpeechRecognitionUI::setResult(const QString &result){ _textEdit->setText(result); }