From 5c2ccc4f3eeccaedf8399e0c80d0394cf2b4f132 Mon Sep 17 00:00:00 2001 From: nick_m Date: Sat, 13 Aug 2016 02:23:07 +1000 Subject: Allow negative return in TempoMap::beat_at_frame() and its exact_ variant. - audio-locked midi regions can be start-trimmed properly when close to 1|1|0 - a midi region placed before the first meter will continue the tempo curve and first meter. Only a couple of callers require change, as bbt_at_beat() already deals with this. --- gtk2_ardour/step_editor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gtk2_ardour/step_editor.cc') diff --git a/gtk2_ardour/step_editor.cc b/gtk2_ardour/step_editor.cc index 3ea3bb4ccd..c45c0f4461 100644 --- a/gtk2_ardour/step_editor.cc +++ b/gtk2_ardour/step_editor.cc @@ -117,7 +117,7 @@ StepEditor::prepare_step_edit_region () const Meter& m = _mtv.session()->tempo_map().meter_at_frame (step_edit_insert_position); - double baf = _mtv.session()->tempo_map().beat_at_frame (step_edit_insert_position); + double baf = max (0.0, _mtv.session()->tempo_map().beat_at_frame (step_edit_insert_position)); double next_bar_in_beats = baf + m.divisions_per_bar(); framecnt_t next_bar_pos = _mtv.session()->tempo_map().frame_at_beat (next_bar_in_beats); framecnt_t len = next_bar_pos - step_edit_insert_position; -- cgit v1.2.3