From 577f1571f8e8cf0dc5f6983ea5dd07cc6153f831 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 30 Nov 2007 22:12:27 +0000 Subject: don't put NDF/DF in clocks if there is no DF/NDF alternative; make deselect-all and invert-selection operations work properly; fix bug in edit range determination with no selected marker; popup dialog when no range can be determined; add new WINDOW modifier to SConscript to allow different conventions on OS X and linux git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2730 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_ops.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'gtk2_ardour/editor_ops.cc') diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 09182261d9..0508a7a6df 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -4479,6 +4479,9 @@ Editor::set_loop_from_edit_range (bool play) void Editor::set_loop_from_region (bool play) { + nframes64_t start = max_frames; + nframes64_t end = 0; + ensure_entered_region_selected (true); if (selection->regions.empty()) { @@ -4486,8 +4489,14 @@ Editor::set_loop_from_region (bool play) return; } - nframes64_t start = selection->regions.front()->region()->first_frame(); - nframes64_t end = selection->regions.front()->region()->last_frame() + 1; + for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { + if ((*i)->region()->position() < start) { + start = (*i)->region()->position(); + } + if ((*i)->region()->last_frame() + 1 > end) { + end = (*i)->region()->last_frame() + 1; + } + } set_loop_range (start, end, _("set loop range from region")); -- cgit v1.2.3