Ardour  9.0-pre0-380-gbbdb6b0e63
MIDI::Parser Class Reference

#include <parser.h>

Public Member Functions

 Parser ()
 
 ~Parser ()
 
samplecnt_t get_timestamp () const
 
void set_timestamp (const samplecnt_t timestamp)
 
void scanner (byte c)
 
size_t * message_counts ()
 
const char * midi_event_type_name (MIDI::eventType)
 
void trace (bool onoff, std::ostream *o, const std::string &prefix="")
 
bool tracing ()
 
void set_offline (bool)
 
bool offline () const
 
void set_mmc_forwarding (bool yn)
 
MTC_FPS mtc_fps () const
 
MTC_Status mtc_running () const
 
const bytemtc_current () const
 
bool mtc_locked () const
 
void set_mtc_forwarding (bool yn)
 
void reset_mtc_state ()
 

Public Attributes

BankSignal bank_change
 
TwoByteSignal note_on
 
TwoByteSignal note_off
 
TwoByteSignal poly_pressure
 
OneByteSignal pressure
 
OneByteSignal program_change
 
PitchBendSignal pitchbend
 
TwoByteSignal controller
 
BankSignal channel_bank_change [16]
 
TwoByteSignal channel_note_on [16]
 
TwoByteSignal channel_note_off [16]
 
TwoByteSignal channel_poly_pressure [16]
 
OneByteSignal channel_pressure [16]
 
OneByteSignal channel_program_change [16]
 
PitchBendSignal channel_pitchbend [16]
 
TwoByteSignal channel_controller [16]
 
ZeroByteSignal channel_active_preparse [16]
 
ZeroByteSignal channel_active_postparse [16]
 
RPNValueSignal channel_rpn [16]
 
RPNValueSignal channel_nrpn [16]
 
RPNSignal channel_rpn_change [16]
 
RPNSignal channel_nrpn_change [16]
 
OneByteSignal mtc_quarter_frame
 
Signal mtc
 
Signal raw_preparse
 
Signal raw_postparse
 
AnySignal any
 
Signal sysex
 
Signal mmc
 
AnySignal position
 
Signal song
 
ZeroByteSignal all_notes_off
 
ZeroByteSignal tune
 
ZeroByteSignal active_sense
 
ZeroByteSignal reset
 
ZeroByteSignal eox
 
TimestampedSignal timing
 
TimestampedSignal tick
 
TimestampedSignal start
 
TimestampedSignal stop
 
TimestampedSignal contineu
 
PBD::Signal< void()> OfflineStatusChanged
 
PBD::Signal< int(byte *, size_t)> edit
 
PBD::Signal< void(Parser &, int, samplecnt_t)> mtc_qtr
 
PBD::Signal< void(const byte *, bool, samplecnt_t)> mtc_time
 
PBD::Signal< void(MTC_Status)> mtc_status
 
PBD::Signal< bool()> mtc_skipped
 

Private Types

enum  ParseState { NEEDSTATUS , NEEDONEBYTE , NEEDTWOBYTES , VARIABLELENGTH }
 

Private Member Functions

void trace_event (Parser &p, byte *msg, size_t len, samplecnt_t)
 
void channel_msg (byte)
 
void realtime_msg (byte)
 
void system_msg (byte)
 
void signal (byte *msg, size_t msglen)
 
bool possible_mmc (byte *msg, size_t msglen)
 
bool possible_mtc (byte *msg, size_t msglen)
 
void process_mtc_quarter_frame (byte *msg)
 

Private Attributes

std::ostream * trace_stream
 
std::string trace_prefix
 
PBD::ScopedConnection trace_connection
 
size_t message_counter [256]
 
ParseState state
 
unsigned char * msgbuf
 
int msglen
 
int msgindex
 
MIDI::eventType msgtype
 
channel_t channel
 
bool _offline
 
bool runnable
 
bool was_runnable
 
bool _mmc_forward
 
bool _mtc_forward
 
int expected_mtc_quarter_frame_code
 
byte _mtc_time [5]
 
byte _qtr_mtc_time [5]
 
unsigned long consecutive_qtr_frame_cnt
 
MTC_FPS _mtc_fps
 
MTC_Status _mtc_running
 
bool _mtc_locked
 
byte last_qtr_frame
 
samplecnt_t _timestamp
 
ParseState pre_variable_state
 
MIDI::eventType pre_variable_msgtype
 
byte last_status_byte
 

Detailed Description

Definition at line 48 of file parser.h.

Member Enumeration Documentation

◆ ParseState

Enumerator
NEEDSTATUS 
NEEDONEBYTE 
NEEDTWOBYTES 
VARIABLELENGTH 

Definition at line 158 of file parser.h.

Constructor & Destructor Documentation

◆ Parser()

MIDI::Parser::Parser ( )

◆ ~Parser()

MIDI::Parser::~Parser ( )

Member Function Documentation

◆ channel_msg()

void MIDI::Parser::channel_msg ( byte  )
private

◆ get_timestamp()

samplecnt_t MIDI::Parser::get_timestamp ( ) const
inline

Definition at line 58 of file parser.h.

◆ message_counts()

size_t* MIDI::Parser::message_counts ( )
inline

Definition at line 115 of file parser.h.

◆ midi_event_type_name()

const char* MIDI::Parser::midi_event_type_name ( MIDI::eventType  )

◆ mtc_current()

const byte* MIDI::Parser::mtc_current ( ) const
inline

Definition at line 134 of file parser.h.

◆ mtc_fps()

MTC_FPS MIDI::Parser::mtc_fps ( ) const
inline

Definition at line 132 of file parser.h.

◆ mtc_locked()

bool MIDI::Parser::mtc_locked ( ) const
inline

Definition at line 135 of file parser.h.

◆ mtc_running()

MTC_Status MIDI::Parser::mtc_running ( ) const
inline

Definition at line 133 of file parser.h.

◆ offline()

bool MIDI::Parser::offline ( ) const
inline

Definition at line 121 of file parser.h.

◆ possible_mmc()

bool MIDI::Parser::possible_mmc ( byte msg,
size_t  msglen 
)
private

◆ possible_mtc()

bool MIDI::Parser::possible_mtc ( byte msg,
size_t  msglen 
)
private

◆ process_mtc_quarter_frame()

void MIDI::Parser::process_mtc_quarter_frame ( byte msg)
private

◆ realtime_msg()

void MIDI::Parser::realtime_msg ( byte  )
private

◆ reset_mtc_state()

void MIDI::Parser::reset_mtc_state ( )

◆ scanner()

void MIDI::Parser::scanner ( byte  c)

◆ set_mmc_forwarding()

void MIDI::Parser::set_mmc_forwarding ( bool  yn)
inline

Definition at line 126 of file parser.h.

◆ set_mtc_forwarding()

void MIDI::Parser::set_mtc_forwarding ( bool  yn)
inline

Definition at line 142 of file parser.h.

◆ set_offline()

void MIDI::Parser::set_offline ( bool  )

◆ set_timestamp()

void MIDI::Parser::set_timestamp ( const samplecnt_t  timestamp)
inline

Definition at line 59 of file parser.h.

◆ signal()

void MIDI::Parser::signal ( byte msg,
size_t  msglen 
)
private

◆ system_msg()

void MIDI::Parser::system_msg ( byte  )
private

◆ trace()

void MIDI::Parser::trace ( bool  onoff,
std::ostream *  o,
const std::string &  prefix = "" 
)

◆ trace_event()

void MIDI::Parser::trace_event ( Parser p,
byte msg,
size_t  len,
samplecnt_t   
)
private

◆ tracing()

bool MIDI::Parser::tracing ( )
inline

Definition at line 118 of file parser.h.

Member Data Documentation

◆ _mmc_forward

bool MIDI::Parser::_mmc_forward
private

Definition at line 173 of file parser.h.

◆ _mtc_forward

bool MIDI::Parser::_mtc_forward
private

Definition at line 174 of file parser.h.

◆ _mtc_fps

MTC_FPS MIDI::Parser::_mtc_fps
private

Definition at line 179 of file parser.h.

◆ _mtc_locked

bool MIDI::Parser::_mtc_locked
private

Definition at line 181 of file parser.h.

◆ _mtc_running

MTC_Status MIDI::Parser::_mtc_running
private

Definition at line 180 of file parser.h.

◆ _mtc_time

byte MIDI::Parser::_mtc_time[5]
private

Definition at line 176 of file parser.h.

◆ _offline

bool MIDI::Parser::_offline
private

Definition at line 170 of file parser.h.

◆ _qtr_mtc_time

byte MIDI::Parser::_qtr_mtc_time[5]
private

Definition at line 177 of file parser.h.

◆ _timestamp

samplecnt_t MIDI::Parser::_timestamp
private

Definition at line 184 of file parser.h.

◆ active_sense

ZeroByteSignal MIDI::Parser::active_sense

Definition at line 99 of file parser.h.

◆ all_notes_off

ZeroByteSignal MIDI::Parser::all_notes_off

Definition at line 97 of file parser.h.

◆ any

AnySignal MIDI::Parser::any

Definition at line 91 of file parser.h.

◆ bank_change

BankSignal MIDI::Parser::bank_change

Definition at line 63 of file parser.h.

◆ channel

channel_t MIDI::Parser::channel
private

Definition at line 169 of file parser.h.

◆ channel_active_postparse

ZeroByteSignal MIDI::Parser::channel_active_postparse[16]

Definition at line 81 of file parser.h.

◆ channel_active_preparse

ZeroByteSignal MIDI::Parser::channel_active_preparse[16]

Definition at line 80 of file parser.h.

◆ channel_bank_change

BankSignal MIDI::Parser::channel_bank_change[16]

Definition at line 72 of file parser.h.

◆ channel_controller

TwoByteSignal MIDI::Parser::channel_controller[16]

Definition at line 79 of file parser.h.

◆ channel_note_off

TwoByteSignal MIDI::Parser::channel_note_off[16]

Definition at line 74 of file parser.h.

◆ channel_note_on

TwoByteSignal MIDI::Parser::channel_note_on[16]

Definition at line 73 of file parser.h.

◆ channel_nrpn

RPNValueSignal MIDI::Parser::channel_nrpn[16]

Definition at line 83 of file parser.h.

◆ channel_nrpn_change

RPNSignal MIDI::Parser::channel_nrpn_change[16]

Definition at line 85 of file parser.h.

◆ channel_pitchbend

PitchBendSignal MIDI::Parser::channel_pitchbend[16]

Definition at line 78 of file parser.h.

◆ channel_poly_pressure

TwoByteSignal MIDI::Parser::channel_poly_pressure[16]

Definition at line 75 of file parser.h.

◆ channel_pressure

OneByteSignal MIDI::Parser::channel_pressure[16]

Definition at line 76 of file parser.h.

◆ channel_program_change

OneByteSignal MIDI::Parser::channel_program_change[16]

Definition at line 77 of file parser.h.

◆ channel_rpn

RPNValueSignal MIDI::Parser::channel_rpn[16]

Definition at line 82 of file parser.h.

◆ channel_rpn_change

RPNSignal MIDI::Parser::channel_rpn_change[16]

Definition at line 84 of file parser.h.

◆ consecutive_qtr_frame_cnt

unsigned long MIDI::Parser::consecutive_qtr_frame_cnt
private

Definition at line 178 of file parser.h.

◆ contineu

TimestampedSignal MIDI::Parser::contineu

Definition at line 107 of file parser.h.

◆ controller

TwoByteSignal MIDI::Parser::controller

Definition at line 70 of file parser.h.

◆ edit

PBD::Signal<int(byte *, size_t)> MIDI::Parser::edit

Definition at line 124 of file parser.h.

◆ eox

ZeroByteSignal MIDI::Parser::eox

Definition at line 101 of file parser.h.

◆ expected_mtc_quarter_frame_code

int MIDI::Parser::expected_mtc_quarter_frame_code
private

Definition at line 175 of file parser.h.

◆ last_qtr_frame

byte MIDI::Parser::last_qtr_frame
private

Definition at line 182 of file parser.h.

◆ last_status_byte

byte MIDI::Parser::last_status_byte
private

Definition at line 188 of file parser.h.

◆ message_counter

size_t MIDI::Parser::message_counter[256]
private

Definition at line 156 of file parser.h.

◆ mmc

Signal MIDI::Parser::mmc

Definition at line 93 of file parser.h.

◆ msgbuf

unsigned char* MIDI::Parser::msgbuf
private

Definition at line 165 of file parser.h.

◆ msgindex

int MIDI::Parser::msgindex
private

Definition at line 167 of file parser.h.

◆ msglen

int MIDI::Parser::msglen
private

Definition at line 166 of file parser.h.

◆ msgtype

MIDI::eventType MIDI::Parser::msgtype
private

Definition at line 168 of file parser.h.

◆ mtc

Signal MIDI::Parser::mtc

Definition at line 88 of file parser.h.

◆ mtc_qtr

PBD::Signal<void(Parser &, int, samplecnt_t)> MIDI::Parser::mtc_qtr

Definition at line 137 of file parser.h.

◆ mtc_quarter_frame

OneByteSignal MIDI::Parser::mtc_quarter_frame

Definition at line 87 of file parser.h.

◆ mtc_skipped

PBD::Signal<bool()> MIDI::Parser::mtc_skipped

Definition at line 140 of file parser.h.

◆ mtc_status

PBD::Signal<void(MTC_Status)> MIDI::Parser::mtc_status

Definition at line 139 of file parser.h.

◆ mtc_time

PBD::Signal<void(const byte *, bool, samplecnt_t)> MIDI::Parser::mtc_time

Definition at line 138 of file parser.h.

◆ note_off

TwoByteSignal MIDI::Parser::note_off

Definition at line 65 of file parser.h.

◆ note_on

TwoByteSignal MIDI::Parser::note_on

Definition at line 64 of file parser.h.

◆ OfflineStatusChanged

PBD::Signal<void()> MIDI::Parser::OfflineStatusChanged

Definition at line 122 of file parser.h.

◆ pitchbend

PitchBendSignal MIDI::Parser::pitchbend

Definition at line 69 of file parser.h.

◆ poly_pressure

TwoByteSignal MIDI::Parser::poly_pressure

Definition at line 66 of file parser.h.

◆ position

AnySignal MIDI::Parser::position

Definition at line 94 of file parser.h.

◆ pre_variable_msgtype

MIDI::eventType MIDI::Parser::pre_variable_msgtype
private

Definition at line 187 of file parser.h.

◆ pre_variable_state

ParseState MIDI::Parser::pre_variable_state
private

Definition at line 186 of file parser.h.

◆ pressure

OneByteSignal MIDI::Parser::pressure

Definition at line 67 of file parser.h.

◆ program_change

OneByteSignal MIDI::Parser::program_change

Definition at line 68 of file parser.h.

◆ raw_postparse

Signal MIDI::Parser::raw_postparse

Definition at line 90 of file parser.h.

◆ raw_preparse

Signal MIDI::Parser::raw_preparse

Definition at line 89 of file parser.h.

◆ reset

ZeroByteSignal MIDI::Parser::reset

Definition at line 100 of file parser.h.

◆ runnable

bool MIDI::Parser::runnable
private

Definition at line 171 of file parser.h.

◆ song

Signal MIDI::Parser::song

Definition at line 95 of file parser.h.

◆ start

TimestampedSignal MIDI::Parser::start

Definition at line 105 of file parser.h.

◆ state

ParseState MIDI::Parser::state
private

Definition at line 164 of file parser.h.

◆ stop

TimestampedSignal MIDI::Parser::stop

Definition at line 106 of file parser.h.

◆ sysex

Signal MIDI::Parser::sysex

Definition at line 92 of file parser.h.

◆ tick

TimestampedSignal MIDI::Parser::tick

Definition at line 104 of file parser.h.

◆ timing

TimestampedSignal MIDI::Parser::timing

Definition at line 103 of file parser.h.

◆ trace_connection

PBD::ScopedConnection MIDI::Parser::trace_connection
private

Definition at line 154 of file parser.h.

◆ trace_prefix

std::string MIDI::Parser::trace_prefix
private

Definition at line 152 of file parser.h.

◆ trace_stream

std::ostream* MIDI::Parser::trace_stream
private

Definition at line 151 of file parser.h.

◆ tune

ZeroByteSignal MIDI::Parser::tune

Definition at line 98 of file parser.h.

◆ was_runnable

bool MIDI::Parser::was_runnable
private

Definition at line 172 of file parser.h.


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