diff options
author | nick_m <mainsbridge@gmail.com> | 2016-06-12 00:42:43 +1000 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-06-12 00:42:43 +1000 |
commit | e973e39f06c81fc301c8b059c5240cc17c6671ad (patch) | |
tree | a156b00f014fcd540a054650b87cc1493f78a925 /gtk2_ardour | |
parent | ec8a4de01596c162c1529f3021dfc432bf66dfe8 (diff) |
Set tempo sections to the exact pulse when snapped to a musical grid.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index c95979514f..635a590b6a 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -3335,29 +3335,22 @@ 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); TempoMap& map (_editor->session()->tempo_map()); - const bool was_music = _real_section->position_lock_style() == MusicTime; - const framepos_t pf = adjusted_current_frame (event); + /* snap to beat is -2, snap to bar is -3 (sorry) */ + int sub_num = _editor->get_grid_beat_divisions (0); - /* cop-out : we really should set the musical position of music-locked tempo sections here, which generally works well. - The problem is that when the mouse pointer's motion causes the location of the beat to change in a more-or-less - chaotic way when cross-dragging tempo sections (the beat the pointer is now above could have changed without any pointer motion). - Until there is a way to deal with this, just pretend the tempo section is audio-locked. - */ - if (was_music) { - _real_section->set_position_lock_style (AudioTime); + if (_editor->snap_type() == SnapToBar) { + sub_num = -3; + } else if (_editor->snap_type() == SnapToBeat) { + sub_num = -2; } - map.gui_move_tempo (_real_section, pf); - - if (was_music) { - _real_section->set_position_lock_style (MusicTime); - } + map.gui_move_tempo (_real_section, pf, _editor->get_grid_beat_divisions (0)); show_verbose_cursor_time (_real_section->frame()); } - _marker->set_position (adjusted_current_frame (event, false)); } |