summaryrefslogtreecommitdiff
path: root/gtk2_ardour/step_editor.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/step_editor.cc')
-rw-r--r--gtk2_ardour/step_editor.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/gtk2_ardour/step_editor.cc b/gtk2_ardour/step_editor.cc
index f94c4ca989..481c60d7aa 100644
--- a/gtk2_ardour/step_editor.cc
+++ b/gtk2_ardour/step_editor.cc
@@ -96,7 +96,12 @@ StepEditor::prepare_step_edit_region ()
step_edit_region_view = dynamic_cast<MidiRegionView*> (rv);
} else {
- step_edit_region = _mtv.add_region (step_edit_insert_position);
+
+ const Meter& m = _mtv.session()->tempo_map().meter_at (step_edit_insert_position);
+ const Tempo& t = _mtv.session()->tempo_map().tempo_at (step_edit_insert_position);
+
+ step_edit_region = _mtv.add_region (step_edit_insert_position, floor (m.frames_per_bar (t, _mtv.session()->frame_rate())), true);
+
RegionView* rv = _mtv.midi_view()->find_view (step_edit_region);
step_edit_region_view = dynamic_cast<MidiRegionView*>(rv);
}