aboutsummaryrefslogtreecommitdiffstats
path: root/ofxMaxim/ofxMaximExamples007OSX/maxiAtomSynthesis/src/pyOSCDebug.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ofxMaxim/ofxMaximExamples007OSX/maxiAtomSynthesis/src/pyOSCDebug.cpp')
-rw-r--r--ofxMaxim/ofxMaximExamples007OSX/maxiAtomSynthesis/src/pyOSCDebug.cpp45
1 files changed, 45 insertions, 0 deletions
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<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);
+ }
+}
+
+