summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir/facetracknoir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'facetracknoir/facetracknoir.cpp')
-rw-r--r--facetracknoir/facetracknoir.cpp57
1 files changed, 31 insertions, 26 deletions
diff --git a/facetracknoir/facetracknoir.cpp b/facetracknoir/facetracknoir.cpp
index da8fae61..dfa13577 100644
--- a/facetracknoir/facetracknoir.cpp
+++ b/facetracknoir/facetracknoir.cpp
@@ -259,16 +259,26 @@ void FaceTrackNoIR::open() {
}
}
-void FaceTrackNoIR::save() {
- b->save();
-
+void FaceTrackNoIR::save_mappings() {
QSettings settings("opentrack");
QString currentFile =
settings.value("SettingsFile",
QCoreApplication::applicationDirPath() + "/settings/default.ini")
.toString();
+ QSettings iniFile( currentFile, QSettings::IniFormat );
+
+ for (int i = 0; i < 6; i++)
+ {
+ axis(i).curve.saveSettings(iniFile, axis(i).name1);
+ axis(i).curveAlt.saveSettings(iniFile, axis(i).name2);
+ }
+}
+void FaceTrackNoIR::save() {
+ b->save();
+ save_mappings();
+
#if defined(__unix) || defined(__linux)
QByteArray bytes = QFile::encodeName(currentFile);
const char* filename_as_asciiz = bytes.constData();
@@ -311,9 +321,21 @@ void FaceTrackNoIR::saveAs()
fill_profile_cbx();
}
+void FaceTrackNoIR::load_mappings() {
+ QSettings settings("opentrack");
+ QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString();
+ QSettings iniFile( currentFile, QSettings::IniFormat );
+
+ for (int i = 0; i < 6; i++)
+ {
+ axis(i).curve.loadSettings(iniFile, axis(i).name1);
+ axis(i).curveAlt.loadSettings(iniFile, axis(i).name2);
+ }
+}
+
void FaceTrackNoIR::loadSettings() {
b->reload();
- (dynamic_cast<CurveConfigurationDialog*>(_curve_config))->loadSettings();
+ load_mappings();
}
void FaceTrackNoIR::updateButtonState(bool running)
@@ -359,18 +381,6 @@ void FaceTrackNoIR::startTracker( ) {
delete tracker;
}
- {
- QSettings settings("opentrack");
- QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString();
- QSettings iniFile( currentFile, QSettings::IniFormat );
-
- for (int i = 0; i < 6; i++)
- {
- axis(i).curve.loadSettings(iniFile, axis(i).name1);
- axis(i).curveAlt.loadSettings(iniFile, axis(i).name2);
- }
- }
-
tracker = new Tracker ( this, s );
if (pTrackerDialog && Libraries->pTracker) {
@@ -559,17 +569,12 @@ void FaceTrackNoIR::showKeyboardShortcuts() {
_keyboard_shortcuts->show();
_keyboard_shortcuts->raise();
}
-void FaceTrackNoIR::showCurveConfiguration() {
-
- if (!_curve_config)
- {
+void FaceTrackNoIR::showCurveConfiguration() {
+ if (!_curve_config)
_curve_config = new CurveConfigurationDialog( this, this );
- }
-
- if (_curve_config) {
- _curve_config->show();
- _curve_config->raise();
- }
+
+ _curve_config->show();
+ _curve_config->raise();
}
void FaceTrackNoIR::exit() {