-
Notifications
You must be signed in to change notification settings - Fork 0
/
SupperwareInterface.h
55 lines (46 loc) · 1.6 KB
/
SupperwareInterface.h
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// m1-orientationmanager
// Copyright © 2022 Mach1. All rights reserved.
//
#pragma once
#include <JuceHeader.h>
#include "ht-api-juce/supperware/HeadMatrix.h"
#include "ht-api-juce/supperware/Tracker.h"
#include "ht-api-juce/supperware/midi/midi.h"
#include "headpanel-PointList.h"
#include "headpanel-Points.h"
#include "headpanel-Plotter.h"
//==============================================================================
/*
*/
class SupperwareInterface: public juce::Timer, Midi::TrackerDriver::Listener
{
public:
class Listener
{
public:
virtual ~Listener() {};
//virtual std::vector<float> trackerChanged(const HeadMatrix& headMatrix) = 0;
};
SupperwareInterface();
~SupperwareInterface();
const Midi::TrackerDriver& getTrackerDriver() const;
const HeadMatrix& getHeadMatrix() const;
void trackerOrientation(float yawRadian, float pitchRadian, float rollRadian) override;
void trackerOrientationQ(float qw, float qx, float qy, float qz) override;
void trackerMidiConnectionChanged(Midi::State newState) override;
void setChirality(bool isRightEarChirality);
void calibrateCompass();
void trackerZero();
void connectSupperware();
void setListener(Listener* l);
void timerCallback() override;
// Public current orientation
std::vector<float> currentOrientation;
private:
Listener* listener;
Midi::State midiState;
Midi::TrackerDriver trackerDriver;
HeadMatrix headMatrix;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SupperwareInterface)
};