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) :
QMetaObject::invokeMethod(gazeEstimation, "updateConfig");
// Load sound effects
loadSoundEffect(startSound, "start.wav");
loadSoundEffect(successSound, "success.wav");
loadSoundEffect(failureSound, "failure.wav");
loadSoundEffect(collectedSound, "collected.wav");
loadSoundEffect(startSound, "cal-start.wav");
loadSoundEffect(successSound, "cal-success.wav");
loadSoundEffect(failureSound, "cal-failure.wav");
loadSoundEffect(collectedSound, "cal-collected.wav");
}
GazeEstimationWidget::~GazeEstimationWidget()
......@@ -290,8 +290,10 @@ void GazeEstimationWidget::keyPressEvent(QKeyEvent *event)
return;
switch (event->key()) {
case Qt::Key_C:
if (isCollecting)
if (isCollecting) {
connect(this, SIGNAL(inDataTuple(DataTuple)), this, SLOT(collectMarkerTuple(DataTuple)) );
collectedSound.play();
}
break;
case Qt::Key_S:
ui->startFinishButton->setChecked(!ui->startFinishButton->isChecked());
......@@ -307,6 +309,8 @@ void GazeEstimationWidget::keyReleaseEvent(QKeyEvent *event)
switch (event->key()) {
case Qt::Key_C:
disconnect(this, SIGNAL(inDataTuple(DataTuple)), this, SLOT(collectMarkerTuple(DataTuple)) );
if (isCollecting)
collectedSound.play();
break;
default:
break;
......
......@@ -122,6 +122,9 @@ MainWindow::MainWindow(QWidget *parent) :
journal, SIGNAL(startRecording()) );
connect(this, SIGNAL(stopRecording()),
journal, SIGNAL(stopRecording()) );
loadSoundEffect(recStartSound, "rec-start.wav");
loadSoundEffect(recStopSound, "rec-stop.wav");
}
MainWindow::~MainWindow()
......@@ -347,6 +350,7 @@ void MainWindow::on_recordingToggle_clicked()
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
ui->recordingToggle->setEnabled(false);
recStartSound.play();
} else {
qInfo() << "Record stopped (Subject:" << ui->subject->text() << ")";
emit stopRecording();
......@@ -360,6 +364,7 @@ void MainWindow::on_recordingToggle_clicked()
setWorkingDirectory(previousPwd);
ui->changeSubjectButton->setEnabled(true);
ui->changePwdButton->setEnabled(true);
recStopSound.play();
}
}
void MainWindow::effectiveRecordingStart()
......
......@@ -166,6 +166,8 @@ private:
int elapsedTimeUpdateTimer;
QString previousPwd;
QSoundEffect recStartSound, recStopSound;
bool setupSubjectDirectory();
void setSubjectName(QString newSubjectName);
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