|
LMMS
|
#include <MidiMessageSequence.h>
Classes | |
| class | MidiEventHolder |
Public Member Functions | |
| MidiMessageSequence () | |
| MidiMessageSequence (const MidiMessageSequence &) | |
| MidiMessageSequence & | operator= (const MidiMessageSequence &) |
| ~MidiMessageSequence () | |
| void | clear () |
| int | getNumEvents () const noexcept |
| MidiEventHolder * | getEventPointer (int index) const noexcept |
| double | getStartTime () const noexcept |
| double | getEndTime () const noexcept |
| double | getEventTime (int index) const noexcept |
| MidiEventHolder * | addEvent (const MidiMessage &newMessage, double timeAdjustment=0) |
| void | addSequence (const MidiMessageSequence &other, double timeAdjustmentDelta) |
| void | updateMatchedPairs () noexcept |
| void | sort () noexcept |
| void | swapWith (MidiMessageSequence &) noexcept |
Private Attributes | |
| OwnedArray< MidiEventHolder > | list |
Friends | |
| class | MidiFile |
A sequence of timestamped midi messages.
This allows the sequence to be manipulated, and also to be read from and written to a standard midi file.
| water::MidiMessageSequence::MidiMessageSequence | ( | ) |
Creates an empty midi sequence object.
| water::MidiMessageSequence::MidiMessageSequence | ( | const MidiMessageSequence & | other | ) |
Creates a copy of another sequence.
| water::MidiMessageSequence::~MidiMessageSequence | ( | ) |
Destructor.
| MidiMessageSequence::MidiEventHolder * water::MidiMessageSequence::addEvent | ( | const MidiMessage & | newMessage, |
| double | timeAdjustment = 0 ) |
Inserts a midi message into the sequence.
The index at which the new message gets inserted will depend on its timestamp, because the sequence is kept sorted.
Remember to call updateMatchedPairs() after adding note-on events.
| newMessage | the new message to add (an internal copy will be made) |
| timeAdjustment | an optional value to add to the timestamp of the message that will be inserted |
| void water::MidiMessageSequence::addSequence | ( | const MidiMessageSequence & | other, |
| double | timeAdjustmentDelta ) |
Merges another sequence into this one. Remember to call updateMatchedPairs() after using this method.
| other | the sequence to add from |
| timeAdjustmentDelta | an amount to add to the timestamps of the midi events as they are read from the other sequence |
| void water::MidiMessageSequence::clear | ( | ) |
Clears the sequence.
|
noexcept |
Returns the timestamp of the last event in the sequence.
|
noexcept |
Returns a pointer to one of the events.
|
noexcept |
Returns the timestamp of the event at a given index. If the index is out-of-range, this will return 0.0
|
noexcept |
Returns the number of events in the sequence.
|
noexcept |
Returns the timestamp of the first event in the sequence.
| MidiMessageSequence & water::MidiMessageSequence::operator= | ( | const MidiMessageSequence & | other | ) |
Replaces this sequence with another one.
|
noexcept |
Forces a sort of the sequence. You may need to call this if you've manually modified the timestamps of some events such that the overall order now needs updating.
|
noexcept |
Swaps this sequence with another one.
|
noexcept |
Makes sure all the note-on and note-off pairs are up-to-date.
Call this after re-ordering messages or deleting/adding messages, and it will scan the list and make sure all the note-offs in the MidiEventHolder structures are pointing at the correct ones.
|
friend |
|
private |