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: 
   <Object id="automation TrackID TYPE" ../>
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.
This commit is contained in:
Robin Gareus 2015-08-24 02:42:31 +02:00
parent 6129b3492d
commit cc9c38ce5e

View File

@ -527,7 +527,9 @@ MidiTrack::non_realtime_locate (framepos_t pos)
if ((tcontrol = boost::dynamic_pointer_cast<MidiTrack::MidiControl>(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()));
}
}
}
}