示例#1
0
void Lv2ControlConnection::process(bool rolling, jack_position_t &pos, jack_nframes_t nframes, jack_nframes_t time)
{
    connection->getSource()->process(rolling, pos, nframes, time);
    u_int32_t eventIndex = 0;
    u_int32_t eventCount = connection->getEventCount();
    while(eventIndex < eventCount) {
        MidiEvent *nextEvent = connection->getEvent(eventIndex);
        if(nextEvent->matches(MidiEvent::TYPE_CONTROL)) {
            // check mappings
            Lv2ControlMapping *mapping = mappings.getFirst();
            while(mapping) {
                mapping->update(nextEvent->getDatabyte1(), nextEvent->getDatabyte2());
                mapping = mappings.getNext(mapping);
            }
        }
        // pull up next event
        nextEvent = eventIndex < eventCount ? connection->getEvent(eventIndex++) : 0;
    }
}