27 #include <glibmm/threads.h>
38 class MidiNoteTracker;
39 class MidiStateTracker;
42 template<
typename TimeType,
typename DistanceType>
63 size_t size()
const {
return _size; }
64 bool empty()
const {
return _size == 0; }
86 throw std::exception ();
91 uint8_t
const *
bytes (
Item const & item, uint32_t& size)
const {
94 return &item.
bytes[1];
96 uint32_t offset = item.
offset & ~(1<<(CHAR_BIT-1));
97 Blob* blob =
reinterpret_cast<Blob*
> (&_pool[offset]);
108 void shift (DistanceType distance) {
109 for (
size_t n = 0; n < _size; ++n) {
110 _data[n].timestamp += distance;
146 Glib::Threads::RWLock::WriterLock
lm;
WriteProtectRender(RTMidiBufferBase &rtm)
Glib::Threads::RWLock::WriterLock lm
void track(MidiStateTracker &, TimeType start, TimeType end)
void convert(RTMidiBufferBase< Temporal::Beats, Temporal::Beats > &)
void track_state(TimeType when, MidiStateTracker &mst) const
DistanceType span() const
Item const & operator[](size_t n) const
uint32_t read(MidiBuffer &dst, TimeType start, TimeType end, MidiNoteTracker &tracker, DistanceType offset=0)
uint32_t write(TimeType time, Evoral::EventType type, uint32_t size, const uint8_t *buf)
uint32_t alloc_blob(uint32_t size)
void shift(DistanceType distance)
uint32_t store_blob(uint32_t size, uint8_t const *data)
uint8_t const * bytes(Item const &item, uint32_t &size) const
Glib::Threads::RWLock _lock
PBD::PropertyDescriptor< timepos_t > start
RTMidiBufferBase< samplepos_t, samplecnt_t > RTMidiBuffer
static int midi_event_size(uint8_t status)