Handle edits while playing precisely.

This avoids stuck notes if active notes are edited, but without stopping all
active notes in the region on any edit as before.

This implementation injects note ons in places that aren't actually note
starts.  Depending on how percussive the instrument is, this may not be
desired.  In the future, an option for this would be an improvement, but there
are other places where "start notes in the middle" is a reasonable option.  I
think that should be handled universally if we're to do it at all, so not
considering it a part of this fix for now.
This commit is contained in:
David Robillard
2015-03-01 13:33:25 -05:00
parent 09f1571fc0
commit a8aae56d92
16 changed files with 440 additions and 139 deletions

View File

@@ -63,6 +63,22 @@ Event<Timestamp>::Event(EventType type, Timestamp time, uint32_t size, uint8_t*
}
}
template<typename Timestamp>
Event<Timestamp>::Event(EventType type,
Timestamp time,
uint32_t size,
const uint8_t* buf)
: _type(type)
, _original_time(time)
, _nominal_time(time)
, _size(size)
, _buf((uint8_t*)malloc(size))
, _id(-1)
, _owns_buf(true)
{
memcpy(_buf, buf, _size);
}
template<typename Timestamp>
Event<Timestamp>::Event(const Event& copy, bool owns_buf)
: _type(copy._type)