diff options
Diffstat (limited to 'gtk2_ardour/automation_line.cc')
-rw-r--r-- | gtk2_ardour/automation_line.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index 1b20d4c287..880f0aa3e8 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -806,7 +806,6 @@ AutomationLine::end_drag () new MementoCommand<AutomationList>(memento_command_binder (), 0, &alist->get_state()) ); - trackview.editor().session()->commit_reversible_command (); trackview.editor().session()->set_dirty (); } @@ -1338,3 +1337,18 @@ AutomationLine::set_maximum_time (framepos_t t) { _maximum_time = t; } + + +/** @return min and max x positions of points that are in the list, in session frames */ +pair<framepos_t, framepos_t> +AutomationLine::get_point_x_range () const +{ + pair<framepos_t, framepos_t> r (max_frames, 0); + + for (AutomationList::const_iterator i = the_list()->begin(); i != the_list()->end(); ++i) { + r.first = min (r.first, _time_converter.to ((*i)->when) + _time_converter.origin_b ()); + r.second = max (r.second, _time_converter.to ((*i)->when) + _time_converter.origin_b ()); + } + + return r; +} |