18 #include "rtmidi/RtMidi.h" 28 m_rtmidi =
new RtMidiIn(name.toStdString());
30 m_rtmidi->openPort(0, tr(
"Input").toStdString());
47 ((
MIDIInput *)userData)->callback(timestamp, message);
53 SVDEBUG <<
"MIDIInput::callback(" << timestamp <<
")" << endl;
58 if (!message || message->empty())
return;
63 message->size() > 1 ? (*message)[1] : 0,
64 message->size() > 2 ? (*message)[2] : 0);
80 int count = 0, max = 5;
83 cerr <<
"ERROR: MIDIInput::postEvent: MIDI event queue is full and not clearing -- abandoning incoming event" << endl;
86 cerr <<
"WARNING: MIDIInput::postEvent: MIDI event queue (capacity " <<
m_buffer.
getSize() <<
" is full!" << endl;
87 SVDEBUG <<
"Waiting for something to be processed" << endl;
virtual int getFrame() const =0
T readOne(int R=0)
Read one sample from the buffer, for reader R.
int write(const T *source, int n)
Write n samples to the buffer.
A trivial interface for things that permit retrieving "the current frame".
int getWriteSpace() const
Return the amount of space available for writing, in samples.
int getSize() const
Return the total capacity of the ring buffer in samples.