diff options
Diffstat (limited to 'opentrack')
-rw-r--r-- | opentrack/main-settings.hpp | 11 | ||||
-rw-r--r-- | opentrack/options.hpp | 2 | ||||
-rw-r--r-- | opentrack/plugin-support.hpp | 13 | ||||
-rw-r--r-- | opentrack/selected-libraries.cpp | 18 | ||||
-rw-r--r-- | opentrack/selected-libraries.hpp | 2 | ||||
-rw-r--r-- | opentrack/tracker.cpp | 5 |
6 files changed, 15 insertions, 36 deletions
diff --git a/opentrack/main-settings.hpp b/opentrack/main-settings.hpp index d1fe574d..dd61143e 100644 --- a/opentrack/main-settings.hpp +++ b/opentrack/main-settings.hpp @@ -16,12 +16,10 @@ using namespace options; struct axis_opts { pbundle b; - value<double> zero; value<bool> invert, altp; value<int> src; axis_opts(pbundle b, QString pfx, int idx) : b(b), - zero(b, n(pfx, "zero-pos"), 0), invert(b, n(pfx, "invert-sign"), false), altp(b, n(pfx, "alt-axis-sign"), false), src(b, n(pfx, "source-index"), idx) @@ -33,17 +31,14 @@ private: }; struct main_settings : opts { - value<QString> tracker_dll, filter_dll, protocol_dll; + value<QString> protocol_dll; axis_opts a_x, a_y, a_z, a_yaw, a_pitch, a_roll; value<bool> tcomp_p, tcomp_tz; value<bool> tray_enabled; value<int> camera_yaw, camera_pitch, camera_roll; - value<bool> center_at_startup; - value<int> center_method; + value<bool> center_at_startup, wizard_done; main_settings() : opts("opentrack-ui"), - tracker_dll(b, "tracker-dll", ""), - filter_dll(b, "filter-dll", "Accela"), protocol_dll(b, "protocol-dll", "freetrack 2.0 Enhanced"), a_x(b, "x", TX), a_y(b, "y", TY), @@ -58,6 +53,6 @@ struct main_settings : opts { camera_pitch(b, "camera-pitch", 0), camera_roll(b, "camera-roll", 0), center_at_startup(b, "center-at-startup", true), - center_method(b, "centering-method", false) + wizard_done(b, "wizard-done", false) {} }; diff --git a/opentrack/options.hpp b/opentrack/options.hpp index f8475877..f2c09479 100644 --- a/opentrack/options.hpp +++ b/opentrack/options.hpp @@ -41,7 +41,7 @@ template<typename t> using mem = std::shared_ptr<t>; #define OPENTRACK_CONFIG_FILENAME_KEY "settings-filename" #define OPENTRACK_DEFAULT_CONFIG "default.ini" -#define OPENTRACK_ORG "opentrack-2.3" +#define OPENTRACK_ORG "TrackHat opentrack-2.3" namespace options { template<typename k, typename v> diff --git a/opentrack/plugin-support.hpp b/opentrack/plugin-support.hpp index 102d11c4..3a0a3420 100644 --- a/opentrack/plugin-support.hpp +++ b/opentrack/plugin-support.hpp @@ -53,7 +53,7 @@ extern "C" typedef void* (*OPENTRACK_CTOR_FUNPTR)(void); extern "C" typedef Metadata* (*OPENTRACK_METADATA_FUNPTR)(void); struct dylib { - enum Type { Filter, Tracker, Protocol }; + enum Type { Protocol }; dylib(const QString& filename, Type t) : type(t), @@ -162,17 +162,14 @@ struct dylib { static QList<mem<dylib>> enum_libraries() { - const char* filters_n[] = { "opentrack-filter-*.", - "opentrack-tracker-*.", - "opentrack-proto-*." - }; - const Type filters_t[] = { Filter, Tracker, Protocol }; + const char* filters_n[] = { "opentrack-proto-*." }; + const Type filters_t[] = { Protocol }; QDir settingsDir( QCoreApplication::applicationDirPath() ); QList<mem<dylib>> ret; - for (int i = 0; i < 3; i++) + for (int i = 0; i < 1; i++) { QString filter = filters_n[i]; auto t = filters_t[i]; @@ -234,8 +231,6 @@ private: struct Modules { Modules() : module_list(dylib::enum_libraries()), - filter_modules(filter(dylib::Filter)), - tracker_modules(filter(dylib::Tracker)), protocol_modules(filter(dylib::Protocol)) {} QList<mem<dylib>>& filters() { return filter_modules; } diff --git a/opentrack/selected-libraries.cpp b/opentrack/selected-libraries.cpp index 63517774..e3bac0c5 100644 --- a/opentrack/selected-libraries.cpp +++ b/opentrack/selected-libraries.cpp @@ -1,33 +1,25 @@ #include "opentrack/selected-libraries.hpp" #include <QDebug> -SelectedLibraries::SelectedLibraries(QFrame* frame, dylibptr t, dylibptr p, dylibptr f) : +SelectedLibraries::SelectedLibraries(QFrame* frame, mem<ITracker> t, dylibptr p, mem<IFilter> f) : pTracker(nullptr), pFilter(nullptr), pProtocol(nullptr), correct(false) { + pTracker = t; pProtocol = make_dylib_instance<IProtocol>(p); + pFilter = f; - if (!pProtocol) + if (!pTracker || !pProtocol) { - qDebug() << "protocol dylib load failure"; + qDebug() << "dylib load failure"; return; } if(!pProtocol->correct()) { qDebug() << "protocol load failure"; - pProtocol = nullptr; - return; - } - - pTracker = make_dylib_instance<ITracker>(t); - pFilter = make_dylib_instance<IFilter>(f); - - if (!pTracker) - { - qDebug() << "tracker dylib load failure"; return; } diff --git a/opentrack/selected-libraries.hpp b/opentrack/selected-libraries.hpp index 3719b109..7779c231 100644 --- a/opentrack/selected-libraries.hpp +++ b/opentrack/selected-libraries.hpp @@ -16,7 +16,7 @@ struct SelectedLibraries { mem<ITracker> pTracker; mem<IFilter> pFilter; mem<IProtocol> pProtocol; - SelectedLibraries(QFrame* frame, dylibptr t, dylibptr p, dylibptr f); + SelectedLibraries(QFrame* frame, mem<ITracker> t, dylibptr p, mem<IFilter> f); SelectedLibraries() : pTracker(nullptr), pFilter(nullptr), pProtocol(nullptr), correct(false) {} bool correct; }; diff --git a/opentrack/tracker.cpp b/opentrack/tracker.cpp index 6411db40..1bc28b87 100644 --- a/opentrack/tracker.cpp +++ b/opentrack/tracker.cpp @@ -169,7 +169,7 @@ void Tracker::logic() double tmp[3] = { t(0) - t_b[0], t(1) - t_b[1], t(2) - t_b[2] }; t_compensate(cam, tmp, tmp, false); rmat m_; - switch (s.center_method) + switch (1) { case 0: default: @@ -210,9 +210,6 @@ void Tracker::logic() s.tcomp_tz); for (int i = 0; i < 6; i++) - value(i) += m(i).opts.zero; - - for (int i = 0; i < 6; i++) value[i] *= inverts[i] ? -1. : 1.; if (zero_) |