13
0

Don't add origin value to MIDI controller regions on initial insert.

This should probably hijack the same modifier as the guard points and work the
same on all automation tracks, but I did it this way to not change behaviour of
track automation where a default is much more reasonable.
This commit is contained in:
David Robillard 2014-11-16 02:09:33 -05:00
parent d63161426f
commit b4fcdbb100
3 changed files with 4 additions and 4 deletions

View File

@ -176,7 +176,7 @@ AutomationRegionView::add_automation_event (GdkEvent *, framepos_t when, double
view->session()->begin_reversible_command (_("add automation event")); view->session()->begin_reversible_command (_("add automation event"));
XMLNode& before = _line->the_list()->get_state(); XMLNode& before = _line->the_list()->get_state();
_line->the_list()->add (when_d, y, with_guard_points); _line->the_list()->add (when_d, y, with_guard_points, false);
XMLNode& after = _line->the_list()->get_state(); XMLNode& after = _line->the_list()->get_state();

View File

@ -121,7 +121,7 @@ public:
virtual bool clamp_value (double& /*when*/, double& /*value*/) const { return true; } virtual bool clamp_value (double& /*when*/, double& /*value*/) const { return true; }
virtual void add (double when, double value, bool with_guards=true); virtual void add (double when, double value, bool with_guards=true, bool with_default=true);
virtual void editor_add (double when, double value); virtual void editor_add (double when, double value);
void fast_simple_add (double when, double value); void fast_simple_add (double when, double value);

View File

@ -477,7 +477,7 @@ ControlList::editor_add (double when, double value)
} }
void void
ControlList::add (double when, double value, bool with_guards) ControlList::add (double when, double value, bool with_guards, bool with_default)
{ {
/* this is for making changes from some kind of user interface or /* this is for making changes from some kind of user interface or
control surface (GUI, MIDI, OSC etc) control surface (GUI, MIDI, OSC etc)
@ -494,7 +494,7 @@ ControlList::add (double when, double value, bool with_guards)
ControlEvent cp (when, 0.0f); ControlEvent cp (when, 0.0f);
iterator insertion_point; iterator insertion_point;
if (_events.empty()) { if (_events.empty() && with_default) {
/* as long as the point we're adding is not at zero, /* as long as the point we're adding is not at zero,
* add an "anchor" point there. * add an "anchor" point there.