MIDI robustness.

- Separate SMF::open and SMF::create, more powerful interface for both.
- Correctly handle note ons with velocity 0 as note offs in sequence.
- Use SMF (i.e. libsmf) for MIDI import


git-svn-id: svn://localhost/ardour2/branches/3.0@4558 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2009-02-14 20:52:15 +00:00
parent b0091c899b
commit 80e54c6ea0
11 changed files with 185 additions and 92 deletions

View file

@ -23,17 +23,17 @@ namespace Evoral {
#ifdef EVORAL_EVENT_ALLOC
template<typename Timestamp>
Event<Timestamp>::Event(EventType type, Timestamp timestamp, uint32_t size, uint8_t* buffer, bool alloc)
Event<Timestamp>::Event(EventType type, Timestamp time, uint32_t size, uint8_t* buf, bool alloc)
: _type(type)
, _time(timestamp)
, _time(time)
, _size(size)
, _buf(buffer)
, _buf(buf)
, _owns_buf(alloc)
{
if (alloc) {
_buf = (uint8_t*)malloc(_size);
if (buffer) {
memcpy(_buf, buffer, _size);
if (buf) {
memcpy(_buf, buf, _size);
} else {
memset(_buf, 0, _size);
}