From bfdec03aaecfa3c6d67e9a87be95e703e73a845e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 12 Jul 2015 06:46:03 +0200 Subject: ht: include in DLL, not as subprocess --- ftnoir_tracker_ht/ftnoir_tracker_ht.h | 41 +++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 16 deletions(-) (limited to 'ftnoir_tracker_ht/ftnoir_tracker_ht.h') 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 +#include +#include +#include +#include + 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 { Q_OBJECT public: - explicit TrackerControls(); - void register_tracker(ITracker *) {} - void unregister_tracker() {} - + TrackerControls(); + void register_tracker(ITracker * t) + { + tracker = static_cast(t); + } + void unregister_tracker() { + tracker = nullptr; + } private: Ui::Form ui; settings s; - + Tracker* tracker; private slots: void doOK(); void doCancel(); void camera_settings(); }; - -#endif - -- cgit v1.2.3