summaryrefslogtreecommitdiffhomepage
path: root/opentrack/main-settings.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-10-19 16:08:46 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-10-19 18:28:08 +0200
commitdd87370ff2818ee3c3d67ba104405b85ee44daba (patch)
treed5ebdf22aaccd0e345ce7a7c2ecb7b7193ea0791 /opentrack/main-settings.hpp
parent7e2e341c45b86f76e08d74e056929ad76ff1a383 (diff)
decruft more
Diffstat (limited to 'opentrack/main-settings.hpp')
-rw-r--r--opentrack/main-settings.hpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/opentrack/main-settings.hpp b/opentrack/main-settings.hpp
new file mode 100644
index 00000000..6f78ac82
--- /dev/null
+++ b/opentrack/main-settings.hpp
@@ -0,0 +1,59 @@
+#pragma once
+
+#include <QString>
+#include "opentrack/options.hpp"
+using namespace options;
+
+struct key_opts {
+ value<int> key_index;
+ value<bool> ctrl, alt, shift;
+ key_opts(pbundle b, const QString& name) :
+ key_index(b, QString("key-index-%1").arg(name), 0),
+ ctrl(b, QString("key-ctrl-%1").arg(name), 0),
+ alt(b, QString("key-alt-%1").arg(name), 0),
+ shift(b, QString("key-shift-%1").arg(name), 0)
+ {}
+};
+
+struct axis_opts {
+ value<double> zero;
+ value<bool> invert, altp;
+ value<int> src;
+ axis_opts(pbundle b, QString pfx, int idx) :
+ zero(b, n(pfx, "zero-pos"), 0),
+ invert(b, n(pfx, "invert-axis"), false),
+ altp(b, n(pfx, "alt-axis-sign"), false),
+ src(b, n(pfx, "source-index"), idx)
+ {}
+private:
+ static inline QString n(QString pfx, QString name) {
+ return QString("%1-%2").arg(pfx, name);
+ }
+};
+
+struct main_settings {
+ pbundle b;
+ key_opts center_key;
+ key_opts toggle_key;
+ value<QString> tracker_dll, tracker2_dll, filter_dll, protocol_dll;
+ axis_opts a_x, a_y, a_z, a_yaw, a_pitch, a_roll;
+ value<bool> tcomp_p, tcomp_tz, dingp;
+ main_settings(pbundle b) :
+ b(b),
+ center_key(b, "center"),
+ toggle_key(b, "toggle"),
+ tracker_dll(b, "tracker-dll", ""),
+ tracker2_dll(b, "tracker2-dll", ""),
+ filter_dll(b, "filter-dll", ""),
+ protocol_dll(b, "protocol-dll", ""),
+ a_x(b, "x", TX),
+ a_y(b, "y", TY),
+ a_z(b, "z", TZ),
+ a_yaw(b, "yaw", Yaw),
+ a_pitch(b, "pitch", Pitch),
+ a_roll(b, "roll", Roll),
+ tcomp_p(b, "compensate-translation", true),
+ tcomp_tz(b, "compensate-translation-disable-z-axis", false),
+ dingp(b, "ding", true)
+ {}
+};