From d15a1c158d8c1ae589f18a0443defc5726190a40 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 15 Sep 2013 04:05:18 +0200 Subject: Only use mm timers during tracking --- facetracknoir/tracker.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'facetracknoir/tracker.cpp') diff --git a/facetracknoir/tracker.cpp b/facetracknoir/tracker.cpp index 981be4b7..cff2e765 100644 --- a/facetracknoir/tracker.cpp +++ b/facetracknoir/tracker.cpp @@ -24,6 +24,10 @@ #include "tracker.h" #include "facetracknoir.h" +#if defined(_WIN32) +# include +#endif + /** constructor **/ Tracker::Tracker( FaceTrackNoIR *parent ) : should_quit(false), @@ -69,7 +73,11 @@ void Tracker::run() { double newpose[6]; double last_post_filter[6]; - forever +#if defined(_WIN32) + (void) timeBeginPeriod(1); +#endif + + for (;;) { if (should_quit) break; @@ -157,6 +165,9 @@ void Tracker::run() { //for lower cpu load msleep(8); } +#if defined(_WIN32) + (void) timeEndPeriod(1); +#endif for (int i = 0; i < 6; i++) { @@ -192,7 +203,7 @@ void Tracker::loadSettings() { qDebug() << "Tracker::loadSettings says: Starting "; QSettings settings("opentrack"); // Registry settings (in HK_USER) - QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString(); + QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString(); QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) iniFile.beginGroup("Tracking"); -- cgit v1.2.3