summaryrefslogtreecommitdiffhomepage
path: root/tracker-easy/tracker-easy.h
diff options
context:
space:
mode:
authorStéphane Lenclud <github@lenclud.com>2019-04-19 16:55:50 +0200
committerStéphane Lenclud <github@lenclud.com>2019-04-24 18:46:12 +0200
commit088344f1bde14a24f90852316d01e6f1826da034 (patch)
treed4aeca181da4e9f94c3c336a262796b122d21eef /tracker-easy/tracker-easy.h
parent1a343c785a93fcef9e81854c37d36bba9b973ec8 (diff)
EasyTracker: Now using a timer.
Diffstat (limited to 'tracker-easy/tracker-easy.h')
-rw-r--r--tracker-easy/tracker-easy.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/tracker-easy/tracker-easy.h b/tracker-easy/tracker-easy.h
index a84d725e..05fdb94a 100644
--- a/tracker-easy/tracker-easy.h
+++ b/tracker-easy/tracker-easy.h
@@ -39,11 +39,9 @@ namespace EasyTracker
using namespace numeric_types;
- struct Tracker : QThread, ITracker
+ struct Tracker : public QObject, ITracker
{
- // We had problem where Qt slots would not get disconnected upon object destruction.
- // Issue seems to be gone now even without Q_OBJECT declaration, go figure.
- //Q_OBJECT
+ Q_OBJECT
public:
friend class Dialog;
@@ -54,20 +52,26 @@ namespace EasyTracker
module_status start_tracker(QFrame* parent_window) override;
void data(double* data) override;
bool center() override;
-
+
+ private slots:
+ void Tick();
+
+
private:
void CreateModelFromSettings();
void CreateCameraIntrinsicsMatrices();
void ProcessFrame();
- // From QThread
- void run() override;
+ //
bool maybe_reopen_camera();
void set_fov(int value);
+ void SetFps(int aFps);
+ void DoSetFps(int aFps);
QMutex camera_mtx;
-
+ QThread iThread;
+ QTimer iTicker;
Settings iSettings;
@@ -91,7 +95,7 @@ namespace EasyTracker
// Statistics
Timer iTimer;
- Timer iFpsTimer;
+ Timer iFpsTimer;
int iFrameCount = 0;
int iSkippedFrameCount = 0;
int iFps = 0;