diff AppCore.h @ 11:91c3fba6e5b9

things can register for pd metronome events onTick gets back to search message organiser
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Mon, 20 Oct 2014 11:23:55 +0100
parents a223551fdc1f
children
line wrap: on
line diff
--- a/AppCore.h	Fri Oct 17 19:23:30 2014 +0100
+++ b/AppCore.h	Mon Oct 20 11:23:55 2014 +0100
@@ -11,8 +11,11 @@
 #pragma once
 
 #include "ofMain.h"
+#include "boost/bind.hpp"
+#include "boost/function.hpp"
+#include "ofxPd.h"
+#include "globalVariables.h"
 
-#include "ofxPd.h"
 
 // a namespace for the Pd types
 using namespace pd;
@@ -64,4 +67,18 @@
 		vector<float> scopeArray;
         
         int midiChan;
+    vector<TickListenerFunction> tickListeners;
+    
+    // register for a clock tick
+    void clockTickSender(int stepNo){
+        for(auto tli = tickListeners.begin(); tli < tickListeners.end(); tli++){
+            (*tli)(stepNo);
+        }
+    };
+    
+    void addTickListener(TickListenerFunction listenerFunction) // virtual?
+    {
+        cout << "added tick listener" << endl;
+        tickListeners.push_back(listenerFunction);
+    };
 };