summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-08-24 03:41:42 +1000
committernick_m <mainsbridge@gmail.com>2016-08-24 03:41:42 +1000
commitac8617017ae94bf17cdd5b1f6e38e1434bcb2c54 (patch)
tree27c5017c6cd0f29231e56a4025fc5609ccf52b2e
parent88f723e8d8913fc1ee2b041df73596022ff77a06 (diff)
Don't attempt to snap to the current musical grid when dragging tempi.
-rw-r--r--gtk2_ardour/editor_drag.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 98ccf4a6a2..0c046e56ab 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -3355,11 +3355,21 @@ TempoMarkerDrag::motion (GdkEvent* event, bool first_move)
show_verbose_cursor_text (strs.str());
} else if (_movable && !_real_section->locked_to_meter()) {
- const framepos_t pf = adjusted_current_frame (event);
+ framepos_t pf;
+
+ if (_editor->snap_musical()) {
+ /* we can't snap to a grid that we are about to move.
+ * gui_move_tempo() will sort out snap using the supplied beat divisions.
+ */
+ pf = adjusted_current_frame (event, false);
+ } else {
+ pf = adjusted_current_frame (event);
+ }
+
TempoMap& map (_editor->session()->tempo_map());
/* snap to beat is 1, snap to bar is -1 (sorry) */
- int sub_num = _editor->get_grid_music_divisions (event->button.state);
+ const int sub_num = _editor->get_grid_music_divisions (event->button.state);
map.gui_move_tempo (_real_section, pf, sub_num);