mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-15 17:25:06 +00:00
more MIDI preparations
this is difficult
This commit is contained in:
parent
52c03f1fd6
commit
4e6ade7e0b
2 changed files with 23 additions and 3 deletions
|
@ -18,3 +18,12 @@
|
|||
*/
|
||||
|
||||
#include "../../extern/rtmidi/RtMidi.h"
|
||||
#include "taAudio.h"
|
||||
|
||||
class TAMidiInRtMidi: public TAMidiIn {
|
||||
|
||||
};
|
||||
|
||||
class TAMidiOutRtMidi: public TAMidiOut {
|
||||
|
||||
};
|
|
@ -20,6 +20,7 @@
|
|||
#ifndef _TAAUDIO_H
|
||||
#define _TAAUDIO_H
|
||||
#include "../ta-utils.h"
|
||||
#include <queue>
|
||||
#include <vector>
|
||||
|
||||
struct SampleRateChangeEvent {
|
||||
|
@ -116,14 +117,24 @@ struct TAMidiMessage {
|
|||
|
||||
void submitSysEx(std::vector<unsigned char> data);
|
||||
void done();
|
||||
|
||||
TAMidiMessage():
|
||||
type(0),
|
||||
sysExData(NULL),
|
||||
sysExLen(0) {
|
||||
memset(&data,0,sizeof(data));
|
||||
}
|
||||
};
|
||||
|
||||
class TAMidiIn {
|
||||
std::queue<TAMidiMessage> queue;
|
||||
public:
|
||||
virtual bool gather();
|
||||
bool next(TAMidiMessage& where);
|
||||
};
|
||||
|
||||
class TAMidiOut {
|
||||
std::queue<TAMidiMessage> queue;
|
||||
public:
|
||||
bool send(TAMidiMessage& what);
|
||||
};
|
||||
|
@ -140,8 +151,8 @@ class TAAudio {
|
|||
void (*sampleRateChanged)(SampleRateChangeEvent);
|
||||
void (*bufferSizeChanged)(BufferSizeChangeEvent);
|
||||
public:
|
||||
std::vector<TAMidiIn*> midiIn;
|
||||
std::vector<TAMidiOut*> midiOut;
|
||||
TAMidiIn* midiIn;
|
||||
TAMidiOut* midiOut;
|
||||
void setSampleRateChangeCallback(void (*callback)(SampleRateChangeEvent));
|
||||
void setBufferSizeChangeCallback(void (*callback)(BufferSizeChangeEvent));
|
||||
|
||||
|
|
Loading…
Reference in a new issue