diff options
author | David Robillard <d@drobilla.net> | 2016-11-06 22:04:35 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-12-03 15:18:21 -0500 |
commit | 08fffeffec10beb708610fd35eb9e7c35365d446 (patch) | |
tree | ce9c8c77e6a926b4d8be90052c32945b7718bb4b /libs/ardour/midi_buffer.cc | |
parent | 875b1367b2c4750ecd861424c57ed4bcc9c642d2 (diff) |
Remove Evoral::MIDIEvent
It is slightly questionable whether type specific methods like
velocity() belong on Event at all, these may be better off as free
functions. However the code currently uses them as methods in many
places, and it seems like a step in the right direction, since, for
example, we might some day have events that have a velocity but aren't
stored as MIDI messages (e.g. if Ardour uses an internal musical model
that is more expressive).
In any case, the former inheritance and plethora of sloppy casts is
definitely not the right thing.
Diffstat (limited to 'libs/ardour/midi_buffer.cc')
-rw-r--r-- | libs/ardour/midi_buffer.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/ardour/midi_buffer.cc b/libs/ardour/midi_buffer.cc index 516d5a98c7..652be5290c 100644 --- a/libs/ardour/midi_buffer.cc +++ b/libs/ardour/midi_buffer.cc @@ -110,7 +110,7 @@ MidiBuffer::read_from (const Buffer& src, framecnt_t nframes, frameoffset_t dst_ } for (MidiBuffer::const_iterator i = msrc.begin(); i != msrc.end(); ++i) { - const Evoral::MIDIEvent<TimeType> ev(*i, false); + const Evoral::Event<TimeType> ev(*i, false); if (dst_offset >= 0) { /* Positive offset: shifting events from internal @@ -168,7 +168,7 @@ MidiBuffer::merge_from (const Buffer& src, framecnt_t /*nframes*/, frameoffset_t * @return false if operation failed (not enough room) */ bool -MidiBuffer::push_back(const Evoral::MIDIEvent<TimeType>& ev) +MidiBuffer::push_back(const Evoral::Event<TimeType>& ev) { return push_back (ev.time(), ev.size(), ev.buffer()); } @@ -220,7 +220,7 @@ MidiBuffer::push_back(TimeType time, size_t size, const uint8_t* data) } bool -MidiBuffer::insert_event(const Evoral::MIDIEvent<TimeType>& ev) +MidiBuffer::insert_event(const Evoral::Event<TimeType>& ev) { if (size() == 0) { return push_back(ev); @@ -273,7 +273,7 @@ MidiBuffer::insert_event(const Evoral::MIDIEvent<TimeType>& ev) uint32_t MidiBuffer::write(TimeType time, Evoral::EventType type, uint32_t size, const uint8_t* buf) { - insert_event(Evoral::MIDIEvent<TimeType>(type, time, size, const_cast<uint8_t*>(buf))); + insert_event(Evoral::Event<TimeType>(type, time, size, const_cast<uint8_t*>(buf))); return size; } |