From d325e7302c8f5b34459597c9e5c0a5bfbbbb2fb7 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 7 Dec 2016 11:16:10 +0000 Subject: [PATCH] another wide ranging set of changes to get this MIDI handling a step further. Notably ... reading from MidiRingBuffer into MidiBuffer includes the event size, rather than relying on the MIDI bytes to determine size. This isn't required for MIDI, but is a more portable design for other event types. --- libs/ardour/ardour/event_ring_buffer.h | 25 ++++++++++++++-- libs/ardour/ardour/lua_api.h | 3 +- libs/ardour/ardour/midi_buffer.h | 6 ++-- libs/ardour/lua_api.cc | 11 ++++--- libs/ardour/midi_buffer.cc | 31 ++++++++++++++------ libs/ardour/midi_model.cc | 16 +++-------- libs/ardour/midi_ring_buffer.cc | 4 +-- libs/evoral/evoral/Event.hpp | 40 ++++++++++---------------- libs/evoral/evoral/Note.hpp | 13 ++++++--- libs/evoral/src/Note.cpp | 22 +++++++------- libs/evoral/src/Sequence.cpp | 17 ++++++++--- 11 files changed, 109 insertions(+), 79 deletions(-) diff --git a/libs/ardour/ardour/event_ring_buffer.h b/libs/ardour/ardour/event_ring_buffer.h index c7344c5ca7..4a3180b1a5 100644 --- a/libs/ardour/ardour/event_ring_buffer.h +++ b/libs/ardour/ardour/event_ring_buffer.h @@ -25,6 +25,7 @@ #include "pbd/ringbufferNPT.h" +#include "evoral/Event.hpp" #include "evoral/EventSink.hpp" #include "evoral/types.hpp" @@ -61,8 +62,10 @@ public: */ inline bool peek (uint8_t*, size_t size); - inline uint32_t write(Time time, Evoral::EventType type, uint32_t size, const uint8_t* buf); - inline bool read (Time* time, Evoral::EventType* type, uint32_t* size, uint8_t* buf); + inline uint32_t write (Time time, Evoral::EventType type, uint32_t size, const uint8_t* buf); + inline uint32_t write (Evoral::Event