-
Notifications
You must be signed in to change notification settings - Fork 0
/
callbackFunctionReminder.rtf
63 lines (62 loc) · 1.2 KB
/
callbackFunctionReminder.rtf
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf470
{\fonttbl\f0\fnil\fcharset0 Menlo-Regular;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\deftab529
\pard\tx529\pardeftab529\pardirnatural\partightenfactor0
\f0\fs22 \cf2 \CocoaLigature0 //\
// instrument.hpp\
// 808_kick\
//\
// Created by gustaf svenungsson on 31/10/2016.\
//\
//\
\
#ifndef instrument_hpp\
#define instrument_hpp\
\
#include <stdio.h>\
#include "ofMain.h"\
\
typedef std::function<void ()> Cb;\
\
class Instrument\{\
public:\
Instrument();\
void noteOn(Cb _cb);\
void noteOn(Cb _cb, Cb _cb2);\
void noteOff(Cb _cb);\
\
vector<Cb> callbackfunctions;\
\};\
\
\
\
#endif /* instrument_hpp */\
\
\
//\
// instrument.cpp\
// 808_kick\
//\
// Created by gustaf svenungsson on 31/10/2016.\
//\
//\cf1 \
\
\cf2 #include "instrument.hpp"\
\
Instrument::Instrument()\{\}\
\
void Instrument::noteOn(Cb _cb)\{\
callbackfunctions.push_back(_cb);\
\}\
\
void Instrument::noteOn(Cb _cb, Cb _cb2)\{\
callbackfunctions.push_back(_cb);\
noteOff(_cb2);\
\}\
\
void Instrument::noteOff(Cb _cb)\{\
callbackfunctions.push_back(_cb);\
\}\
}