summaryrefslogtreecommitdiffhomepage
path: root/tracker-tobii/thread.hpp
blob: d311db872af87cf4c84b911bec3ba086cfeaad99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once

#include <QThread>
#include <QCoreApplication>

#include <tobii/tobii.h>
#include <tobii/tobii_streams.h>
#include <atomic>
#include <vector>
#include <string>

class tobii_thread : public QThread
{
    Q_OBJECT
    void run() override;

public:
    tobii_thread()
    {
        head_pose = new tobii_head_pose_t();
    }
    ~tobii_thread() override;

    tobii_head_pose_t* head_pose;

private:
    tobii_api_t* api;
    tobii_device_t* device;
    
    static constexpr unsigned int retries = 300;
    static constexpr unsigned int interval = 100;

    QString error_last = "";
    std::atomic<bool> exit_thread = false;
};