|
OpenShot Library | libopenshot-audio
0.2.0
|
Collects incoming realtime MIDI messages and turns them into blocks suitable for processing by a block-based audio callback. More...
#include <juce_MidiMessageCollector.h>
Inheritance diagram for juce::MidiMessageCollector:Public Member Functions | |
| MidiMessageCollector () | |
| Creates a MidiMessageCollector. | |
| ~MidiMessageCollector () override | |
| Destructor. | |
| void | reset (double sampleRate) |
| Clears any messages from the queue. More... | |
| void | addMessageToQueue (const MidiMessage &message) |
| Takes an incoming real-time message and adds it to the queue. More... | |
| void | removeNextBlockOfMessages (MidiBuffer &destBuffer, int numSamples) |
| Removes all the pending messages from the queue as a buffer. More... | |
| void | handleNoteOn (MidiKeyboardState *, int midiChannel, int midiNoteNumber, float velocity) override |
| void | handleNoteOff (MidiKeyboardState *, int midiChannel, int midiNoteNumber, float velocity) override |
| void | handleIncomingMidiMessage (MidiInput *, const MidiMessage &) override |
Public Member Functions inherited from juce::MidiInputCallback | |
| virtual | ~MidiInputCallback ()=default |
| Destructor. | |
| virtual void | handlePartialSysexMessage (MidiInput *source, const uint8 *messageData, int numBytesSoFar, double timestamp) |
| Notification sent each time a packet of a multi-packet sysex message arrives. More... | |
Collects incoming realtime MIDI messages and turns them into blocks suitable for processing by a block-based audio callback.
The class can also be used as either a MidiKeyboardStateListener or a MidiInputCallback so it can easily use a midi input or keyboard component as its source.
Definition at line 42 of file juce_MidiMessageCollector.h.
| void juce::MidiMessageCollector::reset | ( | double | sampleRate | ) |
Clears any messages from the queue.
You need to call this method before starting to use the collector, so that it knows the correct sample rate to use.
Definition at line 35 of file juce_MidiMessageCollector.cpp.
References juce::MidiBuffer::clear(), and juce::Time::getMillisecondCounterHiRes().
| void juce::MidiMessageCollector::addMessageToQueue | ( | const MidiMessage & | message | ) |
Takes an incoming real-time message and adds it to the queue.
The message's timestamp is taken, and it will be ready for retrieval as part of the block returned by the next call to removeNextBlockOfMessages().
This method is fully thread-safe when overlapping calls are made with removeNextBlockOfMessages().
Definition at line 48 of file juce_MidiMessageCollector.cpp.
References juce::MidiBuffer::addEvent(), juce::MidiBuffer::clear(), and juce::MidiMessage::getTimeStamp().
Referenced by handleIncomingMidiMessage(), handleNoteOff(), and handleNoteOn().
| void juce::MidiMessageCollector::removeNextBlockOfMessages | ( | MidiBuffer & | destBuffer, |