diff options
author | Carl Hetherington <carl@carlh.net> | 2011-04-17 13:55:41 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-04-17 13:55:41 +0000 |
commit | 80abf7693e63da5fba3426c8a32d7d65d6734a8b (patch) | |
tree | 7f7eec6daa54adbef0069a2304a44cadb94a8705 /gtk2_ardour/selection.cc | |
parent | 47018e771da7a4e9cb8c15e172259928d15f22a4 (diff) |
Remove extend-range-to-{start,end}-of-region and replace with move-range-{start,end}-to-{previous,next}-region boundary after discussions with Chris. Seems to make more sense, and works without the need for a region selection, which is fiddly to adjust when one is in range mode.
git-svn-id: svn://localhost/ardour2/branches/3.0@9360 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/selection.cc')
-rw-r--r-- | gtk2_ardour/selection.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc index d0b2cab5c7..f734d07375 100644 --- a/gtk2_ardour/selection.cc +++ b/gtk2_ardour/selection.cc @@ -769,6 +769,34 @@ Selection::set (framepos_t start, framepos_t end) return time.front().id; } +/** Set the start and end of the range selection. If more than one range + * is currently selected, the start of the earliest range and the end of the + * latest range are set. If no range is currently selected, this method + * selects a single range from start to end. + * + * @param start New start time. + * @param end New end time. + */ +void +Selection::set_preserving_all_ranges (framepos_t start, framepos_t end) +{ + if ((start == 0 && end == 0) || (end < start)) { + return; + } + + if (time.empty ()) { + time.push_back (AudioRange (start, end, next_time_id++)); + } else { + time.sort (AudioRangeComparator ()); + time.front().start = start; + time.back().end = end; + } + + time.consolidate (); + + TimeChanged (); +} + void Selection::set (boost::shared_ptr<Evoral::ControlList> ac) { |