Ardour  8.7-15-gadf511264b
Evoral::Event< Time > Class Template Reference

#include <Event.h>

Public Member Functions

 Event (EventType type=NO_EVENT, Time time=Time(), uint32_t size=0, uint8_t *buf=NULL, bool alloc=false)
 
 Event (EventType type, Time time, uint32_t size, const uint8_t *buf)
 
 Event (const Event &copy, bool alloc)
 
 ~Event ()
 
void assign (const Event &other)
 
void set (const uint8_t *buf, uint32_t size, Time t)
 
bool operator== (const Event &other) const
 
bool operator!= (const Event &other) const
 
bool owns_buffer () const
 
void set_buffer (uint32_t size, uint8_t *buf, bool own)
 
void realloc (uint32_t size)
 
void clear ()
 
EventType event_type () const
 
Time time () const
 
uint32_t size () const
 
const uint8_t * buffer () const
 
uint8_t * buffer ()
 
bool is_midi () const
 
bool is_live_midi () const
 
void set_event_type (EventType t)
 
void set_time (Time t)
 
event_id_t id () const
 
void set_id (event_id_t n)
 
uint8_t type () const
 
uint8_t channel () const
 
bool is_note_on () const
 
bool is_note_off () const
 
bool is_note () const
 
bool is_poly_pressure () const
 
bool is_channel_pressure () const
 
bool is_cc () const
 
bool is_pgm_change () const
 
bool is_pitch_bender () const
 
bool is_channel_event () const
 
bool is_smf_meta_event () const
 
bool is_sysex () const
 
bool is_spp () const
 
bool is_mtc_quarter () const
 
bool is_mtc_full () const
 
uint8_t note () const
 
uint8_t velocity () const
 
uint8_t poly_note () const
 
uint8_t poly_pressure () const
 
uint8_t channel_pressure () const
 
uint8_t cc_number () const
 
uint8_t cc_value () const
 
uint8_t pgm_number () const
 
uint8_t pitch_bender_lsb () const
 
uint8_t pitch_bender_msb () const
 
uint16_t pitch_bender_value () const
 
void set_channel (uint8_t channel)
 
void set_type (uint8_t type)
 
void set_note (uint8_t num)
 
void set_velocity (uint8_t val)
 
void set_cc_number (uint8_t num)
 
void set_cc_value (uint8_t val)
 
void set_pgm_number (uint8_t num)
 
void scale_velocity (float factor)
 
uint16_t value () const
 

Protected Attributes

EventType _type
 Type of event (application relative, NOT MIDI 'type') More...
 
Time _time
 Time stamp of event. More...
 
uint32_t _size
 Size of buffer in bytes. More...
 
uint8_t * _buf
 Event contents (e.g. raw MIDI data) More...
 
event_id_t _id
 Unique event ID. More...
 
bool _owns_buf
 Whether buffer is locally allocated. More...
 

Detailed Description

template<typename Time>
class Evoral::Event< Time >

An event (much like a type generic jack_midi_event_t)

Template parameter Time is the type of the time stamp used for this event.

Definition at line 54 of file Event.h.

Constructor & Destructor Documentation

◆ Event() [1/3]

template<typename Time >
Evoral::Event< Time >::Event ( EventType  type = NO_EVENT,
Time  time = Time(),
uint32_t  size = 0,
uint8_t *  buf = NULL,
bool  alloc = false 
)

◆ Event() [2/3]

template<typename Time >
Evoral::Event< Time >::Event ( EventType  type,
Time  time,
uint32_t  size,
const uint8_t *  buf 
)

◆ Event() [3/3]

template<typename Time >
Evoral::Event< Time >::Event ( const Event< Time > &  copy,
bool  alloc 
)

Copy copy.

If alloc is true, the buffer will be copied and this method is NOT REALTIME SAFE. Otherwise both events share a buffer and memory management semantics are the caller's problem.

◆ ~Event()

template<typename Time >
Evoral::Event< Time >::~Event ( )

Member Function Documentation

◆ assign()

template<typename Time >
void Evoral::Event< Time >::assign ( const Event< Time > &  other)

◆ buffer() [1/2]

template<typename Time >
uint8_t* Evoral::Event< Time >::buffer ( )
inline

Definition at line 126 of file Event.h.

◆ buffer() [2/2]

template<typename Time >
const uint8_t* Evoral::Event< Time >::buffer ( ) const
inline

Definition at line 125 of file Event.h.

◆ cc_number()

template<typename Time >
uint8_t Evoral::Event< Time >::cc_number ( ) const
inline

Definition at line 169 of file Event.h.

◆ cc_value()

template<typename Time >
uint8_t Evoral::Event< Time >::cc_value ( ) const
inline

Definition at line 170 of file Event.h.

◆ channel()

template<typename Time >
uint8_t Evoral::Event< Time >::channel ( ) const
inline

Definition at line 146 of file Event.h.

◆ channel_pressure()

template<typename Time >
uint8_t Evoral::Event< Time >::channel_pressure ( ) const
inline

Definition at line 168 of file Event.h.

◆ clear()

template<typename Time >
void Evoral::Event< Time >::clear ( )
inline

Definition at line 113 of file Event.h.

◆ event_type()

template<typename Time >
EventType Evoral::Event< Time >::event_type ( ) const
inline

Definition at line 122 of file Event.h.

◆ id()

template<typename Time >
event_id_t Evoral::Event< Time >::id ( ) const
inline

Definition at line 135 of file Event.h.

◆ is_cc()

template<typename Time >
bool Evoral::Event< Time >::is_cc ( ) const
inline

Definition at line 152 of file Event.h.

◆ is_channel_event()

template<typename Time >
bool Evoral::Event< Time >::is_channel_event ( ) const
inline

Definition at line 155 of file Event.h.

◆ is_channel_pressure()

template<typename Time >
bool Evoral::Event< Time >::is_channel_pressure ( ) const
inline

Definition at line 151 of file Event.h.

◆ is_live_midi()

template<typename Time >
bool Evoral::Event< Time >::is_live_midi ( ) const
inline

Definition at line 129 of file Event.h.

◆ is_midi()

template<typename Time >
bool Evoral::Event< Time >::is_midi ( ) const
inline

Definition at line 128 of file Event.h.

◆ is_mtc_full()

template<typename Time >
bool Evoral::Event< Time >::is_mtc_full ( ) const
inline

Definition at line 160 of file Event.h.

◆ is_mtc_quarter()

template<typename Time >
bool Evoral::Event< Time >::is_mtc_quarter ( ) const
inline

Definition at line 159 of file Event.h.

◆ is_note()

template<typename Time >
bool Evoral::Event< Time >::is_note ( ) const
inline

Definition at line 149 of file Event.h.

◆ is_note_off()

template<typename Time >
bool Evoral::Event< Time >::is_note_off ( ) const
inline

Definition at line 148 of file Event.h.

◆ is_note_on()

template<typename Time >
bool Evoral::Event< Time >::is_note_on ( ) const
inline

Definition at line 147 of file Event.h.

◆ is_pgm_change()

template<typename Time >
bool Evoral::Event< Time >::is_pgm_change ( ) const
inline

Definition at line 153 of file Event.h.

◆ is_pitch_bender()

template<typename Time >
bool Evoral::Event< Time >::is_pitch_bender ( ) const
inline

Definition at line 154 of file Event.h.

◆ is_poly_pressure()

template<typename Time >
bool Evoral::Event< Time >::is_poly_pressure ( ) const
inline

Definition at line 150 of file Event.h.

◆ is_smf_meta_event()

template<typename Time >
bool Evoral::Event< Time >::is_smf_meta_event ( ) const
inline

Definition at line 156 of file Event.h.

◆ is_spp()

template<typename Time >
bool Evoral::Event< Time >::is_spp ( ) const
inline

Definition at line 158 of file Event.h.

◆ is_sysex()

template<typename Time >
bool Evoral::Event< Time >::is_sysex ( ) const
inline

Definition at line 157 of file Event.h.

◆ note()

template<typename Time >
uint8_t Evoral::Event< Time >::note ( ) const
inline

Definition at line 164 of file Event.h.

◆ operator!=()

template<typename Time >
bool Evoral::Event< Time >::operator!= ( const Event< Time > &  other) const
inline

Definition at line 82 of file Event.h.

◆ operator==()

template<typename Time >
bool Evoral::Event< Time >::operator== ( const Event< Time > &  other) const
inline

Definition at line 75 of file Event.h.

◆ owns_buffer()

template<typename Time >
bool Evoral::Event< Time >::owns_buffer ( ) const
inline

Definition at line 84 of file Event.h.

◆ pgm_number()

template<typename Time >
uint8_t Evoral::Event< Time >::pgm_number ( ) const
inline

Definition at line 171 of file Event.h.

◆ pitch_bender_lsb()

template<typename Time >
uint8_t Evoral::Event< Time >::pitch_bender_lsb ( ) const
inline

Definition at line 172 of file Event.h.

◆ pitch_bender_msb()

template<typename Time >
uint8_t Evoral::Event< Time >::pitch_bender_msb ( ) const
inline

Definition at line 173 of file Event.h.

◆ pitch_bender_value()

template<typename Time >
uint16_t Evoral::Event< Time >::pitch_bender_value ( ) const
inline

Definition at line 174 of file Event.h.

◆ poly_note()

template<typename Time >
uint8_t Evoral::Event< Time >::poly_note ( ) const
inline

Definition at line 166 of file Event.h.

◆ poly_pressure()

template<typename Time >
uint8_t Evoral::Event< Time >::poly_pressure ( ) const
inline

Definition at line 167 of file Event.h.

◆ realloc()

template<typename Time >
void Evoral::Event< Time >::realloc ( uint32_t  size)
inline

Definition at line 101 of file Event.h.

◆ scale_velocity()

template<typename Time >
void Evoral::Event< Time >::scale_velocity ( float  factor)
inline

Definition at line 184 of file Event.h.

◆ set()

template<typename Time >
void Evoral::Event< Time >::set ( const uint8_t *  buf,
uint32_t  size,
Time  t 
)

◆ set_buffer()

template<typename Time >
void Evoral::Event< Time >::set_buffer ( uint32_t  size,
uint8_t *  buf,
bool  own 
)
inline

set event data (e.g. midi data)

Parameters
sizenumber of bytes
bufraw 8bit data
ownset to true if the buffer owns the data (copy, allocate/free) or false to reference previously allocated data.

Definition at line 91 of file Event.h.

◆ set_cc_number()

template<typename Time >
void Evoral::Event< Time >::set_cc_number ( uint8_t  num)
inline

Definition at line 180 of file Event.h.

◆ set_cc_value()

template<typename Time >
void Evoral::Event< Time >::set_cc_value ( uint8_t  val)
inline

Definition at line 181 of file Event.h.

◆ set_channel()

template<typename Time >
void Evoral::Event< Time >::set_channel ( uint8_t  channel)
inline

Definition at line 176 of file Event.h.

◆ set_event_type()

template<typename Time >
void Evoral::Event< Time >::set_event_type ( EventType  t)
inline

Definition at line 131 of file Event.h.

◆ set_id()

template<typename Time >
void Evoral::Event< Time >::set_id ( event_id_t  n)
inline

Definition at line 136 of file Event.h.

◆ set_note()

template<typename Time >
void Evoral::Event< Time >::set_note ( uint8_t  num)
inline

Definition at line 178 of file Event.h.

◆ set_pgm_number()

template<typename Time >
void Evoral::Event< Time >::set_pgm_number ( uint8_t  num)
inline

Definition at line 182 of file Event.h.

◆ set_time()

template<typename Time >
void Evoral::Event< Time >::set_time ( Time  t)
inline

Definition at line 133 of file Event.h.

◆ set_type()

template<typename Time >
void Evoral::Event< Time >::set_type ( uint8_t  type)
inline

Definition at line 177 of file Event.h.

◆ set_velocity()

template<typename Time >
void Evoral::Event< Time >::set_velocity ( uint8_t  val)
inline

Definition at line 179 of file Event.h.

◆ size()

template<typename Time >
uint32_t Evoral::Event< Time >::size ( ) const
inline

Definition at line 124 of file Event.h.

◆ time()

template<typename Time >
Time Evoral::Event< Time >::time ( ) const
inline

Definition at line 123 of file Event.h.

◆ type()

template<typename Time >
uint8_t Evoral::Event< Time >::type ( ) const
inline

Definition at line 145 of file Event.h.

◆ value()

template<typename Time >
uint16_t Evoral::Event< Time >::value ( ) const
inline

Definition at line 189 of file Event.h.

◆ velocity()

template<typename Time >
uint8_t Evoral::Event< Time >::velocity ( ) const
inline

Definition at line 165 of file Event.h.

Member Data Documentation

◆ _buf

template<typename Time >
uint8_t* Evoral::Event< Time >::_buf
protected

Event contents (e.g. raw MIDI data)

Definition at line 210 of file Event.h.

◆ _id

template<typename Time >
event_id_t Evoral::Event< Time >::_id
protected

Unique event ID.

Definition at line 211 of file Event.h.

◆ _owns_buf

template<typename Time >
bool Evoral::Event< Time >::_owns_buf
protected

Whether buffer is locally allocated.

Definition at line 213 of file Event.h.

◆ _size

template<typename Time >
uint32_t Evoral::Event< Time >::_size
protected

Size of buffer in bytes.

Definition at line 209 of file Event.h.

◆ _time

template<typename Time >
Time Evoral::Event< Time >::_time
protected

Time stamp of event.

Definition at line 208 of file Event.h.

◆ _type

template<typename Time >
EventType Evoral::Event< Time >::_type
protected

Type of event (application relative, NOT MIDI 'type')

Definition at line 207 of file Event.h.


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