diff options
author | nick_m <mainsbridge@gmail.com> | 2016-08-13 02:23:07 +1000 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-08-14 03:04:53 +1000 |
commit | 5c2ccc4f3eeccaedf8399e0c80d0394cf2b4f132 (patch) | |
tree | 3725e8f5b4abf8c0a2dc1f277ba8e5e9999b5561 /gtk2_ardour/step_editor.cc | |
parent | 23d1d1f55bdb6c1e4418284afdf50c74dc1e25ed (diff) |
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.
Diffstat (limited to 'gtk2_ardour/step_editor.cc')
-rw-r--r-- | gtk2_ardour/step_editor.cc | 2 |
1 files changed, 1 insertions, 1 deletions
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; |