diff options
author | Carl Hetherington <carl@carlh.net> | 2010-09-09 21:35:28 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-09-09 21:35:28 +0000 |
commit | 86244875a40206694c142af8fe1128f28293c467 (patch) | |
tree | 7a643215fa39e9538fff5fc282139866c44fe529 /gtk2_ardour/automation_line.cc | |
parent | 5f27e70016a88cbb9a77275ce3e5798540f9bbdf (diff) |
Allow drags of automation in time ranges where the automation is on a MIDI track and may span different regions. Fixes #3366.
git-svn-id: svn://localhost/ardour2/branches/3.0@7765 d708f5d6-7413-0410-9779-e7cbd77b26cf
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; +} |