diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-09-26 15:45:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-26 15:45:36 +0200 |
commit | a123bb65e10dab56f32f0a4ed015b366d23615da (patch) | |
tree | df9aa3d97506834c4389e7f2dc738e396155df94 /tracker-tobii/tobii.h | |
parent | 6f836ab2ab0edb296e0dc3884983cf6b956fce68 (diff) | |
parent | a462b5411e4c6e958adb3b2d1a75657d56522942 (diff) |
Merge pull request #1724 from khoanguyen-3fc/feature/tobii-tracker
Diffstat (limited to 'tracker-tobii/tobii.h')
-rw-r--r-- | tracker-tobii/tobii.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/tracker-tobii/tobii.h b/tracker-tobii/tobii.h new file mode 100644 index 00000000..414f9f64 --- /dev/null +++ b/tracker-tobii/tobii.h @@ -0,0 +1,61 @@ +/* Copyright (c) 2023, Khoa Nguyen <khoanguyen@3forcom.com> + + * 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. + */ + +#pragma once +#include "api/plugin-api.hpp" +#include "ui_tobii.h" + +#include <tobii/tobii.h> +#include <tobii/tobii_streams.h> + +#include <QMutex> + +class tobii_tracker : public ITracker +{ +public: + tobii_tracker(); + ~tobii_tracker() override; + module_status start_tracker(QFrame*) override; + void data(double* data) override; + +private: + tobii_api_t* api = nullptr; + tobii_device_t* device = nullptr; + + tobii_head_pose_t latest_head_pose{ + .timestamp_us = 0LL, + .position_validity = TOBII_VALIDITY_INVALID, + .position_xyz = { 0.f, 0.f, 0.f }, + .rotation_validity_xyz = { TOBII_VALIDITY_INVALID, TOBII_VALIDITY_INVALID, TOBII_VALIDITY_INVALID }, + .rotation_xyz = { 0.f, 0.f, 0.f }, + }; + + QMutex mtx; +}; + +class tobii_dialog : public ITrackerDialog +{ + Q_OBJECT + + Ui::tobii_ui ui; + +public: + tobii_dialog(); + +private slots: + void doOK(); + void doCancel(); +}; + +class tobii_metadata : public Metadata +{ + Q_OBJECT + + QString name() override { return tr("Tobii Eye Tracker"); } + QIcon icon() override { return QIcon(":/images/tobii_logo.png"); } +}; |