C++11 style iteration for MidiBuffer


#1

Would it be possible/sensible to implement support for the C++11 range based for loops in the MidiBuffer class? At the moment, having to use the MidiBuffer::Iterator etc is somewhat painful and messy.


#2

Yes please… +1


#3

It’s a little bit awkward because it needs to return both a message and time, but I guess the value the iterator produces could be a struct with a buffer pointer, size and time.


#4

or a std::pair<MidiBuffer, int>?


#5

Not really - you don’t really want to be passing a by-value copy of the message around, because this will often be called on the audio thread