summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ftnoir_filter_accela/ftnoir_filter_accela.cpp8
-rw-r--r--ftnoir_filter_accela/ftnoir_filter_accela.h2
-rw-r--r--ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp56
3 files changed, 31 insertions, 35 deletions
diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.cpp b/ftnoir_filter_accela/ftnoir_filter_accela.cpp
index 08829e52..a78a38c5 100644
--- a/ftnoir_filter_accela/ftnoir_filter_accela.cpp
+++ b/ftnoir_filter_accela/ftnoir_filter_accela.cpp
@@ -55,15 +55,11 @@ void FTNoIR_Filter::loadSettings() {
iniFile.endGroup();
}
-void FTNoIR_Filter::receiveSettings(double rot, double trans, double zoom_fac, double dz, double exponent)
+void FTNoIR_Filter::receiveSettings()
{
QMutexLocker foo(&mutex);
- rotation_alpha = rot;
- translation_alpha = trans;
- zoom_factor = zoom_fac;
- deadzone = dz;
- expt = exponent;
+ loadSettings();
}
static inline double parabola(const double a, const double x, const double dz, const double expt)
diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.h b/ftnoir_filter_accela/ftnoir_filter_accela.h
index c92e28df..0a550f0e 100644
--- a/ftnoir_filter_accela/ftnoir_filter_accela.h
+++ b/ftnoir_filter_accela/ftnoir_filter_accela.h
@@ -50,7 +50,7 @@ public:
void Initialize() {
first_run = true;
}
- void receiveSettings(double rot, double trans, double zoom_fac, double deadzone, double expt);
+ void receiveSettings();
private:
QMutex mutex;
void loadSettings();
diff --git a/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp b/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp
index 68484e77..be6836c2 100644
--- a/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp
+++ b/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp
@@ -202,40 +202,40 @@ void FilterControls::save() {
QSettings settings("opentrack"); // Registry settings (in HK_USER)
QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString();
- QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file)
-
- qDebug() << "FTNoIR_Filter::save() says: iniFile = " << currentFile;
-
- double rot, trans, zoom, deadzone, expt;
-
- iniFile.beginGroup ( "Accela" );
- iniFile.setValue("rotation-alpha", rot = ui.rotation_alpha->value());
- iniFile.setValue("translation-alpha", trans = ui.translation_alpha->value());
- iniFile.setValue("zoom-slowness", zoom = ui.spinZoom->value());
- iniFile.setValue("deadzone", deadzone = ui.deadzone->value());
- iniFile.setValue("exponent", expt = ui.expt->value());
- iniFile.setValue("second-order-alpha", rot = ui.order_2nd->value());
- iniFile.setValue("third-order-alpha", rot = ui.order_3rd->value());
-
- QDoubleSpinBox* boxen[] = {
- ui.doubleSpinBox,
- ui.doubleSpinBox_2,
- ui.doubleSpinBox_3,
- ui.doubleSpinBox_4,
- ui.doubleSpinBox_5,
- ui.doubleSpinBox_6,
- };
-
- for (int i = 0; i < 6; i++)
{
- iniFile.setValue(QString("axis-%1").arg(QString::number(i)), boxen[i]->value());
+ QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file)
+
+ qDebug() << "FTNoIR_Filter::save() says: iniFile = " << currentFile;
+
+ iniFile.beginGroup ( "Accela" );
+ iniFile.setValue("rotation-alpha", ui.rotation_alpha->value());
+ iniFile.setValue("translation-alpha", ui.translation_alpha->value());
+ iniFile.setValue("zoom-slowness", ui.spinZoom->value());
+ iniFile.setValue("deadzone", ui.deadzone->value());
+ iniFile.setValue("exponent", ui.expt->value());
+ iniFile.setValue("second-order-alpha", ui.order_2nd->value());
+ iniFile.setValue("third-order-alpha", ui.order_3rd->value());
+
+ QDoubleSpinBox* boxen[] = {
+ ui.doubleSpinBox,
+ ui.doubleSpinBox_2,
+ ui.doubleSpinBox_3,
+ ui.doubleSpinBox_4,
+ ui.doubleSpinBox_5,
+ ui.doubleSpinBox_6,
+ };
+
+ for (int i = 0; i < 6; i++)
+ {
+ iniFile.setValue(QString("axis-%1").arg(QString::number(i)), boxen[i]->value());
+ }
+ iniFile.endGroup();
}
- iniFile.endGroup();
settingsDirty = false;
if (accela_filter)
- accela_filter->receiveSettings(rot, trans, zoom, deadzone, expt);
+ accela_filter->receiveSettings();
}
////////////////////////////////////////////////////////////////////////////////