From d09cc45d859aabbf76306fee49c1cec202c4f808 Mon Sep 17 00:00:00 2001 From: Chris Kiefer Date: Thu, 3 Nov 2011 18:05:24 +0000 Subject: maxiAtoms --- .../maxiAtomSynthesis/src/pyOSCDebug.cpp | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 ofxMaxim/ofxMaximExamples007OSX/maxiAtomSynthesis/src/pyOSCDebug.cpp (limited to 'ofxMaxim/ofxMaximExamples007OSX/maxiAtomSynthesis/src/pyOSCDebug.cpp') diff --git a/ofxMaxim/ofxMaximExamples007OSX/maxiAtomSynthesis/src/pyOSCDebug.cpp b/ofxMaxim/ofxMaximExamples007OSX/maxiAtomSynthesis/src/pyOSCDebug.cpp new file mode 100644 index 0000000..3af8084 --- /dev/null +++ b/ofxMaxim/ofxMaximExamples007OSX/maxiAtomSynthesis/src/pyOSCDebug.cpp @@ -0,0 +1,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 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); + } +} + + -- cgit v1.3