summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2020-01-11 10:56:19 -0700
committerPaul Davis <paul@linuxaudiosystems.com>2020-01-11 10:57:21 -0700
commitd79e869da8397063d782a8bda52445f666f85109 (patch)
tree42a333616f361b2aa70f6c78ded9f30bc7daa20e
parent8547a23e9c7f811bda48fddf81c7b187fbc86581 (diff)
use "extends to numeric_limits<Beats>::max()" rather than "zero length" for nascent (incoming) notes
-rw-r--r--libs/evoral/Sequence.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/evoral/Sequence.cc b/libs/evoral/Sequence.cc
index a1f166cd77..448a9ab199 100644
--- a/libs/evoral/Sequence.cc
+++ b/libs/evoral/Sequence.cc
@@ -664,7 +664,7 @@ Sequence<Time>::end_write (StuckNoteOption option, Time when)
typename Notes::iterator next = n;
++next;
- if (!(*n)->length()) {
+ if ((*n)->end_time() == std::numeric_limits<Temporal::Beats>::max()) {
switch (option) {
case Relax:
break;
@@ -997,7 +997,11 @@ Sequence<Time>::append_note_on_unlocked (const Event<Time>& ev, event_id_t evid)
return;
}
- NotePtr note(new Note<Time>(ev.channel(), ev.time(), Time(), ev.note(), ev.velocity()));
+ /* nascent (incoming notes without a note-off ...yet) have a duration
+ that extends to Beats::max()
+ */
+ NotePtr note(new Note<Time>(ev.channel(), ev.time(), std::numeric_limits<Temporal::Beats>::max() - ev.time(), ev.note(), ev.velocity()));
+ assert (note->end_time() == std::numeric_limits<Temporal::Beats>::max());
note->set_id (evid);
add_note_unlocked (note);