|
AudioDataLib
A C++ library of classes supporting a variety of audio-data tasks.
|
This is a single time-line of MIDI messages (also called events), or a sequence of MIDI messages meant to execute one after another. More...
#include <MidiData.h>
Public Member Functions | |
| Track () | |
| virtual | ~Track () |
| void | Clear () |
| template<typename T > | |
| const T * | FindEvent (std::function< bool(T *)> matchFunc) const |
| const MetaEvent * | FindMetaEventOfType (uint8_t type) const |
| const Event * | GetEvent (uint32_t i) const |
| const std::vector< Event * > & | GetEventArray () const |
| void | AddEvent (Event *event) |
This is a single time-line of MIDI messages (also called events), or a sequence of MIDI messages meant to execute one after another.
A MIDI file can contain one or more tracks, all meant to play in parallel with one another. That is, unless the FormatType is VARIOUS_TRACKS, in which case, the tracks are independent, I believe.
| MidiData::Track::Track | ( | ) |
|
virtual |
Append the given event object to this track's event array. Note that this class takes ownership of the event memory, and it is expected that the given event is allocated on the heap.
| void MidiData::Track::Clear | ( | ) |
Remove all MIDI messages from this track.
|
inline |
Find a MIDI message in the track of the given type using the given predicate.
| [in] | T | The type of MIDI message. |
| [in] | matchFunc | A lambda to return true if the given event is the one for which you are looking. |
Find a meta-event of the given type in this track.
| [in] | type | The type of meta-event. See the MetaEvent::Type enumeration. |
| const MidiData::Event * MidiData::Track::GetEvent | ( | uint32_t | i | ) | const |
Get a pointer to an event in the track at the given offset.
| [in] | i | Events are stored in an array. This is the offset into that array to the desired event. |
For convenient, get a reference to the event array owned by the Track class.