59 size_t size()
const {
return _size; }
60 bool empty()
const {
return _size == 0; }
69 template<
typename BufferType,
typename EventType>
96 assert(event_size >= 0);
99 *((
TimeType*)(buffer->_data + offset)),
100 event_size, ev_start);
106 assert(event_size >= 0);
109 *(
reinterpret_cast<TimeType*
>((uintptr_t)(buffer->_data + offset))),
110 event_size, ev_start);
114 return reinterpret_cast<TimeType*
>((uintptr_t)(buffer->_data + offset));
124 assert(event_size >= 0);
130 return (buffer != other.
buffer) || (offset != other.
offset);
134 return (buffer == other.
buffer) && (offset == other.
offset);
151 assert (i.
buffer ==
this);
155 if (event_size < 0) {
162 if (total_data_deleted >= _size) {
168 if (i.
offset + total_data_deleted >= _size) {
169 assert (_size > total_data_deleted);
170 _size -= total_data_deleted;
178 for (a = i.
offset, b = i.
offset + total_data_deleted; b < _size; ++b, ++a) {
182 _size -= total_data_deleted;
199 static bool second_simultaneous_midi_byte_is_first (uint8_t, uint8_t);
203 friend class
iterator_base< const MidiBuffer, const Evoral::Event<TimeType> >;
205 static size_t align32 (size_t s) {
206 #if defined(__arm__) || defined(__aarch64__)
207 return ((s - 1) | 3) + 1;
iterator_base(const iterator_base< BufferType, EventType > &o)
iterator_base< BufferType, EventType > & operator++()
iterator_base(BufferType &b, samplecnt_t o)
EventType operator*() const
bool operator==(const iterator_base< BufferType, EventType > &other) const
Evoral::EventType * event_type_ptr()
bool operator!=(const iterator_base< BufferType, EventType > &other) const
MidiBuffer(size_t capacity)
uint8_t * _data
[timestamp, event-type, event]*
iterator_base< MidiBuffer, Evoral::Event< TimeType > > iterator
iterator erase(const iterator &i)
bool merge_in_place(const MidiBuffer &other)
void read_from(const Buffer &src, samplecnt_t nframes, sampleoffset_t dst_offset=0, sampleoffset_t src_offset=0)
void silence(samplecnt_t nframes, samplecnt_t offset=0)
void merge_from(const Buffer &src, samplecnt_t nframes, sampleoffset_t dst_offset=0, sampleoffset_t src_offset=0)
void copy(MidiBuffer const *const)
const_iterator begin() const
const_iterator end() const
uint32_t write(TimeType time, Evoral::EventType type, uint32_t size, const uint8_t *buf)
iterator_base< const MidiBuffer, const Evoral::Event< TimeType > > const_iterator
bool push_back(const Evoral::Event< TimeType > &event)
uint8_t * reserve(TimeType time, Evoral::EventType event_type, size_t size)
bool push_back(TimeType time, Evoral::EventType event_type, size_t size, const uint8_t *data)
bool insert_event(const Evoral::Event< TimeType > &event)
void copy(const MidiBuffer ©)
Temporal::samplecnt_t samplecnt_t
Temporal::sampleoffset_t sampleoffset_t
Temporal::samplepos_t samplepos_t
static int midi_event_size(uint8_t status)