ofxPDSP
MidiControls.h
1 
2 // Controls.h
3 // ofxPDSP
4 // Nicola Pisanti, MIT License, 2016
5 
6 #ifndef OFXPDSPMIDI_PDSPMIDICONTROLS_H_INCLUDED
7 #define OFXPDSPMIDI_PDSPMIDICONTROLS_H_INCLUDED
8 
9 #ifndef __ANDROID__
10 
11 #include "ofxMidi.h"
12 #include "../DSP/control/SequencerValueOutput.h"
13 #include <chrono>
14 #include <map>
15 #include "helper/MidiCCBuffers.h"
16 #include "helper/Controller.h"
17 #include "MidiIn.h"
18 
23 namespace pdsp{ namespace midi {
24 
25 class Controls : public pdsp::Controller {
26 
27 public:
28  Controls();
29  Controls(int maxCC);
30 
35  void setCCSlew(float slewTimeMs);
36 
40  int getMinCCNum();
41 
45  int getMaxCCNum();
46 
50  int getCCSize();
51 
56  pdsp::SequencerValueOutput & out( int cc );
57 
61  std::map<int, pdsp::SequencerValueOutput> outs_cc; // this has to become private in later versions
62 
63  void processMidi(const pdsp::midi::Input &midiInProcessor, const int &bufferSize ) noexcept override;
64 
69  void setMaxCCNum(int ccNum);
73 private:
74  float slewTime;
76 
77 };
78 
79 }} // end namespaces
80 
81 #endif
82 
83 #endif //OFXPDSPMIDI_PDSPMIDICONTROLS_H_INCLUDED
Definition: MidiIn.h:22
Takes messages from a MessageBuffer and convert them in an optionally smoothed value output...
Definition: SequencerValueOutput.h:23
pdsp::SequencerValueOutput & out(int cc)
returns a control value corrisponding to the given cc number, the output is mapped to the 0...
Definition: MidiControls.cpp:42
void setCCSlew(float slewTimeMs)
sets the slew times of the CCs
Definition: MidiControls.cpp:18
int getMinCCNum()
returns the lowest CC out
Definition: MidiControls.cpp:30
Definition: MidiControls.h:25
Definition: Controller.h:11
Thread-safe value control with smoothing.
Definition: SequencerBridge.h:11
int getMaxCCNum()
returns the highest CC out
Definition: MidiControls.cpp:34
int getCCSize()
returns number of CC outs
Definition: MidiControls.cpp:38
Definition: MidiCCBuffers.h:18