summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2016-11-21 22:19:56 +1000
committerTim Mayberry <mojofunk@gmail.com>2016-11-21 22:19:56 +1000
commit73f3e479d363ef35bb12a89b61d21609a7428e19 (patch)
tree6e418829abd90b2955aa2c8d78f1ff1d33812ebc /gtk2_ardour
parentd4190d37612ac1b9f12f83d3952ed6584c085923 (diff)
Make Cut mode respect snap modifer
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor.h2
-rw-r--r--gtk2_ardour/editor_drag.cc12
-rw-r--r--gtk2_ardour/editor_ops.cc11
-rw-r--r--gtk2_ardour/public_editor.h2
4 files changed, 17 insertions, 10 deletions
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index beb3978c7f..57e72393fa 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -536,7 +536,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
/* editing operations that need to be public */
void mouse_add_new_marker (framepos_t where, bool is_cd=false);
- void split_regions_at (framepos_t, RegionSelection&, const int32_t sub_num);
+ void split_regions_at (framepos_t, RegionSelection&, const int32_t sub_num, bool snap = true);
void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false);
RegionSelection get_regions_from_selection_and_mouse (framepos_t);
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 5d0bfc60ed..4e52649850 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -6534,12 +6534,12 @@ RegionCutDrag::start_grab (GdkEvent* event, Gdk::Cursor* c)
}
void
-RegionCutDrag::motion (GdkEvent*, bool)
+RegionCutDrag::motion (GdkEvent* event, bool)
{
- framepos_t where = _drags->current_pointer_frame();
- _editor->snap_to (where);
+ framepos_t pos = _drags->current_pointer_frame();
+ _editor->snap_to_with_modifier (pos, event);
- line->set_position (where);
+ line->set_position (pos);
}
void
@@ -6548,6 +6548,7 @@ RegionCutDrag::finished (GdkEvent* event, bool)
_editor->get_track_canvas()->canvas()->re_enter();
framepos_t pos = _drags->current_pointer_frame();
+ _editor->snap_to_with_modifier (pos, event);
line->hide ();
@@ -6557,7 +6558,8 @@ RegionCutDrag::finished (GdkEvent* event, bool)
return;
}
- _editor->split_regions_at (pos, rs, _editor->get_grid_music_divisions (event->button.state));
+ _editor->split_regions_at (pos, rs, _editor->get_grid_music_divisions (event->button.state),
+ false);
}
void
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 0037ac8bc7..643780a490 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -166,7 +166,8 @@ Editor::redo (uint32_t n)
}
void
-Editor::split_regions_at (framepos_t where, RegionSelection& regions, const int32_t sub_num)
+Editor::split_regions_at (framepos_t where, RegionSelection& regions, const int32_t sub_num,
+ bool snap_frame)
{
bool frozen = false;
@@ -192,10 +193,14 @@ Editor::split_regions_at (framepos_t where, RegionSelection& regions, const int3
case SnapToRegionEnd:
break;
default:
- snap_to (where);
+ if (snap_frame) {
+ snap_to (where);
+ }
}
} else {
- snap_to (where);
+ if (snap_frame) {
+ snap_to (where);
+ }
frozen = true;
EditorFreeze(); /* Emit Signal */
diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h
index 576fd17096..fb6da74dbf 100644
--- a/gtk2_ardour/public_editor.h
+++ b/gtk2_ardour/public_editor.h
@@ -289,7 +289,7 @@ class PublicEditor : public Gtkmm2ext::Tabbable {
virtual void restore_editing_space () = 0;
virtual framepos_t get_preferred_edit_position (Editing::EditIgnoreOption = Editing::EDIT_IGNORE_NONE, bool from_context_menu = false, bool from_outside_canvas = false) = 0;
virtual void toggle_meter_updating() = 0;
- virtual void split_regions_at (framepos_t, RegionSelection&, const int32_t sub_num) = 0;
+ virtual void split_regions_at (framepos_t, RegionSelection&, const int32_t sub_num, bool snap) = 0;
virtual void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false) = 0;
virtual void mouse_add_new_marker (framepos_t where, bool is_cd=false) = 0;
virtual void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>) = 0;