summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_drag.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-10-30 23:21:42 +1100
committernick_m <mainsbridge@gmail.com>2016-11-11 03:37:08 +1100
commit0e867b544b6d1b5f82f46cec7171998b2f2ca3bc (patch)
treecc9605fbd8ed505aedb3e1d04cfa301a84ad8b33 /gtk2_ardour/editor_drag.cc
parentae63243bf3af8ab4dad8535ac2811df399c9a34a (diff)
Refactor tempo api, include quarter-note distance in frames method.
- moves frame rounding up to TempoMap, which is needed in order to calculate pulse distance without frame rounding. - the time unit for tempo is still minute, but this now also applies to meter sections. (new audio locked meter sections no longer require a frame position). - there is no longer a discontinuity in the pulse for audio-locked meter/tempi. - temporarily add debugging output in Region::set_position() to test for region beat not matching region frame.
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r--gtk2_ardour/editor_drag.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 5ed00274dc..c32b2932ae 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -3198,7 +3198,7 @@ MeterMarkerDrag::motion (GdkEvent* event, bool first_move)
}
const double beat = map.beat_at_bbt (bbt);
_real_section = map.add_meter (Meter (_marker->meter().divisions_per_bar(), _marker->meter().note_divisor())
- , beat, bbt, map.frame_at_bbt (bbt), _real_section->position_lock_style());
+ , beat, bbt, _real_section->position_lock_style());
if (!_real_section) {
aborted (true);
return;
@@ -3341,7 +3341,8 @@ TempoMarkerDrag::motion (GdkEvent* event, bool first_move)
_editor->begin_reversible_command (_("copy tempo mark"));
if (_real_section->position_lock_style() == MusicTime) {
- _real_section = map.add_tempo (tempo, map.pulse_at_frame (frame), 0, type, MusicTime);
+ const int32_t divisions = _editor->get_grid_music_divisions (event->button.state);
+ _real_section = map.add_tempo (tempo, map.exact_qn_at_frame (frame, divisions), 0, type, MusicTime);
} else {
_real_section = map.add_tempo (tempo, 0.0, frame, type, AudioTime);
}