aboutsummaryrefslogtreecommitdiffstats
path: root/ofxMaxim/ofxMaximExamples007OSX/maxiAtomSynthesis/src/pyOSCDebug.cpp
blob: 3af808411d4044b6b69993a76c92e0c208f3bd69 (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
36
37
38
39
40
41
42
43
44
45
/*
 *  pyOSCDebug.cpp
 *  bastardPop
 *
 *  Created by Chris on 25/10/2011.
 *  Copyright 2011 Goldsmiths Creative Computing. All rights reserved.
 *
 */

#include "pyOSCDebug.h"

pyOSCDebug::pyOSCDebug() {
	ready = false;
}

void pyOSCDebug::setup(string host, int port) {
	osc.setup(host, port);
	ready = true;
}

void pyOSCDebug::clear() {
	if (ready) {
		ofxOscMessage m;
		m.setAddress("/clear");
		osc.sendMessage(m);
	}
}


void pyOSCDebug::send(vector<float> data) {
	send(&(data[0]), data.size());
}

void pyOSCDebug::send(float *data, unsigned int count) {
	if (ready) {
		ofxOscMessage m;
		m.setAddress("/data");
		for(int i=0; i < count; i++) {
			m.addFloatArg(data[i]);
		}
		osc.sendMessage(m);
	}
}