summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-05-24 02:50:42 +1000
committernick_m <mainsbridge@gmail.com>2016-05-27 23:38:17 +1000
commitf54b75c869348501a4603bfe7adce46b50781b5b (patch)
treed4d94435c26dacf76d36b4d5b96a9f91ee662b50 /gtk2_ardour
parent8b2f73d5ac73c9f05000aa0204b033f9de0dd3c3 (diff)
Tempo ramps - consolidate meter dragging code.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_drag.cc25
1 files changed, 8 insertions, 17 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 9cbeb1984a..16c1862dd8 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -3185,25 +3185,16 @@ MeterMarkerDrag::motion (GdkEvent* event, bool first_move)
}
}
- framepos_t const pf = adjusted_current_frame (event, false);
- if (_marker->meter().position_lock_style() == MusicTime) {
- TempoMap& map (_editor->session()->tempo_map());
- Timecode::BBT_Time bbt;
- map.bbt_time (pf, bbt);
- /* round bbt to bars */
- map.round_bbt (bbt, -1, RoundNearest);
+ framepos_t pf = adjusted_current_frame (event);
- if ((bbt.bars != _real_section->bbt().bars && pf > last_pointer_frame())
- || (bbt.bars < _real_section->bbt().bars && pf < last_pointer_frame())) {
-
- /* move meter beat-based */
- _editor->session()->tempo_map().gui_move_meter_bbt (_real_section, bbt);
- }
- } else {
- /* AudioTime */
- /* move meter frame-based */
- _editor->session()->tempo_map().gui_move_meter_frame (_real_section, pf);
+ if (_real_section->position_lock_style() == AudioTime && _editor->snap_musical()) {
+ /* never snap to music for audio locked */
+ pf = adjusted_current_frame (event, false);
}
+
+ _editor->session()->tempo_map().gui_move_meter (_real_section, pf);
+
+ setup_pointer_frame_offset ();
_marker->set_position (pf);
show_verbose_cursor_time (_real_section->frame());
}