summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_ht/ftnoir_tracker_ht.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-12 06:46:03 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-12 06:46:03 +0200
commitbfdec03aaecfa3c6d67e9a87be95e703e73a845e (patch)
tree09ff536a82f0a71c976b4e838417f54a6987205a /ftnoir_tracker_ht/ftnoir_tracker_ht.h
parentf17bbbca24fe123dbe322769960ad78247796cb4 (diff)
ht: include in DLL, not as subprocess
Diffstat (limited to 'ftnoir_tracker_ht/ftnoir_tracker_ht.h')
-rw-r--r--ftnoir_tracker_ht/ftnoir_tracker_ht.h41
1 files changed, 25 insertions, 16 deletions
diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.h b/ftnoir_tracker_ht/ftnoir_tracker_ht.h
index 348fc246..b2fcb147 100644
--- a/ftnoir_tracker_ht/ftnoir_tracker_ht.h
+++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.h
@@ -5,10 +5,8 @@
* copyright notice and this permission notice appear in all copies.
*/
-#ifndef FTNOIR_TRACKER_HT_H
-#define FTNOIR_TRACKER_HT_H
+#pragma once
-#include "stdafx.h"
#include "headtracker-ftnoir.h"
#include "ui_ht-trackercontrols.h"
#include "ht_video_widget.h"
@@ -18,6 +16,12 @@
#include "opentrack/plugin-api.hpp"
#include "opentrack/opencv-camera-dialog.hpp"
+#include <QThread>
+#include <QMutex>
+#include <QMutexLocker>
+#include <QHBoxLayout>
+#include <QString>
+
using namespace options;
struct settings : opts {
@@ -33,42 +37,47 @@ struct settings : opts {
{}
};
-class Tracker : public QObject, public ITracker
+class Tracker : public QThread, public ITracker
{
Q_OBJECT
public:
Tracker();
~Tracker() override;
+ void run() override;
void start_tracker(QFrame* frame);
void data(double *data);
void load_settings(ht_config_t* config);
+ headtracker_t* ht;
+ QMutex camera_mtx;
private:
+ double ypr[6];
settings s;
- PortableLockedShm lck_shm;
- ht_shm_t* shm;
- QProcess subprocess;
+ ht_config_t conf;
HTVideoWidget* videoWidget;
QHBoxLayout* layout;
+ QMutex ypr_mtx, frame_mtx;
+ ht_video_t frame;
+ volatile bool should_stop;
};
-// Widget that has controls for FTNoIR protocol client-settings.
class TrackerControls : public ITrackerDialog, protected camera_dialog<Tracker>
{
Q_OBJECT
public:
- explicit TrackerControls();
- void register_tracker(ITracker *) {}
- void unregister_tracker() {}
-
+ TrackerControls();
+ void register_tracker(ITracker * t)
+ {
+ tracker = static_cast<Tracker*>(t);
+ }
+ void unregister_tracker() {
+ tracker = nullptr;
+ }
private:
Ui::Form ui;
settings s;
-
+ Tracker* tracker;
private slots:
void doOK();
void doCancel();
void camera_settings();
};
-
-#endif
-