ardour
|
#include <midi_buffer.h>
Classes | |
class | iterator_base |
Public Types | |
typedef framepos_t | TimeType |
typedef iterator_base < MidiBuffer, Evoral::MIDIEvent< TimeType > > | iterator |
typedef iterator_base< const MidiBuffer, const Evoral::MIDIEvent< TimeType > > | const_iterator |
Public Member Functions | |
MidiBuffer (size_t capacity) | |
~MidiBuffer () | |
void | silence (framecnt_t nframes, framecnt_t offset=0) |
void | read_from (const Buffer &src, framecnt_t nframes, framecnt_t dst_offset=0, framecnt_t src_offset=0) |
void | merge_from (const Buffer &src, framecnt_t nframes, framecnt_t dst_offset=0, framecnt_t src_offset=0) |
void | copy (const MidiBuffer ©) |
bool | push_back (const Evoral::MIDIEvent< TimeType > &event) |
bool | push_back (TimeType time, size_t size, const uint8_t *data) |
uint8_t * | reserve (TimeType time, size_t size) |
void | resize (size_t) |
size_t | size () const |
bool | empty () const |
bool | insert_event (const Evoral::MIDIEvent< TimeType > &event) |
bool | merge_in_place (const MidiBuffer &other) |
uint32_t | write (TimeType time, Evoral::EventType type, uint32_t size, const uint8_t *buf) |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
iterator | erase (const iterator &i) |
uint8_t * | data () const |
Public Member Functions inherited from ARDOUR::Buffer | |
virtual | ~Buffer () |
size_t | capacity () const |
DataType | type () const |
bool | silent () const |
virtual void | clear () |
Public Member Functions inherited from Evoral::EventSink< framepos_t > | |
virtual | ~EventSink () |
Static Public Member Functions | |
static bool | second_simultaneous_midi_byte_is_first (uint8_t, uint8_t) |
Static Public Member Functions inherited from ARDOUR::Buffer | |
static Buffer * | create (DataType type, size_t capacity) |
Private Attributes | |
uint8_t * | _data |
timestamp, event, timestamp, event, ... More... | |
pframes_t | _size |
Friends | |
class | iterator_base< MidiBuffer, Evoral::MIDIEvent< TimeType > > |
class | iterator_base< const MidiBuffer, const Evoral::MIDIEvent< TimeType > > |
Additional Inherited Members | |
Protected Member Functions inherited from ARDOUR::Buffer | |
Buffer (DataType type) | |
Protected Attributes inherited from ARDOUR::Buffer | |
DataType | _type |
pframes_t | _capacity |
bool | _silent |
Buffer containing 8-bit unsigned char (MIDI) data.
Definition at line 35 of file midi_buffer.h.
typedef iterator_base< const MidiBuffer, const Evoral::MIDIEvent<TimeType> > ARDOUR::MidiBuffer::const_iterator |
Definition at line 125 of file midi_buffer.h.
Definition at line 124 of file midi_buffer.h.
Definition at line 38 of file midi_buffer.h.
MidiBuffer::MidiBuffer | ( | size_t | capacity | ) |
Definition at line 35 of file midi_buffer.cc.
MidiBuffer::~MidiBuffer | ( | ) |
Definition at line 45 of file midi_buffer.cc.
|
inline |
Definition at line 127 of file midi_buffer.h.
|
inline |
Definition at line 130 of file midi_buffer.h.
void MidiBuffer::copy | ( | const MidiBuffer & | copy | ) |
Definition at line 74 of file midi_buffer.cc.
|
inline |
Definition at line 168 of file midi_buffer.h.
|
inline |
Definition at line 56 of file midi_buffer.h.
|
inline |
Definition at line 128 of file midi_buffer.h.
|
inline |
Definition at line 131 of file midi_buffer.h.
Definition at line 133 of file midi_buffer.h.
bool MidiBuffer::insert_event | ( | const Evoral::MIDIEvent< TimeType > & | event | ) |
Definition at line 203 of file midi_buffer.cc.
|
virtual |
Implements ARDOUR::Buffer.
Definition at line 118 of file midi_buffer.cc.
bool MidiBuffer::merge_in_place | ( | const MidiBuffer & | other | ) |
Merge other into this buffer. Realtime safe.
Definition at line 423 of file midi_buffer.cc.
bool MidiBuffer::push_back | ( | const Evoral::MIDIEvent< TimeType > & | ev | ) |
Push an event into the buffer.
Note that the raw MIDI pointed to by ev will be COPIED and unmodified. That is, the caller still owns it, if it needs freeing it's Not My Problem(TM). Realtime safe.
Definition at line 136 of file midi_buffer.cc.
bool MidiBuffer::push_back | ( | TimeType | time, |
size_t | size, | ||
const uint8_t * | data | ||
) |
Push an event into the buffer.
Definition at line 161 of file midi_buffer.cc.
|
virtual |
Read events from src starting at time offset into the START of this buffer, for time duration nframes. Relative time, where 0 = start of buffer.
Note that offset and nframes refer to sample time, NOT buffer offsets or event counts.
Implements ARDOUR::Buffer.
Definition at line 88 of file midi_buffer.cc.
uint8_t * MidiBuffer::reserve | ( | TimeType | time, |
size_t | size | ||
) |
Reserve space for a new event in the buffer.
This call is for copying MIDI directly into the buffer, the data location (of sufficient size to write size bytes) is returned, or 0 on failure. This call MUST be immediately followed by a write to the returned data location, or the buffer will be corrupted and very nasty things will happen.
Definition at line 268 of file midi_buffer.cc.
|
virtual |
Reallocate the buffer used internally to handle at least size_t units of data.
The buffer is not silent after this operation. the capacity argument passed to the constructor must have been non-zero.
Implements ARDOUR::Buffer.
Definition at line 51 of file midi_buffer.cc.
|
static |
returns true if the message with the second argument as its MIDI status byte should preceed the message with the first argument as its MIDI status byte.
Definition at line 301 of file midi_buffer.cc.
|
virtual |
Clear (eg zero, or empty) buffer
Implements ARDOUR::Buffer.
Definition at line 290 of file midi_buffer.cc.
|
inline |
Definition at line 55 of file midi_buffer.h.
|
virtual |
EventSink interface for non-RT use (export, bounce).
Implements Evoral::EventSink< framepos_t >.
Definition at line 254 of file midi_buffer.cc.
|
friend |
Definition at line 179 of file midi_buffer.h.
|
friend |
Definition at line 178 of file midi_buffer.h.
|
private |
timestamp, event, timestamp, event, ...
Definition at line 181 of file midi_buffer.h.
|
private |
Definition at line 182 of file midi_buffer.h.