-
Notifications
You must be signed in to change notification settings - Fork 0
/
EosOscManager.h
81 lines (43 loc) · 1.37 KB
/
EosOscManager.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifndef EosOscManager_h
#define EosOscManager_h
#include <OSCMessage.h>
#include <ESP8266WiFi.h>
#include <EosOscHandler.h>
#define MAX_HANDLERS 5 //could we do this dynamicly? avoid having lots of un-needed space? Maybe declare when we initialise class?
union MsgLength //this means I can acces the bytes and the long value for a 4 didgit int (long)
{
unsigned long value;
byte bytes[4];
};
class EosOscManager
{
private:
/*==== PRIVATE VARIABLES
*
*/
byte user; //the user number, if 255 then no user
WiFiClient client;
bool screenNeedsUpdate;
EosOscHandler *handlers[MAX_HANDLERS];
byte handlerCount = 0;
//EosOscCommand *handler;// = NULL;
public:
static EosOscManager manager;
static bool madeManager;
EosOscManager(); //ideally this would be private but it can't be due to no _Gate thing //to make it singleton
// initializes the OscManager
void sendOSCMessage(OSCMessage &theMessage);
void setUser(byte theUser);
void setClient(WiFiClient &theClient);
byte getUser();
void resetConnection();
void routeOSC(OSCMessage &theMessage);
bool getScreenNeedsUpdate();
void setScreenNeedsUpdate(bool doesIt);
void checkForIncomingTCP();
void registerHandler(EosOscHandler * handler);
static void routeScreenNeedsUpdate(OSCMessage &msg, int addrOffSet);
static EosOscManager &singleton;
static EosOscManager* getInstance();
};
#endif