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
This commit is contained in:
Paul Davis 2010-08-04 23:45:01 +00:00
parent 1018368aef
commit 355c079f10
2 changed files with 9 additions and 0 deletions

View File

@ -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>

View File

@ -394,4 +394,5 @@ StepEntry::beat_resync_click ()
void
StepEntry::bar_resync_click ()
{
_mtv->step_edit_bar_sync ();
}