snap tempo marker drags to the nearest beat
authorPaul Davis <paul@linuxaudiosystems.com>
Sat, 7 Jan 2012 15:10:31 +0000 (15:10 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Sat, 7 Jan 2012 15:10:31 +0000 (15:10 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@11183 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor_drag.cc

index 830efbfeefd8a8aa58ac637a35e995be21c15313..7d088d0684459bda31c6d4c4a443008c8681054d 100644 (file)
@@ -2093,10 +2093,11 @@ TempoMarkerDrag::finished (GdkEvent* event, bool movement_occurred)
 
        motion (event, false);
 
+       TempoMap& map (_editor->session()->tempo_map());
+       framepos_t beat_time = map.round_to_beat (last_pointer_frame(), 0);
        Timecode::BBT_Time when;
 
-       TempoMap& map (_editor->session()->tempo_map());
-       map.bbt_time (last_pointer_frame(), when);
+       map.bbt_time (beat_time, when);
 
        if (_copy == true) {
                _editor->begin_reversible_command (_("copy tempo mark"));