-
Notifications
You must be signed in to change notification settings - Fork 0
/
EosOscChannel.cpp
64 lines (43 loc) · 1.36 KB
/
EosOscChannel.cpp
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
#include <EosOscChannel.h>
#include <EosOscManager.h>
//initialize static variables
char EosOscChannel::channelDisplayLine[CHANNEL_DISPLAY_LENGTH+1]; //current command line
EosOscChannel EosOscChannel::singleton;
bool EosOscChannel::madeSingleton = false;
EosOscChannel::EosOscChannel()
{
// manager->registerHandler(this);
}
void EosOscChannel::userChanged()
{
//don't need to do anything
}
void EosOscChannel::routeOsc(OSCMessage &message)
{
message.route("/eos/out/active/chan", this->routeCmd);
message.route("/eos/out/active/chan", EosOscManager::getInstance()->routeScreenNeedsUpdate);
}
//TODO THIS SHOULD BE IN SEPARATE CLASS FOR THE CHANNEL
void EosOscChannel::writeCommandLine(Stream &print)
{
print.print(EosOscChannel::channelDisplayLine);
}
//ROUTINGS???
void EosOscChannel::routeCmd(OSCMessage &msg, int addrOffSet) {
/// recieves eos/out/active/chan
// the info is in the description
//which is a String
//so get the description
byte descLength = msg.getDataLength(0);
if (descLength > CHANNEL_DISPLAY_LENGTH +1)
descLength = CHANNEL_DISPLAY_LENGTH +1;
// Serial.println("route channel");
msg.getString(0, EosOscChannel::channelDisplayLine, descLength);
//Serial.println(descC);
}
EosOscChannel* EosOscChannel::getInstance() {
if (!madeSingleton) EosOscChannel(singleton);
madeSingleton = true;
return &singleton;
//return NULL;
};