Mercurial > hg > tweakathon2ios
comparison 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 |
comparison
equal
deleted
inserted
replaced
10:e25d2b1b185e | 11:91c3fba6e5b9 |
---|---|
9 * | 9 * |
10 */ | 10 */ |
11 #pragma once | 11 #pragma once |
12 | 12 |
13 #include "ofMain.h" | 13 #include "ofMain.h" |
14 #include "boost/bind.hpp" | |
15 #include "boost/function.hpp" | |
16 #include "ofxPd.h" | |
17 #include "globalVariables.h" | |
14 | 18 |
15 #include "ofxPd.h" | |
16 | 19 |
17 // a namespace for the Pd types | 20 // a namespace for the Pd types |
18 using namespace pd; | 21 using namespace pd; |
19 | 22 |
20 class AppCore : public PdReceiver, public PdMidiReceiver { | 23 class AppCore : public PdReceiver, public PdMidiReceiver { |
62 | 65 |
63 ofxPd pd; | 66 ofxPd pd; |
64 vector<float> scopeArray; | 67 vector<float> scopeArray; |
65 | 68 |
66 int midiChan; | 69 int midiChan; |
70 vector<TickListenerFunction> tickListeners; | |
71 | |
72 // register for a clock tick | |
73 void clockTickSender(int stepNo){ | |
74 for(auto tli = tickListeners.begin(); tli < tickListeners.end(); tli++){ | |
75 (*tli)(stepNo); | |
76 } | |
77 }; | |
78 | |
79 void addTickListener(TickListenerFunction listenerFunction) // virtual? | |
80 { | |
81 cout << "added tick listener" << endl; | |
82 tickListeners.push_back(listenerFunction); | |
83 }; | |
67 }; | 84 }; |