diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-08-04 23:45:01 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-08-04 23:45:01 +0000 |
commit | 355c079f1050fbf38327e92ac890d44f2d402031 (patch) | |
tree | 6f8bb2665131c4a71be0eb7e39769bc23b3e799b /gtk2_ardour/midi_time_axis.cc | |
parent | 1018368aef84931249c73f41caf66735172f2105 (diff) |
make bar-resync button in step editor work (move insertion point to next bar boundary)
git-svn-id: svn://localhost/ardour2/branches/3.0@7543 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_time_axis.cc')
-rw-r--r-- | gtk2_ardour/midi_time_axis.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index b2c6cb81ae..3dada95f84 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -1093,6 +1093,14 @@ MidiTimeAxisView::step_edit_beat_sync () void MidiTimeAxisView::step_edit_bar_sync () { + if (!_session || !step_edit_region_view || !step_edit_region) { + return; + } + + nframes64_t fpos = step_edit_region->position() + + step_edit_region_view->beats_to_frames (step_edit_beat_pos); + fpos = _session->tempo_map().round_to_bar (fpos, 1); + step_edit_beat_pos = ceil (step_edit_region_view->frames_to_beats (fpos - step_edit_region->position())); } boost::shared_ptr<Region> |