- if (input) {
- DEBUG_TRACE(PBD::DEBUG::LV2,
- string_compose("%1 bytes of MIDI waiting @ %2\n",
- mbuf.size(), (void*) mbuf.data()));
-
- LV2_Evbuf_Iterator i = lv2_evbuf_begin(evbuf);
- const uint32_t type = LV2Plugin::midi_event_type();
- for (MidiBuffer::iterator e = mbuf.begin(); e != mbuf.end(); ++e) {
- const Evoral::MIDIEvent<framepos_t> ev(*e, false);
-#ifndef NDEBUG
- DEBUG_TRACE(PBD::DEBUG::LV2,
- string_compose("\tMIDI event of size %1 @ %2\n",
- ev.size(), ev.time()));
- for (uint16_t x = 0; x < ev.size(); ++x) {
- std::stringstream ss;
- ss << "\t\tev[" << x << "] = " << std::hex << (int) ev.buffer()[x] << std::dec << std::endl;
- DEBUG_TRACE (PBD::DEBUG::LV2, ss.str());
- }
-#endif
- lv2_evbuf_write(&i, ev.time(), 0, type, ev.size(), ev.buffer());
- }
- }