From 1edb87b13a58cbb87cbf99ee30cc5ee7eb15003a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 27 Apr 2013 12:48:22 +0200 Subject: Implement game name in the UI, lost previously due to refactoring. --- facetracknoir/facetracknoir.cpp | 8 ++++++-- facetracknoir/facetracknoir.ui | 19 ++++++++++++++++++- facetracknoir/tracker.cpp | 15 --------------- facetracknoir/tracker.h | 1 - 4 files changed, 24 insertions(+), 19 deletions(-) (limited to 'facetracknoir') diff --git a/facetracknoir/facetracknoir.cpp b/facetracknoir/facetracknoir.cpp index c031f2a8..59efeb60 100644 --- a/facetracknoir/facetracknoir.cpp +++ b/facetracknoir/facetracknoir.cpp @@ -857,7 +857,7 @@ void FaceTrackNoIR::startTracker( ) { /** stop tracking the face **/ void FaceTrackNoIR::stopTracker( ) { - + ui.game_name->setText("Not connected"); #if defined(_WIN32) || defined(__WIN32) if (keybindingWorker) { @@ -1002,7 +1002,11 @@ void FaceTrackNoIR::showHeadPose() { if (_curve_config) { _curve_config->update(); } - + if (Libraries->pProtocol) + { + QString name = Libraries->pProtocol->getGameName(); + ui.game_name->setText(name); + } } /** toggles Video Widget **/ diff --git a/facetracknoir/facetracknoir.ui b/facetracknoir/facetracknoir.ui index d91a6a92..63107a80 100644 --- a/facetracknoir/facetracknoir.ui +++ b/facetracknoir/facetracknoir.ui @@ -848,7 +848,7 @@ QGroupBox { 20 - 20 + 10 400 25 @@ -1339,6 +1339,23 @@ background:none; Roll + + + + 20 + 40 + 411 + 16 + + + + color:#ccc; +background:none; + + + Not connected + + diff --git a/facetracknoir/tracker.cpp b/facetracknoir/tracker.cpp index ca7d71fb..7320abaf 100644 --- a/facetracknoir/tracker.cpp +++ b/facetracknoir/tracker.cpp @@ -262,21 +262,6 @@ void Tracker::run() { } } -// -// Get the ProgramName from the Game and return it. -// -QString Tracker::getGameProgramName() { -QString str; -char dest[100]; - - str = QString("No protocol active?"); - if (Libraries->pProtocol) { - Libraries->pProtocol->getNameFromGame( dest ); - str = QString( dest ); - } - return str; -} - // // Handle the command, send upstream by the game. // Valid values are: diff --git a/facetracknoir/tracker.h b/facetracknoir/tracker.h index 59e0f19c..035a88ed 100644 --- a/facetracknoir/tracker.h +++ b/facetracknoir/tracker.h @@ -156,7 +156,6 @@ public: // void registerHeadPoseCallback(); bool handleGameCommand ( int command ); - QString getGameProgramName(); // Get the ProgramName from the game and display it. void loadSettings(); // Load settings from the INI-file //bool isShortKeyPressed( TShortKey *key, BYTE *keystate ); //bool isMouseKeyPressed( int *key, DIMOUSESTATE *mousestate ); -- cgit v1.2.3