comparison AppCore.h @ 0:a223551fdc1f

First commit - copy from tweakathlon.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Fri, 10 Oct 2014 11:46:42 +0100
parents
children 91c3fba6e5b9
comparison
equal deleted inserted replaced
-1:000000000000 0:a223551fdc1f
1 /*
2 * Copyright (c) 2011 Dan Wilcox <danomatika@gmail.com>
3 *
4 * BSD Simplified License.
5 * For information on usage and redistribution, and for a DISCLAIMER OF ALL
6 * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
7 *
8 * See https://github.com/danomatika/ofxPd for documentation
9 *
10 */
11 #pragma once
12
13 #include "ofMain.h"
14
15 #include "ofxPd.h"
16
17 // a namespace for the Pd types
18 using namespace pd;
19
20 class AppCore : public PdReceiver, public PdMidiReceiver {
21
22 public:
23 string patchName;
24 // main
25 void setup(const int numOutChannels, const int numInChannels,
26 const int sampleRate, const int ticksPerBuffer);
27 void update();
28 void draw();
29 void exit();
30
31 // do something
32 void playTone(int pitch);
33
34 // input callbacks
35 void keyPressed(int key);
36
37 // audio callbacks
38 void audioReceived(float * input, int bufferSize, int nChannels);
39 void audioRequested(float * output, int bufferSize, int nChannels);
40
41 // pd message receiver callbacks
42 void print(const std::string& message);
43
44 void receiveBang(const std::string& dest);
45 void receiveFloat(const std::string& dest, float value);
46 void receiveSymbol(const std::string& dest, const std::string& symbol);
47 void receiveList(const std::string& dest, const List& list);
48 void receiveMessage(const std::string& dest, const std::string& msg, const List& list);
49
50 // pd midi receiver callbacks
51 void receiveNoteOn(const int channel, const int pitch, const int velocity);
52 void receiveControlChange(const int channel, const int controller, const int value);
53 void receiveProgramChange(const int channel, const int value);
54 void receivePitchBend(const int channel, const int value);
55 void receiveAftertouch(const int channel, const int value);
56 void receivePolyAftertouch(const int channel, const int pitch, const int value);
57
58 void receiveMidiByte(const int port, const int byte);
59
60 // demonstrates how to manually poll for messages
61 void processEvents();
62
63 ofxPd pd;
64 vector<float> scopeArray;
65
66 int midiChan;
67 };