mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-11 09:06:33 +01:00
fix handling of zero _follow_length in MIDI triggers
This commit is contained in:
parent
521beab486
commit
c3732e12ea
1 changed files with 4 additions and 2 deletions
|
|
@ -1583,7 +1583,7 @@ MIDITrigger::set_expected_end_sample (Temporal::TempoMap::SharedPtr const & tmap
|
||||||
|
|
||||||
Temporal::Beats usable_length;
|
Temporal::Beats usable_length;
|
||||||
|
|
||||||
if (end_by_follow_length && (end_by_follow_length < end_by_data_length)) {
|
if ((_follow_length != Temporal::BBT_Offset()) && (end_by_follow_length < end_by_data_length)) {
|
||||||
usable_length = tmap->quarters_at (tmap->bbt_walk (transition_bbt, _follow_length)) - transition_beats;
|
usable_length = tmap->quarters_at (tmap->bbt_walk (transition_bbt, _follow_length)) - transition_beats;
|
||||||
} else {
|
} else {
|
||||||
usable_length = data_length;
|
usable_length = data_length;
|
||||||
|
|
@ -1593,7 +1593,7 @@ MIDITrigger::set_expected_end_sample (Temporal::TempoMap::SharedPtr const & tmap
|
||||||
|
|
||||||
if (launch_style() != Repeat || (q == Temporal::BBT_Offset())) {
|
if (launch_style() != Repeat || (q == Temporal::BBT_Offset())) {
|
||||||
|
|
||||||
if (end_by_follow_length) {
|
if (_follow_length != Temporal::BBT_Offset()) {
|
||||||
final_beat = end_by_follow_length;
|
final_beat = end_by_follow_length;
|
||||||
} else {
|
} else {
|
||||||
final_beat = end_by_data_length;
|
final_beat = end_by_data_length;
|
||||||
|
|
@ -1855,6 +1855,8 @@ MIDITrigger::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sam
|
||||||
|
|
||||||
const Temporal::Beats maybe_last_event_timeline_beats = transition_beats + (event.time() - region_start);
|
const Temporal::Beats maybe_last_event_timeline_beats = transition_beats + (event.time() - region_start);
|
||||||
|
|
||||||
|
// std::cerr << "considering " << event << " with sb " << start_beats << " eb " << end_beats << " tb " << maybe_last_event_timeline_beats << " fb " << final_beat << endl;
|
||||||
|
|
||||||
if (maybe_last_event_timeline_beats >= final_beat) {
|
if (maybe_last_event_timeline_beats >= final_beat) {
|
||||||
/* do this to "fake" having reached the end */
|
/* do this to "fake" having reached the end */
|
||||||
DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 tlrr %2 >- fb %3, so at end\n", index(), maybe_last_event_timeline_beats, final_beat));
|
DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 tlrr %2 >- fb %3, so at end\n", index(), maybe_last_event_timeline_beats, final_beat));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue