_buffer->clear ();
- assert (_buffer->size () == 0);
-
if (sends_output ()) {
jack_midi_clear_buffer (jack_port_get_buffer (_jack_port, nframes));
}
void* jack_buffer = jack_port_get_buffer (_jack_port, nframes);
const pframes_t event_count = jack_midi_get_event_count (jack_buffer);
- assert (event_count < _buffer->capacity());
-
/* suck all relevant MIDI events from the JACK MIDI port buffer
into our MidiBuffer
*/
void
MidiPort::resolve_notes (void* jack_buffer, MidiBuffer::TimeType when)
{
-
for (uint8_t channel = 0; channel <= 0xF; channel++) {
- uint8_t ev[3] = { MIDI_CMD_CONTROL | channel, MIDI_CTL_SUSTAIN, 0 };
+ uint8_t ev[3] = { ((uint8_t) (MIDI_CMD_CONTROL | channel)), MIDI_CTL_SUSTAIN, 0 };
/* we need to send all notes off AND turn the
* sustain/damper pedal off to handle synths
assert (ev.time() < (nframes + _global_port_buffer_offset + _port_buffer_offset));
- if (ev.event_type() == LoopEventType) {
- resolve_notes (jack_buffer, ev.time());
- continue;
- }
-
if (ev.time() >= _global_port_buffer_offset + _port_buffer_offset) {
if (jack_midi_event_write (jack_buffer, (jack_nframes_t) ev.time(), ev.buffer(), ev.size()) != 0) {
cerr << "write failed, drop flushed note off on the floor, time "
}
}
+void
+MidiPort::require_resolve ()
+{
+ _resolve_required = true;
+}
+
void
MidiPort::transport_stopped ()
{