13
0

Always place first automation point using the current value

This is in preparation to always show a line, which show
the current value in case there are no automation points yet.

It also unconditionally snapshots the current value without
changing automation modes to touch/write first.
This commit is contained in:
Robin Gareus 2022-04-25 18:28:58 +02:00
parent be927f7a58
commit 1dafa5017e
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 10 additions and 12 deletions

View File

@ -198,17 +198,15 @@ AutomationRegionView::add_automation_event (GdkEvent *, timepos_t const & w, dou
_line->view_to_model_coord_y (y);
if (UIConfiguration::instance().get_new_automation_points_on_lane()) {
if (c->list()->size () == 0) {
/* we need the MidiTrack::MidiControl, not the region's (midi model source) control */
boost::shared_ptr<ARDOUR::MidiTrack> mt = boost::dynamic_pointer_cast<ARDOUR::MidiTrack> (view->parent_stripable ());
assert (mt);
boost::shared_ptr<Evoral::Control> mc = mt->control(_parameter);
assert (mc);
y = mc->user_double ();
} else {
y = c->list()->eval (when);
}
if (c->list()->size () == 0) {
/* we need the MidiTrack::MidiControl, not the region's (midi model source) control */
boost::shared_ptr<ARDOUR::MidiTrack> mt = boost::dynamic_pointer_cast<ARDOUR::MidiTrack> (view->parent_stripable ());
assert (mt);
boost::shared_ptr<Evoral::Control> mc = mt->control(_parameter);
assert (mc);
y = mc->user_double ();
} else if (UIConfiguration::instance().get_new_automation_points_on_lane()) {
y = c->list()->eval (when);
}
XMLNode& before = _line->the_list()->get_state();

View File

@ -770,7 +770,7 @@ AutomationTimeAxisView::add_automation_event (GdkEvent* event, timepos_t const &
timepos_t when (pos);
_editor.snap_to_with_modifier (when, event);
if (UIConfiguration::instance().get_new_automation_points_on_lane()) {
if (UIConfiguration::instance().get_new_automation_points_on_lane() || _control->list()->size ()) {
if (_control->list()->size () == 0) {
y = _control->get_value ();
} else {