summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2017-06-21 23:02:52 +1000
committernick_m <mainsbridge@gmail.com>2017-07-22 02:15:20 +1000
commit1d8548306be536e6c82a179bc38c8f8dbd12a700 (patch)
tree7f50a33a63296ea72a01183a23417610119d7b4d /gtk2_ardour
parent6e5c046f9022fb90747a72673986633ccd0948a3 (diff)
Cropping a single region to time selection works for multiple ranges
Should fix 7285.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_ops.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 512648993c..c8a778f5ad 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -3369,15 +3369,22 @@ Editor::crop_region_to_selection ()
{
if (!selection->time.empty()) {
- crop_region_to (selection->time.start(), selection->time.end_frame());
-
+ begin_reversible_command (_("Crop Regions to Time Selection"));
+ for (std::list<AudioRange>::iterator i = selection->time.begin(); i != selection->time.end(); ++i) {
+ crop_region_to ((*i).start, (*i).end);
+ }
+ commit_reversible_command();
} else {
framepos_t start;
framepos_t end;
if (get_edit_op_range (start, end)) {
+ begin_reversible_command (_("Crop Regions to Edit Range"));
+
crop_region_to (start, end);
+
+ commit_reversible_command();
}
}
@@ -3424,7 +3431,6 @@ Editor::crop_region_to (framepos_t start, framepos_t end)
framepos_t new_start;
framepos_t new_end;
framecnt_t new_length;
- bool in_command = false;
for (vector<boost::shared_ptr<Playlist> >::iterator i = playlists.begin(); i != playlists.end(); ++i) {
@@ -3454,19 +3460,11 @@ Editor::crop_region_to (framepos_t start, framepos_t end)
new_end = min (end, new_end);
new_length = new_end - new_start + 1;
- if(!in_command) {
- begin_reversible_command (_("trim to selection"));
- in_command = true;
- }
(*i)->clear_changes ();
(*i)->trim_to (new_start, new_length);
_session->add_command (new StatefulDiffCommand (*i));
}
}
-
- if (in_command) {
- commit_reversible_command ();
- }
}
void