JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
juce::MidiBufferIterator Class Reference

An iterator to move over contiguous raw MIDI data, which Allows iterating over a MidiBuffer using C++11 range-for syntax. More...

#include "juce_MidiBuffer.h"

Public Types

using difference_type = std::iterator_traits< Ptr >::difference_type
 
using value_type = MidiMessageMetadata
 
using reference = MidiMessageMetadata
 
using pointer = void
 
using iterator_category = std::input_iterator_tag
 

Public Member Functions

 MidiBufferIterator (const uint8 *dataIn) noexcept
 Constructs an iterator pointing at the message starting at the byte dataIn.
 
MidiBufferIteratoroperator++ () noexcept
 Make this iterator point to the next message in the buffer.
 
MidiBufferIterator operator++ (int) noexcept
 Create a copy of this object, make this iterator point to the next message in the buffer, then return the copy.
 
bool operator== (const MidiBufferIterator &other) const noexcept
 Return true if this iterator points to the same message as another iterator instance, otherwise return false.
 
bool operator!= (const MidiBufferIterator &other) const noexcept
 Return false if this iterator points to the same message as another iterator instance, otherwise returns true.
 
reference operator* () const noexcept
 Return an instance of MidiMessageMetadata which describes the message to which the iterator is currently pointing.
 

Detailed Description

An iterator to move over contiguous raw MIDI data, which Allows iterating over a MidiBuffer using C++11 range-for syntax.

In the following example, we log all three-byte messages in a midi buffer.

void processBlock (AudioBuffer<float>&, MidiBuffer& midiBuffer) override
{
for (const MidiMessageMetadata metadata : midiBuffer)
if (metadata.numBytes == 3)
Logger::writeToLog (metadata.getMessage().getDescription());
}
A multi-channel buffer containing floating point audio samples.
Acts as an application-wide logging class.
Definition juce_Logger.h:41
Holds a sequence of time-stamped midi events.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
Definition juce_Memory.h:88
A view of MIDI message data stored in a contiguous buffer.

@tags{Audio}

Definition at line 78 of file juce_MidiBuffer.h.

Member Typedef Documentation

◆ difference_type

using juce::MidiBufferIterator::difference_type = std::iterator_traits<Ptr>::difference_type

Definition at line 95 of file juce_MidiBuffer.h.

◆ iterator_category

Definition at line 99 of file juce_MidiBuffer.h.

◆ pointer

using juce::MidiBufferIterator::pointer = void

Definition at line 98 of file juce_MidiBuffer.h.

◆ reference

Definition at line 97 of file juce_MidiBuffer.h.

◆ value_type

Definition at line 96 of file juce_MidiBuffer.h.

Constructor & Destructor Documentation

◆ MidiBufferIterator()

juce::MidiBufferIterator::MidiBufferIterator ( const uint8 dataIn)
explicitnoexcept

Constructs an iterator pointing at the message starting at the byte dataIn.

dataIn must point to the start of a valid MIDI message. If it does not, calling other member functions on the iterator will result in undefined behaviour.

Definition at line 90 of file juce_MidiBuffer.h.

Member Function Documentation

◆ operator!=()

bool juce::MidiBufferIterator::operator!= ( const MidiBufferIterator other) const
noexcept

Return false if this iterator points to the same message as another iterator instance, otherwise returns true.

Definition at line 117 of file juce_MidiBuffer.h.

◆ operator*()

MidiBufferIterator::reference juce::MidiBufferIterator::operator* ( ) const
noexcept

Return an instance of MidiMessageMetadata which describes the message to which the iterator is currently pointing.

Definition at line 96 of file juce_MidiBuffer.cpp.

◆ operator++() [1/2]

MidiBufferIterator & juce::MidiBufferIterator::operator++ ( )
noexcept

Make this iterator point to the next message in the buffer.

Definition at line 83 of file juce_MidiBuffer.cpp.

◆ operator++() [2/2]

MidiBufferIterator juce::MidiBufferIterator::operator++ ( int  )
noexcept

Create a copy of this object, make this iterator point to the next message in the buffer, then return the copy.

Definition at line 89 of file juce_MidiBuffer.cpp.

◆ operator==()

bool juce::MidiBufferIterator::operator== ( const MidiBufferIterator other) const
noexcept

Return true if this iterator points to the same message as another iterator instance, otherwise return false.

Definition at line 112 of file juce_MidiBuffer.h.


The documentation for this class was generated from the following files: