Commit ede37688 authored by Thiago Santini's avatar Thiago Santini

Adds audible feeback

Replace old sounds with voice feedback; adds feedback for recording
parent 2964eb37
...@@ -141,10 +141,10 @@ GazeEstimationWidget::GazeEstimationWidget(QWidget *parent) : ...@@ -141,10 +141,10 @@ GazeEstimationWidget::GazeEstimationWidget(QWidget *parent) :
QMetaObject::invokeMethod(gazeEstimation, "updateConfig"); QMetaObject::invokeMethod(gazeEstimation, "updateConfig");
// Load sound effects // Load sound effects
loadSoundEffect(startSound, "start.wav"); loadSoundEffect(startSound, "cal-start.wav");
loadSoundEffect(successSound, "success.wav"); loadSoundEffect(successSound, "cal-success.wav");
loadSoundEffect(failureSound, "failure.wav"); loadSoundEffect(failureSound, "cal-failure.wav");
loadSoundEffect(collectedSound, "collected.wav"); loadSoundEffect(collectedSound, "cal-collected.wav");
} }
GazeEstimationWidget::~GazeEstimationWidget() GazeEstimationWidget::~GazeEstimationWidget()
...@@ -290,8 +290,10 @@ void GazeEstimationWidget::keyPressEvent(QKeyEvent *event) ...@@ -290,8 +290,10 @@ void GazeEstimationWidget::keyPressEvent(QKeyEvent *event)
return; return;
switch (event->key()) { switch (event->key()) {
case Qt::Key_C: case Qt::Key_C:
if (isCollecting) if (isCollecting) {
connect(this, SIGNAL(inDataTuple(DataTuple)), this, SLOT(collectMarkerTuple(DataTuple)) ); connect(this, SIGNAL(inDataTuple(DataTuple)), this, SLOT(collectMarkerTuple(DataTuple)) );
collectedSound.play();
}
break; break;
case Qt::Key_S: case Qt::Key_S:
ui->startFinishButton->setChecked(!ui->startFinishButton->isChecked()); ui->startFinishButton->setChecked(!ui->startFinishButton->isChecked());
...@@ -307,6 +309,8 @@ void GazeEstimationWidget::keyReleaseEvent(QKeyEvent *event) ...@@ -307,6 +309,8 @@ void GazeEstimationWidget::keyReleaseEvent(QKeyEvent *event)
switch (event->key()) { switch (event->key()) {
case Qt::Key_C: case Qt::Key_C:
disconnect(this, SIGNAL(inDataTuple(DataTuple)), this, SLOT(collectMarkerTuple(DataTuple)) ); disconnect(this, SIGNAL(inDataTuple(DataTuple)), this, SLOT(collectMarkerTuple(DataTuple)) );
if (isCollecting)
collectedSound.play();
break; break;
default: default:
break; break;
......
...@@ -122,6 +122,9 @@ MainWindow::MainWindow(QWidget *parent) : ...@@ -122,6 +122,9 @@ MainWindow::MainWindow(QWidget *parent) :
journal, SIGNAL(startRecording()) ); journal, SIGNAL(startRecording()) );
connect(this, SIGNAL(stopRecording()), connect(this, SIGNAL(stopRecording()),
journal, SIGNAL(stopRecording()) ); journal, SIGNAL(stopRecording()) );
loadSoundEffect(recStartSound, "rec-start.wav");
loadSoundEffect(recStopSound, "rec-stop.wav");
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()
...@@ -347,6 +350,7 @@ void MainWindow::on_recordingToggle_clicked() ...@@ -347,6 +350,7 @@ void MainWindow::on_recordingToggle_clicked()
journal, SIGNAL(newData(DataTuple)) ); journal, SIGNAL(newData(DataTuple)) );
QTimer::singleShot(500, this, SLOT(effectiveRecordingStart())); // TODO: right now we wait a predefined amount of time; ideally, we should wait for an ack from everyone involved QTimer::singleShot(500, this, SLOT(effectiveRecordingStart())); // TODO: right now we wait a predefined amount of time; ideally, we should wait for an ack from everyone involved
ui->recordingToggle->setEnabled(false); ui->recordingToggle->setEnabled(false);
recStartSound.play();
} else { } else {
qInfo() << "Record stopped (Subject:" << ui->subject->text() << ")"; qInfo() << "Record stopped (Subject:" << ui->subject->text() << ")";
emit stopRecording(); emit stopRecording();
...@@ -360,6 +364,7 @@ void MainWindow::on_recordingToggle_clicked() ...@@ -360,6 +364,7 @@ void MainWindow::on_recordingToggle_clicked()
setWorkingDirectory(previousPwd); setWorkingDirectory(previousPwd);
ui->changeSubjectButton->setEnabled(true); ui->changeSubjectButton->setEnabled(true);
ui->changePwdButton->setEnabled(true); ui->changePwdButton->setEnabled(true);
recStopSound.play();
} }
} }
void MainWindow::effectiveRecordingStart() void MainWindow::effectiveRecordingStart()
......
...@@ -166,6 +166,8 @@ private: ...@@ -166,6 +166,8 @@ private:
int elapsedTimeUpdateTimer; int elapsedTimeUpdateTimer;
QString previousPwd; QString previousPwd;
QSoundEffect recStartSound, recStopSound;
bool setupSubjectDirectory(); bool setupSubjectDirectory();
void setSubjectName(QString newSubjectName); void setSubjectName(QString newSubjectName);
void setWorkingDirectory(QString dir); void setWorkingDirectory(QString dir);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment