Public Member Functions

MidiBuffer::Iterator Class Reference

Used to iterate through the events in a MidiBuffer. More...

List of all members.

Public Member Functions

 Iterator (const MidiBuffer &buffer) noexcept
 Creates an Iterator for this MidiBuffer.
 ~Iterator () noexcept
 Destructor.
void setNextSamplePosition (int samplePosition) noexcept
 Repositions the iterator so that the next event retrieved will be the first one whose sample position is at greater than or equal to the given position.
bool getNextEvent (MidiMessage &result, int &samplePosition) noexcept
 Retrieves a copy of the next event from the buffer.
bool getNextEvent (const uint8 *&midiData, int &numBytesOfMidiData, int &samplePosition) noexcept
 Retrieves the next event from the buffer.

Detailed Description

Used to iterate through the events in a MidiBuffer.

Note that altering the buffer while an iterator is using it isn't a safe operation.

See also:
MidiBuffer

Constructor & Destructor Documentation

MidiBuffer::Iterator::Iterator ( const MidiBuffer buffer )

Creates an Iterator for this MidiBuffer.

MidiBuffer::Iterator::~Iterator (  )

Destructor.


Member Function Documentation

void MidiBuffer::Iterator::setNextSamplePosition ( int  samplePosition )

Repositions the iterator so that the next event retrieved will be the first one whose sample position is at greater than or equal to the given position.

bool MidiBuffer::Iterator::getNextEvent ( MidiMessage result,
int &  samplePosition 
)

Retrieves a copy of the next event from the buffer.

Parameters:
resulton return, this will be the message (the MidiMessage's timestamp is not set)
samplePositionon return, this will be the position of the event
Returns:
true if an event was found, or false if the iterator has reached the end of the buffer
bool MidiBuffer::Iterator::getNextEvent ( const uint8 *&  midiData,
int &  numBytesOfMidiData,
int &  samplePosition 
)

Retrieves the next event from the buffer.

Parameters:
midiDataon return, this pointer will be set to a block of data containing the midi message. Note that to make it fast, this is a pointer directly into the MidiBuffer's internal data, so is only valid temporarily until the MidiBuffer is altered.
numBytesOfMidiDataon return, this is the number of bytes of data used by the midi message
samplePositionon return, this will be the position of the event
Returns:
true if an event was found, or false if the iterator has reached the end of the buffer

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines