summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir/facetracknoir.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-09-22 08:43:17 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-09-22 08:48:45 +0200
commit35d3f9b53f9ee409ef39621e5579699ebf2f645a (patch)
tree14ff750105ad2c16c356169656f2630107ea3994 /facetracknoir/facetracknoir.cpp
parent9e6dc13ee9cfc1743d11b8df336a020732560d3f (diff)
only remove "no feed" image if tracker provides a video feed
Diffstat (limited to 'facetracknoir/facetracknoir.cpp')
-rw-r--r--facetracknoir/facetracknoir.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/facetracknoir/facetracknoir.cpp b/facetracknoir/facetracknoir.cpp
index 3f6d641e..eb9ece52 100644
--- a/facetracknoir/facetracknoir.cpp
+++ b/facetracknoir/facetracknoir.cpp
@@ -101,7 +101,7 @@ FaceTrackNoIR::FaceTrackNoIR(QWidget *parent) :
ui.setupUi(this);
setFixedSize(size());
ui.video_frame_label->setPixmap(no_feed_pixmap);
- updateButtonState(false);
+ updateButtonState(false, false);
_keyboard_shortcuts = 0;
_curve_config = 0;
@@ -278,7 +278,7 @@ void FaceTrackNoIR::loadSettings() {
load_mappings();
}
-void FaceTrackNoIR::updateButtonState(bool running)
+void FaceTrackNoIR::updateButtonState(bool running, bool inertialp)
{
bool not_running = !running;
ui.iconcomboProfile->setEnabled ( not_running );
@@ -290,7 +290,7 @@ void FaceTrackNoIR::updateButtonState(bool running)
ui.cbxSecondTrackerSource->setEnabled(not_running);
ui.btnStartTracker->setEnabled(not_running);
ui.btnStopTracker->setEnabled(running);
- ui.video_frame_label->setVisible(not_running);
+ ui.video_frame_label->setVisible(not_running || inertialp);
}
void FaceTrackNoIR::startTracker( ) {
@@ -333,7 +333,10 @@ void FaceTrackNoIR::startTracker( ) {
timUpdateHeadPose.start(50);
- updateButtonState(true);
+ // NB check valid since SelectedLibraries ctor called
+ // trackers take care of layout state updates
+ const bool is_inertial = ui.video_frame->layout() == nullptr;
+ updateButtonState(true, is_inertial);
}
void FaceTrackNoIR::stopTracker( ) {
@@ -381,7 +384,7 @@ void FaceTrackNoIR::stopTracker( ) {
Libraries = NULL;
}
}
- updateButtonState(false);
+ updateButtonState(false, false);
}
void FaceTrackNoIR::showHeadPose() {