diff options
-rw-r--r-- | ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp | 6 | ||||
-rw-r--r-- | ftnoir_tracker_hatire/ftnoir_tracker_hat.h | 18 | ||||
-rw-r--r-- | ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.cpp | 22 | ||||
-rw-r--r-- | ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h | 12 | ||||
-rw-r--r-- | ftnoir_tracker_hatire/ftnoir_tracker_hat_dll.cpp | 18 | ||||
-rw-r--r-- | ftnoir_tracker_hatire/ftnoir_tracker_hat_settings.cpp | 13 |
6 files changed, 65 insertions, 24 deletions
diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp b/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp index 9ca65115..3f7e1988 100644 --- a/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp +++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp @@ -287,7 +287,7 @@ void FTNoIR_Tracker::notifyCenter() { #else -void FTNoIR_Tracker::StartTracker(QFrame*) +void FTNoIR_Tracker::start_tracker(QFrame*) { CptError=0; dataRead.clear(); @@ -361,7 +361,7 @@ int FTNoIR_Tracker::preferredHz() { // Return 6DOF info // #ifdef OPENTRACK_API -void FTNoIR_Tracker::GetHeadPoseData(double *data) +void FTNoIR_Tracker::data(double *data) #else bool FTNoIR_Tracker::GiveHeadPoseData(THeadPoseData *data) #endif @@ -536,7 +536,7 @@ void FTNoIR_Tracker::applysettings(const TrackerSettings& settings){ // _GetTracker@0 - Common name decoration for __stdcall functions in C language. //////////////////////////////////////////////////////////////////////////////// #ifdef OPENTRACK_API -extern "C" FTNOIR_TRACKER_BASE_EXPORT ITracker* CALLING_CONVENTION GetConstructor() +extern "C" OPENTRACK_EXPORT ITracker* GetConstructor() #else #pragma comment(linker, "/export:GetTracker=_GetTracker@0") FTNOIR_TRACKER_BASE_EXPORT ITrackerPtr __stdcall GetTracker() diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat.h b/ftnoir_tracker_hatire/ftnoir_tracker_hat.h index ba96d91c..2abeb77d 100644 --- a/ftnoir_tracker_hatire/ftnoir_tracker_hat.h +++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat.h @@ -2,8 +2,7 @@ #define FTNOIR_TRACKER_HAT_H #ifdef OPENTRACK_API -# include "ftnoir_tracker_base/ftnoir_tracker_base.h" -# include "facetracknoir/plugin-support.h" +# include "opentrack/plugin-support.h" #else # include "..\ftnoir_tracker_base\ftnoir_tracker_base.h" #endif @@ -30,10 +29,10 @@ public: ~FTNoIR_Tracker(); #ifdef OPENTRACK_API - void StartTracker(QFrame*); - void GetHeadPoseData(double *data); - int preferredHz(); - void center(); + void start_tracker(QFrame*); + void data(double *data); + int preferredHz(); // unused + void center(); // unused #else void Initialize( QFrame *videoframe ); void StartTracker(HWND parent_window); @@ -134,11 +133,16 @@ public: #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 diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.cpp b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.cpp index 1487cd39..34ebbeb8 100644 --- a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.cpp +++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.cpp @@ -201,8 +201,8 @@ TrackerControls::TrackerControls() : theTracker(NULL), settingsDirty(false), tim connect(&timer,SIGNAL(timeout()), this,SLOT(poll_tracker_info())); - connect(ui.lineSend,SIGNAL(keyPressEvent),this,SLOT(on_lineSend_returnPressed()) ); - + // can't connect slot, keyPressEvent takes QKeyPressEvent as argument + //connect(ui.lineSend,SIGNAL(keyPressEvent),this,SLOT(on_lineSend_returnPressed()) ); } // @@ -365,8 +365,12 @@ void TrackerControls::doCancel() { } } - -void TrackerControls::registerTracker(ITracker *tracker) { +#ifdef OPENTRACK_API +void TrackerControls::register_tracker(ITracker *tracker) +#else +void TrackerControls::registerTracker(ITracker *tracker) +#endif +{ theTracker = static_cast<FTNoIR_Tracker*>(tracker); connect(theTracker, SIGNAL(sendMsgInfo(QByteArray)),this , SLOT(WriteMsgInfo(QByteArray))); @@ -383,8 +387,12 @@ void TrackerControls::registerTracker(ITracker *tracker) { } - -void TrackerControls::unRegisterTracker() { +#ifdef OPENTRACK_API +void TrackerControls::unregister_tracker() +#else +void TrackerControls::unRegisterTracker() +#endif +{ timer.stop(); theTracker=NULL; ui.cbSerialPort->setEnabled(true); @@ -406,7 +414,7 @@ void TrackerControls::unRegisterTracker() { // Win32 API function. // _GetTrackerDialog@0 - Common name decoration for __stdcall functions in C language. #ifdef OPENTRACK_API -extern "C" FTNOIR_TRACKER_BASE_EXPORT ITrackerDialog* CALLING_CONVENTION GetDialog( ) +extern "C" OPENTRACK_EXPORT ITrackerDialog* GetDialog( ) #else #pragma comment(linker, "/export:GetTrackerDialog=_GetTrackerDialog@0") FTNOIR_TRACKER_BASE_EXPORT ITrackerDialogPtr __stdcall GetTrackerDialog( ) diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h index 66d29462..cb5e84b5 100644 --- a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h +++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h @@ -2,7 +2,7 @@ #define FTNOIR_TRACKER_HAT_DIALOG_H #ifdef OPENTRACK_API -#include "ftnoir_tracker_base/ftnoir_tracker_base.h" +#include "opentrack/plugin-api.hpp" #else #include "..\ftnoir_tracker_base\ftnoir_tracker_base.h" #endif @@ -17,16 +17,20 @@ #include <QMetaType> // Widget that has controls for FTNoIR protocol client-settings. +#ifdef OPENTRACK_API +class TrackerControls: public ITrackerDialog +#else class TrackerControls: public QWidget, public ITrackerDialog +#endif { Q_OBJECT public: explicit TrackerControls(); virtual ~TrackerControls(); #ifdef OPENTRACK_API - void Initialize(QWidget *parent) ; - void registerTracker(ITracker *tracker); - void unRegisterTracker(); + void Initialize(QWidget *parent) ; // unused + void register_tracker(ITracker *tracker); + void unregister_tracker(); #else void Initialize(QWidget *parent) ; void registerTracker(ITracker *tracker) ; diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dll.cpp b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dll.cpp index a77bd1b5..5f64fe4b 100644 --- a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dll.cpp +++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dll.cpp @@ -48,6 +48,7 @@ void TrackerDll::Initialize() } #endif +#ifndef OPENTRACK_API void TrackerDll::getFullName(QString *strToBeFilled) { *strToBeFilled = trackerFullName; @@ -67,6 +68,19 @@ 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. @@ -77,8 +91,8 @@ void TrackerDll::getIcon(QIcon *icon) // _GetTrackerDll@0 - Common name decoration for __stdcall functions in C language. #ifdef OPENTRACK_API -# include "facetracknoir/plugin-support.h" -extern "C" FTNOIR_TRACKER_BASE_EXPORT Metadata* CALLING_CONVENTION GetMetadata() +# include "opentrack/plugin-support.h" +extern "C" OPENTRACK_EXPORT Metadata* GetMetadata() #else # pragma comment(linker, "/export:GetTrackerDll=_GetTrackerDll@0") FTNOIR_TRACKER_BASE_EXPORT ITrackerDllPtr __stdcall GetTrackerDll() diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat_settings.cpp b/ftnoir_tracker_hatire/ftnoir_tracker_hat_settings.cpp index c9671c14..79f93538 100644 --- a/ftnoir_tracker_hatire/ftnoir_tracker_hat_settings.cpp +++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat_settings.cpp @@ -29,11 +29,22 @@ #include <QVariant> #include "ftnoir_tracker_hat_settings.h" +#ifdef OPENTRACK_API +#include "opentrack/options.hpp" +#endif void TrackerSettings::load_ini() { +#ifdef OPENTRACK_API + QSettings settings(options::group::org); // Registry settings (in HK_USER) +#else QSettings settings("opentrack"); // Registry settings (in HK_USER) +#endif +#ifdef OPENTRACK_API + QString currentFile = settings.value( options::group::filename_key, QCoreApplication::applicationDirPath() + options::group::default_path ).toString(); +#else QString currentFile = settings.value( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString(); +#endif QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) iniFile.beginGroup( "HAT" ); @@ -95,7 +106,7 @@ void TrackerSettings::save_ini() const { QSettings settings("opentrack"); // Registry settings (in HK_USER) - QString currentFile = settings.value( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString(); + QString currentFile = settings.value( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString(); QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) iniFile.beginGroup ( "HAT" ); |