FR: MidiMessageSequence::extractMidiChannelMessages() returns numevents extracted


#1
int MidiMessageSequence::extractMidiChannelMessages (const int channelNumberToExtract,
                                                      MidiMessageSequence& destSequence,
                                                      const bool alsoIncludeMetaEvents) const
{
    int numEvents = 0;
    for (int i = 0; i < list.size(); ++i)
    {
        const MidiMessage& mm = list.getUnchecked(i)->message;

        if (mm.isForChannel (channelNumberToExtract) || (alsoIncludeMetaEvents && mm.isMetaEvent())) {
            destSequence.addEvent (mm);
            numEvents++;
        }
    }
    return numEvents;
}

could be useful…