summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_ops.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r--gtk2_ardour/editor_ops.cc122
1 files changed, 74 insertions, 48 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 55382bbaca..0a7543b214 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -3906,69 +3906,82 @@ Editor::cut_copy (CutCopyOp op)
return;
}
- RegionSelection rs;
-
- /* we only want to cut regions if some are selected */
+ if (internal_editing()) {
- if (!selection->regions.empty()) {
- get_regions_for_action (rs);
- }
-
- switch (current_mouse_mode()) {
- case MouseObject:
- if (!rs.empty() || !selection->points.empty()) {
+ switch (current_mouse_mode()) {
+ case MouseObject:
+ case MouseRange:
+ cut_copy_midi (op);
+ break;
+ default:
+ break;
+ }
+
+ } else {
+
+ RegionSelection rs;
+
+ /* we only want to cut regions if some are selected */
+
+ if (!selection->regions.empty()) {
+ get_regions_for_action (rs);
+ }
+
+ switch (current_mouse_mode()) {
+ case MouseObject:
+ if (!rs.empty() || !selection->points.empty()) {
- begin_reversible_command (opname + _(" objects"));
+ begin_reversible_command (opname + _(" objects"));
- if (!rs.empty()) {
- cut_copy_regions (op, rs);
+ if (!rs.empty()) {
+ cut_copy_regions (op, rs);
- if (op == Cut) {
- selection->clear_regions ();
+ if (op == Cut) {
+ selection->clear_regions ();
+ }
}
- }
- if (!selection->points.empty()) {
- cut_copy_points (op);
+ if (!selection->points.empty()) {
+ cut_copy_points (op);
- if (op == Cut) {
- selection->clear_points ();
+ if (op == Cut) {
+ selection->clear_points ();
+ }
}
- }
- commit_reversible_command ();
- break; // terminate case statement here
- }
- if (!selection->time.empty()) {
- /* don't cause suprises */
- break;
- }
- // fall thru if there was nothing selected
+ commit_reversible_command ();
+ break; // terminate case statement here
+ }
+ if (!selection->time.empty()) {
+ /* don't cause suprises */
+ break;
+ }
+ // fall thru if there was nothing selected
- case MouseRange:
- if (selection->time.empty()) {
- nframes64_t start, end;
- if (!get_edit_op_range (start, end)) {
- return;
+ case MouseRange:
+ if (selection->time.empty()) {
+ nframes64_t start, end;
+ if (!get_edit_op_range (start, end)) {
+ return;
+ }
+ selection->set ((TimeAxisView*) 0, start, end);
}
- selection->set ((TimeAxisView*) 0, start, end);
- }
- begin_reversible_command (opname + _(" range"));
- cut_copy_ranges (op);
- commit_reversible_command ();
+ begin_reversible_command (opname + _(" range"));
+ cut_copy_ranges (op);
+ commit_reversible_command ();
- if (op == Cut) {
- selection->clear_time ();
- }
+ if (op == Cut) {
+ selection->clear_time ();
+ }
- break;
+ break;
- default:
- break;
+ default:
+ break;
+ }
}
-
-
+
if (op == Cut || op == Clear) {
break_drag ();
delete _drag;
@@ -3992,6 +4005,20 @@ Editor::cut_copy_points (CutCopyOp op)
}
}
+/** Cut, copy or clear selected automation points.
+ * @param op Operation (Cut, Copy or Clear)
+ */
+void
+Editor::cut_copy_midi (CutCopyOp op)
+{
+ cerr << "CCM: there are " << selection->midi.size() << " MRV's to work on\n";
+
+ for (MidiSelection::iterator i = selection->midi.begin(); i != selection->midi.end(); ++i) {
+ MidiRegionView* mrv = *i;
+ mrv->cut_copy_clear (op);
+ }
+}
+
struct PlaylistState {
boost::shared_ptr<Playlist> playlist;
XMLNode* before;
@@ -4307,7 +4334,6 @@ Editor::paste_internal (nframes64_t position, float times)
/* get everything in the correct order */
-
if (!selection->tracks.empty()) {
sort_track_selection ();
ts = selection->tracks;