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

#include <midi_port.h>

Inheritance diagram for ARDOUR::MidiPort:
[legend]

Public Types

typedef std::function< bool(MidiBuffer &, MidiBuffer &)> MidiFilter
 

Public Member Functions

 ~MidiPort ()
 
DataType type () const
 
void cycle_start (pframes_t nframes)
 
void cycle_end (pframes_t nframes)
 
void cycle_split ()
 
void flush_buffers (pframes_t nframes)
 
void transport_stopped ()
 
void realtime_locate (bool)
 
void reset ()
 
void require_resolve ()
 
bool input_active () const
 
void set_input_active (bool yn)
 
Bufferget_buffer (pframes_t nframes)
 
MidiBufferget_midi_buffer (pframes_t nframes)
 
void set_trace (std::weak_ptr< MIDI::Parser > trace_parser)
 
std::shared_ptr< MIDI::Parsertrace_parser () const
 
void set_inbound_filter (MidiFilter)
 
int add_shadow_port (std::string const &, MidiFilter)
 
std::shared_ptr< MidiPortshadow_port () const
 
void read_and_parse_entire_midi_buffer_with_no_speed_adjustment (pframes_t nframes, MIDI::Parser &parser, samplepos_t now)
 
- Public Member Functions inherited from ARDOUR::Port
 Port (const Port &)=delete
 
Portoperator= (const Port &)=delete
 
virtual ~Port ()
 
std::string name () const
 
std::string pretty_name (bool fallback_to_name=false) const
 
bool set_pretty_name (const std::string &)
 
int set_name (std::string const &)
 
PortFlags flags () const
 
bool receives_input () const
 
bool sends_output () const
 
bool connected () const
 
int disconnect_all ()
 
int get_connections (std::vector< std::string > &) const
 
bool connected_to (std::string const &) const
 
int connect (std::string const &)
 
int disconnect (std::string const &)
 
bool connected_to (Port *) const
 
virtual int connect (Port *)
 
int disconnect (Port *)
 
void request_input_monitoring (bool)
 
void ensure_input_monitoring (bool)
 
bool monitoring_input () const
 
int reestablish ()
 
int reconnect ()
 
bool last_monitor () const
 
void set_last_monitor (bool yn)
 
PortEngine::PortHandle port_handle ()
 
void get_connected_latency_range (LatencyRange &range, bool playback) const
 
void collect_latency_from_backend (LatencyRange &range, bool playback) const
 
void set_private_latency_range (LatencyRange &range, bool playback)
 
const LatencyRangeprivate_latency_range (bool playback) const
 
void set_public_latency_range (LatencyRange const &range, bool playback) const
 
LatencyRange public_latency_range (bool playback) const
 
virtual void reinit (bool)
 
virtual void set_buffer_size (pframes_t)
 
bool has_ext_connection () const
 
bool physically_connected () const
 
bool in_cycle () const
 
uint32_t externally_connected () const
 
uint32_t internally_connected () const
 
void increment_external_connections ()
 
void decrement_external_connections ()
 
void increment_internal_connections ()
 
void decrement_internal_connections ()
 
virtual XMLNodeget_state () const
 
virtual int set_state (const XMLNode &, int version)
 

Protected Member Functions

 MidiPort (const std::string &name, PortFlags)
 
- Protected Member Functions inherited from ARDOUR::Port
 Port (std::string const &, DataType, PortFlags)
 

Private Member Functions

void resolve_notes (void *buffer, samplepos_t when)
 
void pull_input (pframes_t nframes, bool adjust_speed)
 
void parse_input (pframes_t nframes, MIDI::Parser &parser)
 

Private Attributes

MidiBuffer_buffer
 
bool _resolve_required
 
bool _input_active
 
MidiFilter _inbound_midi_filter
 
std::shared_ptr< MidiPort_shadow_port
 
MidiFilter _shadow_midi_filter
 
std::weak_ptr< MIDI::Parser_trace_parser
 
bool _data_fetched_for_cycle
 

Friends

class PortManager
 

Additional Inherited Members

- Static Public Member Functions inherited from ARDOUR::Port
static void set_connecting_blocked (bool yn)
 
static bool connecting_blocked ()
 
static void set_varispeed_ratio (double s)
 
static bool set_engine_ratio (double session, double engine)
 
static void set_cycle_samplecnt (pframes_t n)
 
static samplecnt_t port_offset ()
 
static void set_global_port_buffer_offset (pframes_t off)
 
static void increment_global_port_buffer_offset (pframes_t n)
 
static pframes_t cycle_nframes ()
 
static double speed_ratio ()
 
static double engine_ratio ()
 
static double resample_ratio ()
 
static uint32_t resampler_quality ()
 
static uint32_t resampler_latency ()
 
static bool can_varispeed ()
 
static bool setup_resampler (uint32_t q=17)
 
- Public Attributes inherited from ARDOUR::Port
PBD::Signal< void(bool)> MonitorInputChanged
 
PBD::Signal< void(std::shared_ptr< Port >, std::shared_ptr< Port >, bool)> ConnectedOrDisconnected
 
- Static Public Attributes inherited from ARDOUR::Port
static PBD::Signal< void()> PortDrop
 
static PBD::Signal< void()> PortSignalDrop
 
static PBD::Signal< void()> ResamplerQualityChanged
 
static std::string state_node_name
 
- Protected Attributes inherited from ARDOUR::Port
PortEngine::PortPtr _port_handle
 
LatencyRange _private_playback_latency
 
LatencyRange _private_capture_latency
 
- Static Protected Attributes inherited from ARDOUR::Port
static bool _connecting_blocked
 
static pframes_t _cycle_nframes
 
static pframes_t _global_port_buffer_offset
 
static double _speed_ratio
 
static double _engine_ratio
 
static double _resample_ratio
 

Detailed Description

Definition at line 34 of file midi_port.h.

Member Typedef Documentation

◆ MidiFilter

typedef std::function<bool(MidiBuffer&,MidiBuffer&)> ARDOUR::MidiPort::MidiFilter

Definition at line 64 of file midi_port.h.

Constructor & Destructor Documentation

◆ ~MidiPort()

ARDOUR::MidiPort::~MidiPort ( )

◆ MidiPort()

ARDOUR::MidiPort::MidiPort ( const std::string &  name,
PortFlags   
)
protected

Member Function Documentation

◆ add_shadow_port()

int ARDOUR::MidiPort::add_shadow_port ( std::string const &  ,
MidiFilter   
)

◆ cycle_end()

void ARDOUR::MidiPort::cycle_end ( pframes_t  nframes)
virtual

Reimplemented from ARDOUR::Port.

◆ cycle_split()

void ARDOUR::MidiPort::cycle_split ( )
virtual

Implements ARDOUR::Port.

◆ cycle_start()

void ARDOUR::MidiPort::cycle_start ( pframes_t  nframes)
virtual

Reimplemented from ARDOUR::Port.

◆ flush_buffers()

void ARDOUR::MidiPort::flush_buffers ( pframes_t  nframes)
virtual

Reimplemented from ARDOUR::Port.

◆ get_buffer()

Buffer& ARDOUR::MidiPort::get_buffer ( pframes_t  nframes)
inlinevirtual

Implements ARDOUR::Port.

Definition at line 55 of file midi_port.h.

◆ get_midi_buffer()

MidiBuffer& ARDOUR::MidiPort::get_midi_buffer ( pframes_t  nframes)

◆ input_active()

bool ARDOUR::MidiPort::input_active ( ) const
inline

Definition at line 52 of file midi_port.h.

◆ parse_input()

void ARDOUR::MidiPort::parse_input ( pframes_t  nframes,
MIDI::Parser parser 
)
private

◆ pull_input()

void ARDOUR::MidiPort::pull_input ( pframes_t  nframes,
bool  adjust_speed 
)
private

◆ read_and_parse_entire_midi_buffer_with_no_speed_adjustment()

void ARDOUR::MidiPort::read_and_parse_entire_midi_buffer_with_no_speed_adjustment ( pframes_t  nframes,
MIDI::Parser parser,
samplepos_t  now 
)

◆ realtime_locate()

void ARDOUR::MidiPort::realtime_locate ( bool  )
virtual

Reimplemented from ARDOUR::Port.

◆ require_resolve()

void ARDOUR::MidiPort::require_resolve ( )

◆ reset()

void ARDOUR::MidiPort::reset ( )
virtual

Reimplemented from ARDOUR::Port.

◆ resolve_notes()

void ARDOUR::MidiPort::resolve_notes ( void *  buffer,
samplepos_t  when 
)
private

◆ set_inbound_filter()

void ARDOUR::MidiPort::set_inbound_filter ( MidiFilter  )

◆ set_input_active()

void ARDOUR::MidiPort::set_input_active ( bool  yn)

◆ set_trace()

void ARDOUR::MidiPort::set_trace ( std::weak_ptr< MIDI::Parser trace_parser)

◆ shadow_port()

std::shared_ptr<MidiPort> ARDOUR::MidiPort::shadow_port ( ) const
inline

Definition at line 67 of file midi_port.h.

◆ trace_parser()

std::shared_ptr<MIDI::Parser> ARDOUR::MidiPort::trace_parser ( ) const

◆ transport_stopped()

void ARDOUR::MidiPort::transport_stopped ( )
virtual

Reimplemented from ARDOUR::Port.

◆ type()

DataType ARDOUR::MidiPort::type ( ) const
inlinevirtual

Implements ARDOUR::Port.

Definition at line 38 of file midi_port.h.

Friends And Related Function Documentation

◆ PortManager

friend class PortManager
friend

Definition at line 72 of file midi_port.h.

Member Data Documentation

◆ _buffer

MidiBuffer* ARDOUR::MidiPort::_buffer
private

Definition at line 77 of file midi_port.h.

◆ _data_fetched_for_cycle

bool ARDOUR::MidiPort::_data_fetched_for_cycle
private

Definition at line 84 of file midi_port.h.

◆ _inbound_midi_filter

MidiFilter ARDOUR::MidiPort::_inbound_midi_filter
private

Definition at line 80 of file midi_port.h.

◆ _input_active

bool ARDOUR::MidiPort::_input_active
private

Definition at line 79 of file midi_port.h.

◆ _resolve_required

bool ARDOUR::MidiPort::_resolve_required
private

Definition at line 78 of file midi_port.h.

◆ _shadow_midi_filter

MidiFilter ARDOUR::MidiPort::_shadow_midi_filter
private

Definition at line 82 of file midi_port.h.

◆ _shadow_port

std::shared_ptr<MidiPort> ARDOUR::MidiPort::_shadow_port
private

Definition at line 81 of file midi_port.h.

◆ _trace_parser

std::weak_ptr<MIDI::Parser> ARDOUR::MidiPort::_trace_parser
private

Definition at line 83 of file midi_port.h.


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