mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
MidiBuffer: Add iterator compatible with C++11 range-for
This commit is contained in:
parent
e7e1de78fa
commit
eae9a10944
21 changed files with 259 additions and 205 deletions
|
|
@ -147,12 +147,15 @@ private:
|
|||
//==============================================================================
|
||||
static MidiBuffer filterMidiMessagesForChannel (const MidiBuffer& input, int channel)
|
||||
{
|
||||
MidiMessage msg;
|
||||
int samplePosition;
|
||||
MidiBuffer output;
|
||||
|
||||
for (MidiBuffer::Iterator it (input); it.getNextEvent (msg, samplePosition);)
|
||||
if (msg.getChannel() == channel) output.addEvent (msg, samplePosition);
|
||||
for (const auto metadata : input)
|
||||
{
|
||||
const auto message = metadata.getMessage();
|
||||
|
||||
if (message.getChannel() == channel)
|
||||
output.addEvent (message, metadata.samplePosition);
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue