Ardour  9.0-pre0-582-g084a23a80d
ARDOUR::MidiBuffer Class Reference

#include <midi_buffer.h>

Inheritance diagram for ARDOUR::MidiBuffer:
[legend]

Classes

class  iterator_base
 

Public Types

typedef samplepos_t TimeType
 
typedef iterator_base< MidiBuffer, Evoral::Event< TimeType > > iterator
 
typedef iterator_base< const MidiBuffer, const Evoral::Event< TimeType > > const_iterator
 

Public Member Functions

 MidiBuffer (size_t capacity)
 
 ~MidiBuffer ()
 
void clear ()
 
void silence (samplecnt_t nframes, samplecnt_t offset=0)
 
void read_from (const Buffer &src, samplecnt_t nframes, sampleoffset_t dst_offset=0, sampleoffset_t src_offset=0)
 
void merge_from (const Buffer &src, samplecnt_t nframes, sampleoffset_t dst_offset=0, sampleoffset_t src_offset=0)
 
void copy (const MidiBuffer &copy)
 
void copy (MidiBuffer const *const)
 
bool push_back (const Evoral::Event< TimeType > &event)
 
bool push_back (TimeType time, Evoral::EventType event_type, size_t size, const uint8_t *data)
 
uint8_t * reserve (TimeType time, Evoral::EventType event_type, size_t size)
 
void resize (size_t)
 
size_t size () const
 
bool empty () const
 
bool silent_data () const
 
bool insert_event (const Evoral::Event< 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)
 
- Public Member Functions inherited from ARDOUR::Buffer
 Buffer (const Buffer &)=delete
 
Bufferoperator= (const Buffer &)=delete
 
virtual ~Buffer ()
 
size_t capacity () const
 
DataType type () const
 
bool silent () const
 
- Public Member Functions inherited from Evoral::EventSink< samplepos_t >
virtual ~EventSink ()
 
virtual uint32_t write (samplepos_t time, EventType type, uint32_t size, const uint8_t *buf)=0
 

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 Buffercreate (DataType type, size_t capacity)
 

Static Private Member Functions

static size_t align32 (size_t s)
 

Private Attributes

uint8_t * _data
 [timestamp, event-type, event]* More...
 
pframes_t _size
 

Friends

class iterator_base< MidiBuffer, Evoral::Event< TimeType > >
 
class iterator_base< const MidiBuffer, const Evoral::Event< 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
 

Detailed Description

Buffer containing 8-bit unsigned char (MIDI) data.

Definition at line 37 of file midi_buffer.h.

Member Typedef Documentation

◆ const_iterator

◆ iterator

◆ TimeType

Definition at line 40 of file midi_buffer.h.

Constructor & Destructor Documentation

◆ MidiBuffer()

ARDOUR::MidiBuffer::MidiBuffer ( size_t  capacity)

◆ ~MidiBuffer()

ARDOUR::MidiBuffer::~MidiBuffer ( )

Member Function Documentation

◆ align32()

static size_t ARDOUR::MidiBuffer::align32 ( size_t  s)
inlinestaticprivate

Definition at line 205 of file midi_buffer.h.

◆ begin() [1/2]

iterator ARDOUR::MidiBuffer::begin ( )
inline

Definition at line 144 of file midi_buffer.h.

◆ begin() [2/2]

const_iterator ARDOUR::MidiBuffer::begin ( ) const
inline

Definition at line 147 of file midi_buffer.h.

◆ clear()

void ARDOUR::MidiBuffer::clear ( )
virtual

Clear the entire buffer

Reimplemented from ARDOUR::Buffer.

◆ copy() [1/2]

void ARDOUR::MidiBuffer::copy ( const MidiBuffer copy)

◆ copy() [2/2]

void ARDOUR::MidiBuffer::copy ( MidiBuffer const * const  )

◆ empty()

bool ARDOUR::MidiBuffer::empty ( ) const
inline

Definition at line 60 of file midi_buffer.h.

◆ end() [1/2]

iterator ARDOUR::MidiBuffer::end ( )
inline

Definition at line 145 of file midi_buffer.h.

◆ end() [2/2]

const_iterator ARDOUR::MidiBuffer::end ( ) const
inline

Definition at line 148 of file midi_buffer.h.

◆ erase()

iterator ARDOUR::MidiBuffer::erase ( const iterator i)
inline

Definition at line 150 of file midi_buffer.h.

◆ insert_event()

bool ARDOUR::MidiBuffer::insert_event ( const Evoral::Event< TimeType > &  event)

◆ merge_from()

void ARDOUR::MidiBuffer::merge_from ( const Buffer src,
samplecnt_t  nframes,
sampleoffset_t  dst_offset = 0,
sampleoffset_t  src_offset = 0 
)
virtual

Implements ARDOUR::Buffer.

◆ merge_in_place()

bool ARDOUR::MidiBuffer::merge_in_place ( const MidiBuffer other)

◆ push_back() [1/2]

bool ARDOUR::MidiBuffer::push_back ( const Evoral::Event< TimeType > &  event)

◆ push_back() [2/2]

bool ARDOUR::MidiBuffer::push_back ( TimeType  time,
Evoral::EventType  event_type,
size_t  size,
const uint8_t *  data 
)

◆ read_from()

void ARDOUR::MidiBuffer::read_from ( const Buffer src,
samplecnt_t  nframes,
sampleoffset_t  dst_offset = 0,
sampleoffset_t  src_offset = 0 
)
virtual

Implements ARDOUR::Buffer.

◆ reserve()

uint8_t* ARDOUR::MidiBuffer::reserve ( TimeType  time,
Evoral::EventType  event_type,
size_t  size 
)

◆ resize()

void ARDOUR::MidiBuffer::resize ( size_t  )
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.

◆ second_simultaneous_midi_byte_is_first()

static bool ARDOUR::MidiBuffer::second_simultaneous_midi_byte_is_first ( uint8_t  ,
uint8_t   
)
static

returns true if the message with the second argument as its MIDI status byte should precede the message with the first argument as its MIDI status byte.

◆ silence()

void ARDOUR::MidiBuffer::silence ( samplecnt_t  len,
samplecnt_t  offset = 0 
)
virtual

Clear (eg zero, or empty) buffer

Implements ARDOUR::Buffer.

◆ silent_data()

bool ARDOUR::MidiBuffer::silent_data ( ) const
inlinevirtual

Implements ARDOUR::Buffer.

Definition at line 61 of file midi_buffer.h.

◆ size()

size_t ARDOUR::MidiBuffer::size ( ) const
inline

Definition at line 59 of file midi_buffer.h.

◆ write()

uint32_t ARDOUR::MidiBuffer::write ( TimeType  time,
Evoral::EventType  type,
uint32_t  size,
const uint8_t *  buf 
)

EventSink interface for non-RT use (export, bounce).

Friends And Related Function Documentation

◆ iterator_base< const MidiBuffer, const Evoral::Event< TimeType > >

friend class iterator_base< const MidiBuffer, const Evoral::Event< TimeType > >
friend

Definition at line 199 of file midi_buffer.h.

◆ iterator_base< MidiBuffer, Evoral::Event< TimeType > >

friend class iterator_base< MidiBuffer, Evoral::Event< TimeType > >
friend

Definition at line 199 of file midi_buffer.h.

Member Data Documentation

◆ _data

uint8_t* ARDOUR::MidiBuffer::_data
private

[timestamp, event-type, event]*

Definition at line 213 of file midi_buffer.h.

◆ _size

pframes_t ARDOUR::MidiBuffer::_size
private

Definition at line 214 of file midi_buffer.h.


The documentation for this class was generated from the following file: