diff options
author | David Robillard <d@drobilla.net> | 2016-11-07 05:14:55 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-12-03 15:28:19 -0500 |
commit | 398a318934769dae51efe972f7ffdefc52ea2963 (patch) | |
tree | 5b68a8fac44f0c154e7e00fd45d9e7f2c16e35fb /libs/ardour/midi_state_tracker.cc | |
parent | bfbc4566ad82573a57e1ec84d583f308ee35eef0 (diff) |
Fix event type and parameter type confusion
I'm not sure if this is really the best way to do event types (should it
just be a completely static enum in evoral, or completely dynamic and
provided by the type map, or a mix like currently?), but previously the
event type was frequently set to either total garbage, or parameter
types, which are a different thing.
This fixes all those cases, and makes Evoral::EventType an enum so the
compiler will warn about implicit conversions from int.
Diffstat (limited to 'libs/ardour/midi_state_tracker.cc')
-rw-r--r-- | libs/ardour/midi_state_tracker.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/ardour/midi_state_tracker.cc b/libs/ardour/midi_state_tracker.cc index 17ecd10e94..4374c06463 100644 --- a/libs/ardour/midi_state_tracker.cc +++ b/libs/ardour/midi_state_tracker.cc @@ -123,7 +123,7 @@ MidiStateTracker::resolve_notes (MidiBuffer &dst, framepos_t time) while (_active_notes[note + 128 * channel]) { uint8_t buffer[3] = { ((uint8_t) (MIDI_CMD_NOTE_OFF | channel)), uint8_t (note), 0 }; Evoral::Event<MidiBuffer::TimeType> noteoff - (MIDI_CMD_NOTE_OFF, time, 3, buffer, false); + (Evoral::MIDI_EVENT, time, 3, buffer, false); /* note that we do not care about failure from push_back() ... should we warn someone ? */ @@ -157,7 +157,7 @@ MidiStateTracker::resolve_notes (Evoral::EventSink<framepos_t> &dst, framepos_t /* note that we do not care about failure from write() ... should we warn someone ? */ - dst.write (time, midi_parameter_type (buf[0]), 3, buf); + dst.write (time, Evoral::MIDI_EVENT, 3, buf); _active_notes[note + 128 * channel]--; DEBUG_TRACE (PBD::DEBUG::MidiTrackers, string_compose ("%1: EVS-resolved note %2/%3 at %4\n", this, (int) note, (int) channel, time)); @@ -181,7 +181,7 @@ MidiStateTracker::resolve_notes (MidiSource& src, const MidiSource::Lock& lock, for (int channel = 0; channel < 16; ++channel) { for (int note = 0; note < 128; ++note) { while (_active_notes[note + 128 * channel]) { - Evoral::Event<Evoral::Beats> ev ((MIDI_CMD_NOTE_OFF|channel), time, 3, 0, true); + Evoral::Event<Evoral::Beats> ev (Evoral::MIDI_EVENT, time, 3, 0, true); ev.set_type (MIDI_CMD_NOTE_OFF); ev.set_channel (channel); ev.set_note (note); |