diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-08-16 14:24:41 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-08-16 14:24:41 +0000 |
commit | f6951c92f04ed17ec98a2d1cd9bcf535ce6f037c (patch) | |
tree | 135769f8d8d18e6004fffd37671cc678f7ab3e2e /gtk2_ardour/step_editor.cc | |
parent | 6a3ce666c6716ceb9378e508d6116f83c32957c7 (diff) |
attempt to fix deep confusion in GUI code about converting between musical and audio time (should have beneficial effects on #4257); change ghost note drawing when in MIDI note draw/add mode so that its start is aligned with the mouse cursor
git-svn-id: svn://localhost/ardour2/branches/3.0@9998 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/step_editor.cc')
-rw-r--r-- | gtk2_ardour/step_editor.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/gtk2_ardour/step_editor.cc b/gtk2_ardour/step_editor.cc index 51052d0025..45e286dc70 100644 --- a/gtk2_ardour/step_editor.cc +++ b/gtk2_ardour/step_editor.cc @@ -123,7 +123,7 @@ StepEditor::reset_step_edit_beat_pos () frames_from_start = 0; } - step_edit_beat_pos = step_edit_region_view->frames_to_beats (frames_from_start); + step_edit_beat_pos = step_edit_region_view->region_frames_to_region_beats (frames_from_start); step_edit_region_view->move_step_edit_cursor (step_edit_beat_pos); } @@ -210,7 +210,7 @@ StepEditor::move_step_edit_beat_pos (Evoral::MusicalTime beats) { if (beats > 0.0) { step_edit_beat_pos = min (step_edit_beat_pos + beats, - step_edit_region_view->frames_to_beats (step_edit_region->length())); + step_edit_region_view->region_frames_to_region_beats (step_edit_region->length())); } else if (beats < 0.0) { if (-beats < step_edit_beat_pos) { step_edit_beat_pos += beats; // its negative, remember @@ -257,8 +257,7 @@ StepEditor::step_add_note (uint8_t channel, uint8_t pitch, uint8_t velocity, Evo /* make sure its visible on the horizontal axis */ - framepos_t fpos = step_edit_region->position() + - step_edit_region_view->beats_to_frames (step_edit_beat_pos + beat_duration); + framepos_t fpos = step_edit_region_view->region_beats_to_absolute_frames (step_edit_beat_pos + beat_duration); if (fpos >= (_editor.leftmost_position() + _editor.current_page_frames())) { _editor.reset_x_origin (fpos - (_editor.current_page_frames()/4)); @@ -378,10 +377,9 @@ StepEditor::step_edit_bar_sync () return; } - framepos_t fpos = step_edit_region->position() + - step_edit_region_view->beats_to_frames (step_edit_beat_pos); + framepos_t fpos = step_edit_region_view->region_beats_to_absolute_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())); + step_edit_beat_pos = ceil (step_edit_region_view->region_frames_to_region_beats (fpos - step_edit_region->position())); step_edit_region_view->move_step_edit_cursor (step_edit_beat_pos); } |