summaryrefslogtreecommitdiffhomepage
path: root/opentrack
diff options
context:
space:
mode:
Diffstat (limited to 'opentrack')
-rw-r--r--opentrack/main-settings.hpp11
-rw-r--r--opentrack/options.hpp2
-rw-r--r--opentrack/plugin-support.hpp13
-rw-r--r--opentrack/selected-libraries.cpp18
-rw-r--r--opentrack/selected-libraries.hpp2
-rw-r--r--opentrack/tracker.cpp2
6 files changed, 16 insertions, 32 deletions
diff --git a/opentrack/main-settings.hpp b/opentrack/main-settings.hpp
index 8c49f86a..96520fe9 100644
--- a/opentrack/main-settings.hpp
+++ b/opentrack/main-settings.hpp
@@ -15,11 +15,9 @@
using namespace options;
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-sign"), false),
altp(b, n(pfx, "alt-axis-sign"), false),
src(b, n(pfx, "source-index"), idx)
@@ -31,16 +29,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<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),
@@ -54,6 +50,7 @@ struct main_settings : opts {
camera_yaw(b, "camera-yaw", 0),
camera_pitch(b, "camera-pitch", 0),
camera_roll(b, "camera-roll", 0),
- center_at_startup(b, "center-at-startup", true)
+ center_at_startup(b, "center-at-startup", true),
+ wizard_done(b, "wizard-done", false)
{}
};
diff --git a/opentrack/options.hpp b/opentrack/options.hpp
index f4deb8a1..9768bc43 100644
--- a/opentrack/options.hpp
+++ b/opentrack/options.hpp
@@ -40,7 +40,7 @@ template<typename t> using mem = std::shared_ptr<t>;
#define OPENTRACK_CONFIG_FILENAME_KEY "settings-file"
#define OPENTRACK_DEFAULT_CONFIG_PATH "/settings/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 ec8bb3c8..78443cae 100644
--- a/opentrack/plugin-support.hpp
+++ b/opentrack/plugin-support.hpp
@@ -52,7 +52,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),
@@ -161,17 +161,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];
@@ -225,8 +222,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 e03342e4..e9d85f5d 100644
--- a/opentrack/tracker.cpp
+++ b/opentrack/tracker.cpp
@@ -46,7 +46,7 @@ double Tracker::map(double pos, Mapping& axis)
axis.curve.setTrackingActive( !altp );
axis.curveAlt.setTrackingActive( altp );
auto& fc = altp ? axis.curveAlt : axis.curve;
- return fc.getValue(pos) + axis.opts.zero;
+ return fc.getValue(pos);
}
void Tracker::t_compensate(const rmat& rmat, const double* xyz, double* output, bool rz)