summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ftnoir_filter_accela/ftnoir_filter_accela.cpp13
-rw-r--r--ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp4
-rw-r--r--ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp5
-rw-r--r--ftnoir_filter_ewma2/ftnoir_filter_ewma2.h2
-rw-r--r--ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp5
-rw-r--r--ftnoir_filter_ewma2/ftnoir_filter_ewma_dll.cpp7
-rwxr-xr-xftnoir_filter_kalman/ftnoir_filter_kalman.h8
-rw-r--r--ftnoir_filter_kalman/kalman.cpp14
-rw-r--r--ftnoir_protocol_fg/ftnoir_protocol_fg.cpp5
-rw-r--r--ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp4
-rw-r--r--ftnoir_protocol_fg/ftnoir_protocol_fg_dll.cpp32
-rw-r--r--ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.cpp5
-rw-r--r--ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc_dialog.cpp4
-rw-r--r--ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc_dll.cpp31
-rw-r--r--ftnoir_protocol_ft/ftnoir_protocol_ft.cpp5
-rw-r--r--ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp4
-rw-r--r--ftnoir_protocol_ft/ftnoir_protocol_ft_dll.cpp7
-rw-r--r--ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp5
-rw-r--r--ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp5
-rw-r--r--ftnoir_protocol_ftn/ftnoir_protocol_ftn_dll.cpp31
-rw-r--r--ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp5
-rw-r--r--ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dll.cpp8
-rw-r--r--ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp5
-rw-r--r--ftnoir_protocol_mouse/ftnoir_protocol_mouse_dialog.cpp4
-rw-r--r--ftnoir_protocol_mouse/ftnoir_protocol_mouse_dll.cpp31
-rw-r--r--ftnoir_protocol_sc/ftnoir_protocol_sc.cpp5
-rw-r--r--ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp4
-rw-r--r--ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp32
-rw-r--r--ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp5
-rw-r--r--ftnoir_protocol_vjoy/ftnoir_protocol_vjoy_dialog.cpp4
-rw-r--r--ftnoir_protocol_vjoy/ftnoir_protocol_vjoy_dll.cpp8
-rw-r--r--ftnoir_protocol_wine/ftnoir_protocol_wine.cpp5
-rw-r--r--ftnoir_protocol_wine/ftnoir_protocol_wine_dll.cpp7
-rw-r--r--ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp28
-rw-r--r--ftnoir_tracker_aruco/ftnoir_tracker_aruco.h6
-rw-r--r--ftnoir_tracker_aruco/ftnoir_tracker_aruco_dll.h18
-rw-r--r--ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.cpp5
-rw-r--r--ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp_dialog.cpp4
-rw-r--r--ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp_dll.cpp7
-rw-r--r--ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp8
-rw-r--r--ftnoir_tracker_hatire/ftnoir_tracker_hat.h17
-rw-r--r--ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.cpp3
-rw-r--r--ftnoir_tracker_hatire/ftnoir_tracker_hat_dll.cpp102
-rw-r--r--ftnoir_tracker_ht/ftnoir_tracker_ht.cpp18
-rw-r--r--ftnoir_tracker_ht/ftnoir_tracker_ht.h6
-rw-r--r--ftnoir_tracker_ht/ftnoir_tracker_ht_dll.h7
-rw-r--r--ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp5
-rw-r--r--ftnoir_tracker_hydra/ftnoir_tracker_hydra_dialog.cpp4
-rw-r--r--ftnoir_tracker_hydra/ftnoir_tracker_hydra_dll.cpp9
-rw-r--r--ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp5
-rw-r--r--ftnoir_tracker_joystick/ftnoir_tracker_joystick_dialog.cpp5
-rw-r--r--ftnoir_tracker_joystick/ftnoir_tracker_joystick_dll.cpp7
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt.cpp7
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt.h6
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp4
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt_dll.cpp20
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt_dll.h24
-rw-r--r--ftnoir_tracker_rift/ftnoir_tracker_rift.cpp5
-rw-r--r--ftnoir_tracker_rift/ftnoir_tracker_rift_dialog.cpp4
-rw-r--r--ftnoir_tracker_rift/ftnoir_tracker_rift_dll.cpp9
-rw-r--r--ftnoir_tracker_udp/ftnoir_tracker_udp.cpp6
-rw-r--r--ftnoir_tracker_udp/ftnoir_tracker_udp.h1
-rw-r--r--ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp4
-rw-r--r--ftnoir_tracker_udp/ftnoir_tracker_udp_dll.cpp7
64 files changed, 66 insertions, 614 deletions
diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.cpp b/ftnoir_filter_accela/ftnoir_filter_accela.cpp
index 5d89bc96..c4b329e1 100644
--- a/ftnoir_filter_accela/ftnoir_filter_accela.cpp
+++ b/ftnoir_filter_accela/ftnoir_filter_accela.cpp
@@ -30,8 +30,8 @@ static constexpr double trans_gains[][2] = {
{ 2, 150 },
{ 1.66, 60 },
{ 1.33, 20 },
- { 1, 4 },
- { .66, 1.5 },
+ { 1, 2 },
+ { .66, .6 },
{ .33, .2 },
{ 0, 0 },
{ -1, 0 }
@@ -104,12 +104,5 @@ void FTNoIR_Filter::filter(const double* input, double *output)
}
}
-extern "C" OPENTRACK_EXPORT IFilter* GetConstructor()
-{
- return new FTNoIR_Filter;
-}
+OPENTRACK_DECLARE_FILTER(FTNoIR_Filter, FilterControls, FTNoIR_FilterDll)
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-{
- return new FTNoIR_FilterDll;
-}
diff --git a/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp b/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp
index dbac8362..2c25ac33 100644
--- a/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp
+++ b/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp
@@ -85,7 +85,3 @@ void FilterControls::update_trans_dz_display(int value)
ui.trans_dz->setText(QString::number(value * s.mult_trans_dz) + "mm");
}
-extern "C" OPENTRACK_EXPORT IFilterDialog* GetDialog()
-{
- return new FilterControls;
-}
diff --git a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp
index 86cc2a96..c09fb912 100644
--- a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp
+++ b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp
@@ -78,7 +78,4 @@ void FTNoIR_Filter::filter(const double *input, double *output)
}
}
-extern "C" OPENTRACK_EXPORT IFilter* GetConstructor()
-{
- return new FTNoIR_Filter;
-}
+OPENTRACK_DECLARE_FILTER(FTNoIR_Filter, FilterControls, FTNoIR_FilterDll)
diff --git a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h
index 9f603b25..bf4e83ad 100644
--- a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h
+++ b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h
@@ -62,5 +62,5 @@ class FTNoIR_FilterDll : public Metadata
{
public:
QString name() { return QString("EWMA"); }
- QIcon icon() { return QIcon(":/images/filter-16.png"); }
+ QIcon icon() { return QIcon(":/images/filter-16.png"); }
};
diff --git a/ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp b/ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp
index 228bc086..30fb6003 100644
--- a/ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp
+++ b/ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp
@@ -41,8 +41,3 @@ void FilterControls::save() {
if (pFilter)
pFilter->receiveSettings();
}
-
-extern "C" OPENTRACK_EXPORT IFilterDialog* GetDialog( )
-{
- return new FilterControls;
-}
diff --git a/ftnoir_filter_ewma2/ftnoir_filter_ewma_dll.cpp b/ftnoir_filter_ewma2/ftnoir_filter_ewma_dll.cpp
deleted file mode 100644
index 999dcd6f..00000000
--- a/ftnoir_filter_ewma2/ftnoir_filter_ewma_dll.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "ftnoir_filter_ewma2.h"
-#include "opentrack/plugin-api.hpp"
-
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-{
- return new FTNoIR_FilterDll;
-}
diff --git a/ftnoir_filter_kalman/ftnoir_filter_kalman.h b/ftnoir_filter_kalman/ftnoir_filter_kalman.h
index e84ef347..a6f40bb7 100755
--- a/ftnoir_filter_kalman/ftnoir_filter_kalman.h
+++ b/ftnoir_filter_kalman/ftnoir_filter_kalman.h
@@ -27,7 +27,7 @@ struct settings : opts {
{}
};
-class OPENTRACK_EXPORT FTNoIR_Filter : public IFilter
+class FTNoIR_Filter : public IFilter
{
public:
FTNoIR_Filter();
@@ -44,14 +44,14 @@ public:
int prev_slider_pos;
};
-class OPENTRACK_EXPORT FTNoIR_FilterDll : public Metadata
+class FTNoIR_FilterDll : public Metadata
{
public:
QString name() { return QString("Kalman"); }
- QIcon icon() { return QIcon(":/images/filter-16.png"); }
+ QIcon icon() { return QIcon(":/images/filter-16.png"); }
};
-class OPENTRACK_EXPORT FilterControls: public IFilterDialog
+class FilterControls: public IFilterDialog
{
Q_OBJECT
public:
diff --git a/ftnoir_filter_kalman/kalman.cpp b/ftnoir_filter_kalman/kalman.cpp
index 08b46f0f..f0b9e261 100644
--- a/ftnoir_filter_kalman/kalman.cpp
+++ b/ftnoir_filter_kalman/kalman.cpp
@@ -124,16 +124,4 @@ void FilterControls::doCancel() {
close();
}
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-{
- return new FTNoIR_FilterDll;
-}
-
-extern "C" OPENTRACK_EXPORT IFilter* GetConstructor()
-{
- return new FTNoIR_Filter;
-}
-
-extern "C" OPENTRACK_EXPORT IFilterDialog* GetDialog() {
- return new FilterControls;
-}
+OPENTRACK_DECLARE_FILTER(FTNoIR_Filter, FilterControls, FTNoIR_FilterDll)
diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp b/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp
index 85dd4684..ced1acf8 100644
--- a/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp
+++ b/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp
@@ -52,7 +52,4 @@ bool FTNoIR_Protocol::correct()
return outSocket.bind(QHostAddress::Any, 0, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint);
}
-extern "C" OPENTRACK_EXPORT IProtocol* GetConstructor()
-{
- return new FTNoIR_Protocol;
-}
+OPENTRACK_DECLARE_PROTOCOL(FTNoIR_Protocol, FGControls, FTNoIR_ProtocolDll)
diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp b/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp
index d15c9466..04830c0b 100644
--- a/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp
+++ b/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp
@@ -61,7 +61,3 @@ void FGControls::doCancel() {
this->close();
}
-extern "C" OPENTRACK_EXPORT IProtocolDialog* GetDialog( )
-{
- return new FGControls;
-}
diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg_dll.cpp b/ftnoir_protocol_fg/ftnoir_protocol_fg_dll.cpp
deleted file mode 100644
index aaaa1d63..00000000
--- a/ftnoir_protocol_fg/ftnoir_protocol_fg_dll.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/********************************************************************************
-* FaceTrackNoIR This program is a private project of some enthusiastic *
-* gamers from Holland, who don't like to pay much for *
-* head-tracking. *
-* *
-* Copyright (C) 2012 Wim Vriend (Developing) *
-* Ron Hendriks (Researching and Testing) *
-* *
-* Homepage *
-* *
-* This program is free software; you can redistribute it and/or modify it *
-* under the terms of the GNU General Public License as published by the *
-* Free Software Foundation; either version 3 of the License, or (at your *
-* option) any later version. *
-* *
-* This program is distributed in the hope that it will be useful, but *
-* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
-* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
-* more details. *
-* *
-* You should have received a copy of the GNU General Public License along *
-* with this program; if not, see <http://www.gnu.org/licenses/>. *
-* *
-********************************************************************************/
-#include "ftnoir_protocol_fg.h"
-#include <QDebug>
-#include "opentrack/plugin-api.hpp"
-
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-{
- return new FTNoIR_ProtocolDll;
-}
diff --git a/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.cpp b/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.cpp
index 20a39fbc..a7bb4a39 100644
--- a/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.cpp
+++ b/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.cpp
@@ -158,7 +158,4 @@ bool FTNoIR_Protocol::correct()
return true;
}
-extern "C" OPENTRACK_EXPORT FTNoIR_Protocol* GetConstructor(void)
-{
- return new FTNoIR_Protocol;
-}
+OPENTRACK_DECLARE_PROTOCOL(FTNoIR_Protocol, FSUIPCControls, FTNoIR_ProtocolDll)
diff --git a/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc_dialog.cpp b/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc_dialog.cpp
index d38eae71..14fe54bf 100644
--- a/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc_dialog.cpp
+++ b/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc_dialog.cpp
@@ -55,7 +55,3 @@ void FSUIPCControls::getLocationOfDLL()
}
}
-extern "C" OPENTRACK_EXPORT IProtocolDialog* GetDialog(void)
-{
- return new FSUIPCControls;
-}
diff --git a/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc_dll.cpp b/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc_dll.cpp
deleted file mode 100644
index 19ecf351..00000000
--- a/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc_dll.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/********************************************************************************
-* FaceTrackNoIR This program is a private project of some enthusiastic *
-* gamers from Holland, who don't like to pay much for *
-* head-tracking. *
-* *
-* Copyright (C) 2012 Wim Vriend (Developing) *
-* Ron Hendriks (Researching and Testing) *
-* *
-* Homepage *
-* *
-* This program is free software; you can redistribute it and/or modify it *
-* under the terms of the GNU General Public License as published by the *
-* Free Software Foundation; either version 3 of the License, or (at your *
-* option) any later version. *
-* *
-* This program is distributed in the hope that it will be useful, but *
-* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
-* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
-* more details. *
-* *
-* You should have received a copy of the GNU General Public License along *
-* with this program; if not, see <http://www.gnu.org/licenses/>. *
-* *
-********************************************************************************/
-#include "ftnoir_protocol_fsuipc.h"
-#include "opentrack/plugin-api.hpp"
-
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata(void)
-{
- return new FTNoIR_ProtocolDll;
-}
diff --git a/ftnoir_protocol_ft/ftnoir_protocol_ft.cpp b/ftnoir_protocol_ft/ftnoir_protocol_ft.cpp
index 56ae061f..73bf834a 100644
--- a/ftnoir_protocol_ft/ftnoir_protocol_ft.cpp
+++ b/ftnoir_protocol_ft/ftnoir_protocol_ft.cpp
@@ -178,7 +178,4 @@ bool FTNoIR_Protocol::correct()
return true;
}
-extern "C" OPENTRACK_EXPORT IProtocol* GetConstructor()
-{
- return new FTNoIR_Protocol;
-}
+OPENTRACK_DECLARE_PROTOCOL(FTNoIR_Protocol, FTControls, FTNoIR_ProtocolDll)
diff --git a/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp b/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp
index 3e440607..db0165b5 100644
--- a/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp
+++ b/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp
@@ -72,7 +72,3 @@ void FTControls::selectDLL() {
}
}
-extern "C" OPENTRACK_EXPORT IProtocolDialog* GetDialog()
-{
- return new FTControls;
-}
diff --git a/ftnoir_protocol_ft/ftnoir_protocol_ft_dll.cpp b/ftnoir_protocol_ft/ftnoir_protocol_ft_dll.cpp
deleted file mode 100644
index 13506022..00000000
--- a/ftnoir_protocol_ft/ftnoir_protocol_ft_dll.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "opentrack/plugin-api.hpp"
-#include "ftnoir_protocol_ft/ftnoir_protocol_ft.h"
-
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-{
- return new FTNoIR_ProtocolDll;
-}
diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp
index f5911b2a..6aed5210 100644
--- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp
+++ b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp
@@ -48,7 +48,4 @@ bool FTNoIR_Protocol::correct()
return outSocket.bind(QHostAddress::Any, 0, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint);
}
-extern "C" OPENTRACK_EXPORT IProtocol* GetConstructor()
-{
- return new FTNoIR_Protocol;
-}
+OPENTRACK_DECLARE_PROTOCOL(FTNoIR_Protocol, FTNControls, FTNoIR_ProtocolDll)
diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp b/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp
index 8104a9de..8a66f13b 100644
--- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp
+++ b/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp
@@ -54,8 +54,3 @@ void FTNControls::doCancel() {
s.b->reload();
this->close();
}
-
-extern "C" OPENTRACK_EXPORT IProtocolDialog* GetDialog( )
-{
- return new FTNControls;
-}
diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dll.cpp b/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dll.cpp
deleted file mode 100644
index d1fa3e33..00000000
--- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dll.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/********************************************************************************
-* FaceTrackNoIR This program is a private project of some enthusiastic *
-* gamers from Holland, who don't like to pay much for *
-* head-tracking. *
-* *
-* Copyright (C) 2012 Wim Vriend (Developing) *
-* Ron Hendriks (Researching and Testing) *
-* *
-* Homepage *
-* *
-* This program is free software; you can redistribute it and/or modify it *
-* under the terms of the GNU General Public License as published by the *
-* Free Software Foundation; either version 3 of the License, or (at your *
-* option) any later version. *
-* *
-* This program is distributed in the hope that it will be useful, but *
-* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
-* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
-* more details. *
-* *
-* You should have received a copy of the GNU General Public License along *
-* with this program; if not, see <http://www.gnu.org/licenses/>. *
-* *
-********************************************************************************/
-#include "ftnoir_protocol_ftn.h"
-#include "opentrack/plugin-api.hpp"
-
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-{
- return new FTNoIR_ProtocolDll;
-}
diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp
index f0479e0d..96805b39 100644
--- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp
+++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp
@@ -94,7 +94,4 @@ void FTNoIR_Protocol::pose(const double* headpose) {
(void) libevdev_uinput_write_event(uidev, EV_SYN, SYN_REPORT, 0);
}
-extern "C" OPENTRACK_EXPORT IProtocol* GetConstructor()
-{
- return new FTNoIR_Protocol;
-}
+OPENTRACK_DECLARE_PROTOCOL(FTNoIR_Protocol, LibevdevControls, FTNoIR_ProtocolDll)
diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dll.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dll.cpp
deleted file mode 100644
index 9a16ea52..00000000
--- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dll.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "ftnoir_protocol_libevdev.h"
-#include <QDebug>
-#include "opentrack/plugin-api.hpp"
-
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-{
- return new FTNoIR_ProtocolDll;
-}
diff --git a/ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp b/ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp
index ebf1ad19..6b7c52b2 100644
--- a/ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp
+++ b/ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp
@@ -72,7 +72,4 @@ bool FTNoIR_Protocol::correct()
return true;
}
-extern "C" OPENTRACK_EXPORT IProtocol* GetConstructor()
-{
- return new FTNoIR_Protocol;
-}
+OPENTRACK_DECLARE_PROTOCOL(FTNoIR_Protocol, MOUSEControls, FTNoIR_ProtocolDll)
diff --git a/ftnoir_protocol_mouse/ftnoir_protocol_mouse_dialog.cpp b/ftnoir_protocol_mouse/ftnoir_protocol_mouse_dialog.cpp
index f4ecaa48..6633ee8c 100644
--- a/ftnoir_protocol_mouse/ftnoir_protocol_mouse_dialog.cpp
+++ b/ftnoir_protocol_mouse/ftnoir_protocol_mouse_dialog.cpp
@@ -61,7 +61,3 @@ void MOUSEControls::doCancel() {
this->close();
}
-extern "C" OPENTRACK_EXPORT IProtocolDialog* GetDialog( )
-{
- return new MOUSEControls;
-}
diff --git a/ftnoir_protocol_mouse/ftnoir_protocol_mouse_dll.cpp b/ftnoir_protocol_mouse/ftnoir_protocol_mouse_dll.cpp
deleted file mode 100644
index 7bc2b85c..00000000
--- a/ftnoir_protocol_mouse/ftnoir_protocol_mouse_dll.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/********************************************************************************
-* FaceTrackNoIR This program is a private project of some enthusiastic *
-* gamers from Holland, who don't like to pay much for *
-* head-tracking. *
-* *
-* Copyright (C) 2012 Wim Vriend (Developing) *
-* Ron Hendriks (Researching and Testing) *
-* *
-* Homepage *
-* *
-* This program is free software; you can redistribute it and/or modify it *
-* under the terms of the GNU General Public License as published by the *
-* Free Software Foundation; either version 3 of the License, or (at your *
-* option) any later version. *
-* *
-* This program is distributed in the hope that it will be useful, but *
-* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
-* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
-* more details. *
-* *
-* You should have received a copy of the GNU General Public License along *
-* with this program; if not, see <http://www.gnu.org/licenses/>. *
-* *
-********************************************************************************/
-#include "ftnoir_protocol_mouse.h"
-#include "opentrack/plugin-api.hpp"
-
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-{
- return new FTNoIR_ProtocolDll;
-}
diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp
index 7d4e09f9..ef695623 100644
--- a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp
+++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp
@@ -203,7 +203,4 @@ void CALLBACK FTNoIR_Protocol::processNextSimconnectEvent(SIMCONNECT_RECV* pData
}
}
-extern "C" OPENTRACK_EXPORT IProtocol* GetConstructor()
-{
- return new FTNoIR_Protocol;
-}
+OPENTRACK_DECLARE_PROTOCOL(FTNoIR_Protocol, SCControls, FTNoIR_ProtocolDll)
diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp
index 30f7d460..5aa6f5f9 100644
--- a/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp
+++ b/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp
@@ -47,7 +47,3 @@ void SCControls::doCancel() {
close();
}
-extern "C" OPENTRACK_EXPORT IProtocolDialog* GetDialog( )
-{
- return new SCControls;
-}
diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp
deleted file mode 100644
index 937ffe0c..00000000
--- a/ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/********************************************************************************
-* FaceTrackNoIR This program is a private project of some enthusiastic *
-* gamers from Holland, who don't like to pay much for *
-* head-tracking. *
-* *
-* Copyright (C) 2012 Wim Vriend (Developing) *
-* Ron Hendriks (Researching and Testing) *
-* *
-* Homepage *
-* *
-* This program is free software; you can redistribute it and/or modify it *
-* under the terms of the GNU General Public License as published by the *
-* Free Software Foundation; either version 3 of the License, or (at your *
-* option) any later version. *
-* *
-* This program is distributed in the hope that it will be useful, but *
-* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
-* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
-* more details. *
-* *
-* You should have received a copy of the GNU General Public License along *
-* with this program; if not, see <http://www.gnu.org/licenses/>. *
-* *
-********************************************************************************/
-#include "ftnoir_protocol_sc.h"
-#include <QDebug>
-#include "opentrack/plugin-api.hpp"
-
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-{
- return new FTNoIR_ProtocolDll;
-}
diff --git a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp
index 63f75685..24148c63 100644
--- a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp
+++ b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp
@@ -30,7 +30,4 @@ void FTNoIR_Protocol::pose( const double *headpose ) {
VJoy_UpdateJoyState(0, state);
}
-extern "C" OPENTRACK_EXPORT IProtocol* GetConstructor()
-{
- return new FTNoIR_Protocol;
-}
+OPENTRACK_DECLARE_PROTOCOL(FTNoIR_Protocol, VJoyControls, FTNoIR_ProtocolDll)
diff --git a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy_dialog.cpp b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy_dialog.cpp
index 8da3ccfd..08c65558 100644
--- a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy_dialog.cpp
+++ b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy_dialog.cpp
@@ -20,7 +20,3 @@ void VJoyControls::doCancel() {
void VJoyControls::save() {
}
-extern "C" OPENTRACK_EXPORT IProtocolDialog* GetDialog( )
-{
- return new VJoyControls;
-}
diff --git a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy_dll.cpp b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy_dll.cpp
deleted file mode 100644
index fc30921d..00000000
--- a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy_dll.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "ftnoir_protocol_vjoy.h"
-#include <QDebug>
-#include "opentrack/plugin-api.hpp"
-
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-{
- return new FTNoIR_ProtocolDll;
-}
diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp
index 5f80944a..99ad30a2 100644
--- a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp
+++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp
@@ -56,7 +56,4 @@ bool FTNoIR_Protocol::correct()
return lck_shm.success();
}
-extern "C" OPENTRACK_EXPORT void* GetConstructor()
-{
- return (IProtocol*) new FTNoIR_Protocol;
-}
+OPENTRACK_DECLARE_PROTOCOL(FTNoIR_Protocol, FTControls, FTNoIR_ProtocolDll)
diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine_dll.cpp b/ftnoir_protocol_wine/ftnoir_protocol_wine_dll.cpp
deleted file mode 100644
index 92faaa94..00000000
--- a/ftnoir_protocol_wine/ftnoir_protocol_wine_dll.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "ftnoir_protocol_wine.h"
-#include "opentrack/plugin-api.hpp"
-
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-{
- return new FTNoIR_ProtocolDll;
-}
diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp
index 6d87503f..f7e283f3 100644
--- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp
+++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp
@@ -372,32 +372,6 @@ void Tracker::data(double *data)
data[TZ] = pose[TZ] * .1;
}
-class TrackerDll : public Metadata
-{
- QString name() { return QString("aruco -- paper marker tracker"); }
- QIcon icon() { return QIcon(":/images/aruco.png"); }
-};
-
-//-----------------------------------------------------------------------------
-//#pragma comment(linker, "/export:GetTrackerDll=_GetTrackerDll@0")
-
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-{
- return new TrackerDll;
-}
-
-//#pragma comment(linker, "/export:GetTracker=_GetTracker@0")
-
-extern "C" OPENTRACK_EXPORT ITracker* GetConstructor()
-{
- return new Tracker;
-}
-
-extern "C" OPENTRACK_EXPORT ITrackerDialog* GetDialog( )
-{
- return new TrackerControls;
-}
-
TrackerControls::TrackerControls()
{
tracker = nullptr;
@@ -472,3 +446,5 @@ void TrackerControls::camera_settings()
{
open_camera_settings(tracker ? &tracker->camera : nullptr, s.camera_name, tracker ? &tracker->camera_mtx : nullptr);
}
+
+OPENTRACK_DECLARE_TRACKER(Tracker, TrackerControls, TrackerDll)
diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h
index 297fecdb..ae574338 100644
--- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h
+++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h
@@ -90,3 +90,9 @@ private slots:
void update_tracker_calibration();
void camera_settings();
};
+
+class TrackerDll : public Metadata
+{
+ QString name() { return QString("aruco -- paper marker tracker"); }
+ QIcon icon() { return QIcon(":/images/aruco.png"); }
+};
diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco_dll.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco_dll.h
deleted file mode 100644
index ac393bfb..00000000
--- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco_dll.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Copyright (c) 2013 Stanisław Halik <sthalik@misaki.pl>
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- */
-
-#include "opentrack/plugin-api.hpp"
-
-//-----------------------------------------------------------------------------
-class TrackerDll : public Metadata
-{
- // ITrackerDll interface
- void getFullName(QString *strToBeFilled);
- void getShortName(QString *strToBeFilled);
- void getDescription(QString *strToBeFilled);
- void getIcon(QIcon *icon);
-};
diff --git a/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.cpp b/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.cpp
index 540ef616..1525e3c4 100644
--- a/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.cpp
+++ b/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp.cpp
@@ -115,7 +115,4 @@ void TrackerImpl::data(double *data)
data[Roll] = pose[Roll];
}
-extern "C" OPENTRACK_EXPORT ITracker* GetConstructor()
-{
- return new TrackerImpl;
-}
+OPENTRACK_DECLARE_TRACKER(TrackerImpl, TrackerDialog, TrackerMeta)
diff --git a/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp_dialog.cpp b/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp_dialog.cpp
index 1f17355f..55427d35 100644
--- a/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp_dialog.cpp
+++ b/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp_dialog.cpp
@@ -28,7 +28,3 @@ void TrackerDialog::doCancel() {
this->close();
}
-extern "C" OPENTRACK_EXPORT ITrackerDialog* GetDialog()
-{
- return new TrackerDialog;
-}
diff --git a/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp_dll.cpp b/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp_dll.cpp
deleted file mode 100644
index 5b08f040..00000000
--- a/ftnoir_tracker_freepie-udp/ftnoir_tracker_freepie-udp_dll.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "ftnoir_tracker_freepie-udp.h"
-#include "opentrack/plugin-api.hpp"
-
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-{
- return new TrackerMeta;
-}
diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp b/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp
index 5a4e9c74..72b7d3ed 100644
--- a/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp
+++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp
@@ -603,11 +603,13 @@ void FTNoIR_Tracker::Log(QString message)
// _GetTracker@0 - Common name decoration for __stdcall functions in C language.
////////////////////////////////////////////////////////////////////////////////
#ifdef OPENTRACK_API
-extern "C" OPENTRACK_EXPORT ITracker* GetConstructor()
+#include "ftnoir_tracker_hat_dialog.h"
+OPENTRACK_DECLARE_TRACKER(FTNoIR_Tracker, TrackerControls, TrackerDll)
#else
#pragma comment(linker, "/export:GetTracker=_GetTracker@0")
FTNOIR_TRACKER_BASE_EXPORT ITrackerPtr __stdcall GetTracker()
-#endif
{
- return new FTNoIR_Tracker;
+ return new FTNoIR_Tracker;
}
+#endif
+
diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat.h b/ftnoir_tracker_hatire/ftnoir_tracker_hat.h
index 9471ebfb..e3c5a26b 100644
--- a/ftnoir_tracker_hatire/ftnoir_tracker_hat.h
+++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat.h
@@ -123,36 +123,35 @@ private:
//*******************************************************************************************************
// FaceTrackNoIR Tracker DLL. Functions used to get general info on the Tracker
//*******************************************************************************************************
-class TrackerDll :
#if defined(OPENTRACK_API)
-public Metadata
+class TrackerDll : public Metadata
+{
+ QString name() { return QString("Hatire Arduino"); }
+ QIcon icon() { return QIcon(":/images/hatire.png"); }
+};
#else
+class TrackerDll :
+public Metadata
public ITrackerDll
-#endif
{
public:
TrackerDll();
~TrackerDll();
-#ifndef OPENTRACK_API
void Initialize();
-#endif
-#ifdef OPENTRACK_API
QString name();
QIcon icon();
-#else
void getFullName(QString *strToBeFilled);
void getShortName(QString *strToBeFilled);
void getDescription(QString *strToBeFilled);
void getIcon(QIcon *icon);
-#endif
private:
QString trackerFullName; // Trackers' name and description
QString trackerShortName;
QString trackerDescription;
};
-
+#endif
#endif // FTNOIR_TRACKER_HAT_H
diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.cpp b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.cpp
index b22e3b15..901f0ec9 100644
--- a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.cpp
+++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.cpp
@@ -418,12 +418,11 @@ void TrackerControls::unRegisterTracker()
// Win32 API function.
// _GetTrackerDialog@0 - Common name decoration for __stdcall functions in C language.
#ifdef OPENTRACK_API
-extern "C" OPENTRACK_EXPORT ITrackerDialog* GetDialog( )
#else
#pragma comment(linker, "/export:GetTrackerDialog=_GetTrackerDialog@0")
FTNOIR_TRACKER_BASE_EXPORT ITrackerDialogPtr __stdcall GetTrackerDialog( )
-#endif
{
return new TrackerControls;
}
+#endif
diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dll.cpp b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dll.cpp
deleted file mode 100644
index 66fead4f..00000000
--- a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dll.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/********************************************************************************
-* FaceTrackNoIR This program is a private project of some enthusiastic *
-* gamers from Holland, who don't like to pay much for *
-* head-tracking. *
-* *
-* Copyright (C) 2012 Wim Vriend (Developing) *
-* Ron Hendriks (Researching and Testing) *
-* Homepage: http://facetracknoir.sourceforge.net/home/default.htm *
-* *
-* Copyright (C) 2012 FuraX49 (HAT Tracker plugins) *
-* Homepage: http://hatire.sourceforge.net *
-* *
-* This program is free software; you can redistribute it and/or modify it *
-* under the terms of the GNU General Public License as published by the *
-* Free Software Foundation; either version 3 of the License, or (at your *
-* option) any later version. *
-* *
-* This program is distributed in the hope that it will be useful, but *
-* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
-* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
-* more details. *
-* *
-* You should have received a copy of the GNU General Public License along *
-* with this program; if not, see <http://www.gnu.org/licenses/>. *
-* *
-********************************************************************************/
-
-#include "ftnoir_tracker_hat.h"
-#include <QIcon>
-#include <QDebug>
-
-TrackerDll::TrackerDll() {
- //populate the description strings
- trackerFullName = "Hatire Arduino";
- trackerShortName = "HAT";
- trackerDescription = "FaceTrackNoIR HAT";
-}
-
-TrackerDll::~TrackerDll()
-{
-
-}
-
-#ifndef OPENTRACK_API
-void TrackerDll::Initialize()
-{
- return;
-}
-#endif
-
-#ifndef OPENTRACK_API
-void TrackerDll::getFullName(QString *strToBeFilled)
-{
- *strToBeFilled = trackerFullName;
-}
-
-void TrackerDll::getShortName(QString *strToBeFilled)
-{
- *strToBeFilled = trackerShortName;
-}
-
-void TrackerDll::getDescription(QString *strToBeFilled)
-{
- *strToBeFilled = trackerDescription;
-}
-
-void TrackerDll::getIcon(QIcon *icon)
-{
- *icon = QIcon(":/images/hat.png");
-}
-#else
-
-QString TrackerDll::name()
-{
- return trackerFullName;
-}
-
-QIcon TrackerDll::icon()
-{
- return QIcon(":/images/hat.png");
-}
-
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// Factory function that creates instances if the Tracker object.
-
-// Export both decorated and undecorated names.
-// GetTrackerDll - Undecorated name, which can be easily used with GetProcAddress
-// Win32 API function.
-// _GetTrackerDll@0 - Common name decoration for __stdcall functions in C language.
-
-#ifdef OPENTRACK_API
-# include "opentrack/plugin-support.hpp"
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-#else
-# pragma comment(linker, "/export:GetTrackerDll=_GetTrackerDll@0")
-FTNOIR_TRACKER_BASE_EXPORT ITrackerDllPtr __stdcall GetTrackerDll()
-#endif
-{
- return new TrackerDll;
-}
diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp
index 577ae40d..86992911 100644
--- a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp
+++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp
@@ -1,7 +1,6 @@
#include "stdafx.h"
#include "headtracker-ftnoir.h"
#include "ftnoir_tracker_ht.h"
-#include "ftnoir_tracker_ht_dll.h"
#include "ui_ht-trackercontrols.h"
#include "opentrack/plugin-api.hpp"
#include <cmath>
@@ -182,21 +181,6 @@ void Tracker::data(double* data)
}
}
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-{
- return new TrackerDll;
-}
-
-extern "C" OPENTRACK_EXPORT ITracker* GetConstructor()
-{
- return new Tracker;
-}
-
-extern "C" OPENTRACK_EXPORT ITrackerDialog* GetDialog( )
-{
- return new TrackerControls;
-}
-
TrackerControls::TrackerControls() : tracker(nullptr)
{
ui.setupUi(this);
@@ -235,3 +219,5 @@ void TrackerControls::camera_settings()
else
open_camera_settings(nullptr, s.camera_name, nullptr);
}
+
+OPENTRACK_DECLARE_TRACKER(Tracker, TrackerControls, TrackerDll)
diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.h b/ftnoir_tracker_ht/ftnoir_tracker_ht.h
index b2fcb147..32fb6949 100644
--- a/ftnoir_tracker_ht/ftnoir_tracker_ht.h
+++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.h
@@ -81,3 +81,9 @@ private slots:
void doCancel();
void camera_settings();
};
+
+class TrackerDll : public Metadata
+{
+ QString name() { return QString("ht -- face tracker"); }
+ QIcon icon() { return QIcon(":/images/ht.png"); }
+};
diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht_dll.h b/ftnoir_tracker_ht/ftnoir_tracker_ht_dll.h
deleted file mode 100644
index 853d3181..00000000
--- a/ftnoir_tracker_ht/ftnoir_tracker_ht_dll.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "opentrack/plugin-api.hpp"
-
-class TrackerDll : public Metadata
-{
- QString name() { return QString("ht -- face tracker"); }
- QIcon icon() { return QIcon(":/images/ht.png"); }
-};
diff --git a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp
index 826cecaa..8d0e6832 100644
--- a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp
+++ b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp
@@ -43,7 +43,4 @@ void Hydra_Tracker::data(double *data)
data[Roll] = ypr[2] * r2d;
}
-extern "C" OPENTRACK_EXPORT ITracker* GetConstructor()
-{
- return new Hydra_Tracker;
-}
+OPENTRACK_DECLARE_TRACKER(Hydra_Tracker, TrackerControls, FTNoIR_TrackerDll)
diff --git a/ftnoir_tracker_hydra/ftnoir_tracker_hydra_dialog.cpp b/ftnoir_tracker_hydra/ftnoir_tracker_hydra_dialog.cpp
index 83b48a8e..2c23ee46 100644
--- a/ftnoir_tracker_hydra/ftnoir_tracker_hydra_dialog.cpp
+++ b/ftnoir_tracker_hydra/ftnoir_tracker_hydra_dialog.cpp
@@ -20,7 +20,3 @@ void TrackerControls::doCancel() {
close();
}
-extern "C" OPENTRACK_EXPORT ITrackerDialog* GetDialog( )
-{
- return new TrackerControls;
-}
diff --git a/ftnoir_tracker_hydra/ftnoir_tracker_hydra_dll.cpp b/ftnoir_tracker_hydra/ftnoir_tracker_hydra_dll.cpp
deleted file mode 100644
index 1faa1578..00000000
--- a/ftnoir_tracker_hydra/ftnoir_tracker_hydra_dll.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-/* Copyright: "i couldn't care less what anyone does with the 5 lines of code i wrote" - mm0zct */
-#include "ftnoir_tracker_hydra.h"
-#include <QDebug>
-#include "opentrack/plugin-api.hpp"
-
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-{
- return new FTNoIR_TrackerDll;
-}
diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
index 264166fe..9fe382c3 100644
--- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
+++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
@@ -217,7 +217,4 @@ void FTNoIR_Tracker::data(double *data)
}
}
-extern "C" OPENTRACK_EXPORT ITracker* GetConstructor()
-{
- return new FTNoIR_Tracker;
-}
+OPENTRACK_DECLARE_TRACKER(FTNoIR_Tracker, TrackerControls, FTNoIR_TrackerDll)
diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick_dialog.cpp b/ftnoir_tracker_joystick/ftnoir_tracker_joystick_dialog.cpp
index b201f3f8..7200003c 100644
--- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick_dialog.cpp
+++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick_dialog.cpp
@@ -60,7 +60,4 @@ void TrackerControls::doCancel() {
this->close();
}
-extern "C" OPENTRACK_EXPORT ITrackerDialog* GetDialog( )
-{
- return new TrackerControls;
-}
+
diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick_dll.cpp b/ftnoir_tracker_joystick/ftnoir_tracker_joystick_dll.cpp
deleted file mode 100644
index 0dca6c9b..00000000
--- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick_dll.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "ftnoir_tracker_joystick.h"
-#include "opentrack/plugin-api.hpp"
-
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-{
- return new FTNoIR_TrackerDll;
-}
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
index 5b9ec8b6..85ce0ad2 100644
--- a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
+++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
@@ -214,11 +214,12 @@ void Tracker_PT::data(THeadPoseData *data)
//-----------------------------------------------------------------------------
#ifdef OPENTRACK_API
-extern "C" OPENTRACK_EXPORT ITracker* GetConstructor()
+#include "ftnoir_tracker_pt_dialog.h"
+OPENTRACK_DECLARE_TRACKER(Tracker_PT, TrackerDialog_PT, TrackerDll)
#else
#pragma comment(linker, "/export:GetTracker=_GetTracker@0")
OPENTRACK_EXPORT ITrackerPtr __stdcall GetTracker()
-#endif
{
- return new Tracker_PT;
+ return new Tracker_PT;
}
+#endif
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.h b/ftnoir_tracker_pt/ftnoir_tracker_pt.h
index d0764933..21da9a2c 100644
--- a/ftnoir_tracker_pt/ftnoir_tracker_pt.h
+++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.h
@@ -83,6 +83,10 @@ private:
static constexpr double deg2rad = 3.14159265/180.0;
};
-#undef VideoWidget
+class TrackerDll : public Metadata
+{
+ QString name() { return QString("PointTracker 1.1"); }
+ QIcon icon() { return QIcon(":/Resources/Logo_IR.png"); }
+};
#endif // FTNOIR_TRACKER_PT_H
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp
index 5b17df5b..70511a3f 100644
--- a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp
+++ b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp
@@ -190,7 +190,3 @@ void TrackerDialog_PT::unregister_tracker()
//ui.center_button->setEnabled(false);
}
-extern "C" OPENTRACK_EXPORT ITrackerDialog* GetDialog( )
-{
- return new TrackerDialog_PT;
-}
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt_dll.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt_dll.cpp
deleted file mode 100644
index 1aaa1bf9..00000000
--- a/ftnoir_tracker_pt/ftnoir_tracker_pt_dll.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (c) 2012 Patrick Ruoff
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- */
-
-#include "ftnoir_tracker_pt_dll.h"
-#include <QIcon>
-
-#ifdef OPENTRACK_API
-# include "opentrack/plugin-api.hpp"
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-#else
-# pragma comment(linker, "/export:GetTrackerDll=_GetTrackerDll@0")
-OPENTRACK_EXPORT ITrackerDllPtr __stdcall GetTrackerDll()
-#endif
-{
- return new TrackerDll;
-}
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt_dll.h b/ftnoir_tracker_pt/ftnoir_tracker_pt_dll.h
deleted file mode 100644
index 9579d46c..00000000
--- a/ftnoir_tracker_pt/ftnoir_tracker_pt_dll.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright (c) 2012 Patrick Ruoff
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- */
-
-#if defined(OPENTRACK_API)
-# include "opentrack/plugin-api.hpp"
-#else
-# include "../ftnoir_tracker_base/ftnoir_tracker_base.h"
-#endif
-
-//-----------------------------------------------------------------------------
-class TrackerDll :
-#if defined(OPENTRACK_API)
- public Metadata
-#else
- public ITrackerDll
-#endif
-{
- QString name() { return QString("PointTracker 1.1"); }
- QIcon icon() { return QIcon(":/Resources/Logo_IR.png"); }
-};
diff --git a/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp b/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp
index 0328428f..74208272 100644
--- a/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp
+++ b/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp
@@ -68,7 +68,4 @@ void Rift_Tracker::data(double *data)
}
}
-extern "C" OPENTRACK_EXPORT ITracker* GetConstructor()
-{
- return new Rift_Tracker;
-}
+OPENTRACK_DECLARE_TRACKER(Rift_Tracker, TrackerControls, FTNoIR_TrackerDll)
diff --git a/ftnoir_tracker_rift/ftnoir_tracker_rift_dialog.cpp b/ftnoir_tracker_rift/ftnoir_tracker_rift_dialog.cpp
index 2439890b..6c8e9cd7 100644
--- a/ftnoir_tracker_rift/ftnoir_tracker_rift_dialog.cpp
+++ b/ftnoir_tracker_rift/ftnoir_tracker_rift_dialog.cpp
@@ -24,7 +24,3 @@ void TrackerControls::doCancel() {
close();
}
-extern "C" OPENTRACK_EXPORT ITrackerDialog* GetDialog()
-{
- return new TrackerControls;
-}
diff --git a/ftnoir_tracker_rift/ftnoir_tracker_rift_dll.cpp b/ftnoir_tracker_rift/ftnoir_tracker_rift_dll.cpp
deleted file mode 100644
index 2809ef29..00000000
--- a/ftnoir_tracker_rift/ftnoir_tracker_rift_dll.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-/* Copyright: "i couldn't care less what anyone does with the 5 lines of code i wrote" - mm0zct */
-#include "ftnoir_tracker_rift.h"
-#include <QDebug>
-#include "opentrack/plugin-api.hpp"
-
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-{
- return new FTNoIR_TrackerDll;
-}
diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp b/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp
index ab8c8c86..b60e7ccc 100644
--- a/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp
+++ b/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp
@@ -54,7 +54,5 @@ void FTNoIR_Tracker::data(double *data)
data[Yaw + i] += values[indices[i]];
}
-extern "C" OPENTRACK_EXPORT ITracker* GetConstructor()
-{
- return new FTNoIR_Tracker;
-}
+
+OPENTRACK_DECLARE_TRACKER(FTNoIR_Tracker, TrackerControls, FTNoIR_TrackerDll)
diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp.h b/ftnoir_tracker_udp/ftnoir_tracker_udp.h
index 95a3fb4f..8dca3833 100644
--- a/ftnoir_tracker_udp/ftnoir_tracker_udp.h
+++ b/ftnoir_tracker_udp/ftnoir_tracker_udp.h
@@ -57,3 +57,4 @@ public:
QString name() { return QString("UDP sender"); }
QIcon icon() { return QIcon(":/images/facetracknoir.png"); }
};
+
diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp b/ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp
index bab88db0..5e7d5437 100644
--- a/ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp
+++ b/ftnoir_tracker_udp/ftnoir_tracker_udp_dialog.cpp
@@ -24,7 +24,3 @@ void TrackerControls::doCancel() {
this->close();
}
-extern "C" OPENTRACK_EXPORT ITrackerDialog* GetDialog( )
-{
- return new TrackerControls;
-}
diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp_dll.cpp b/ftnoir_tracker_udp/ftnoir_tracker_udp_dll.cpp
deleted file mode 100644
index e2b10455..00000000
--- a/ftnoir_tracker_udp/ftnoir_tracker_udp_dll.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "ftnoir_tracker_udp.h"
-#include "opentrack/plugin-api.hpp"
-
-extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
-{
- return new FTNoIR_TrackerDll;
-}