From cc9c38ce5e79f8bcd558b1b6e694915f47aa3af4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 24 Aug 2015 02:42:31 +0200 Subject: Do not send non-automated MIDI-CCs on locate. If a "CC" automation lane was visible at least once, a Control Object is created and henceforth saved with the session: It is currently not possible to remove this object. (Automation > clear will only zero all events, but not remove the Control itself. The bug: After showing a MIDI-CC lane at least once Events are sent for this CC. If there is no corresponding value in the .mid, it will be zero after session reload. see also 7e2c8ac Still ToDo: "Show existing automation" shows the lane even if there are no values nor any automation at all for the given CC. --- libs/ardour/midi_track.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libs/ardour/midi_track.cc') diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index e48d516575..6d7b4519c5 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -527,7 +527,9 @@ MidiTrack::non_realtime_locate (framepos_t pos) if ((tcontrol = boost::dynamic_pointer_cast(c->second)) && (rcontrol = region->control(tcontrol->parameter()))) { const Evoral::Beats pos_beats = bfc.from(pos - origin); - tcontrol->set_value(rcontrol->list()->eval(pos_beats.to_double())); + if (rcontrol->list()->size() > 0) { + tcontrol->set_value(rcontrol->list()->eval(pos_beats.to_double())); + } } } } -- cgit v1.2.3