Ardour  9.0-pre0-582-g084a23a80d
ARDOUR::PortManager Class Referenceabstract

#include <port_manager.h>

Inheritance diagram for ARDOUR::PortManager:
[legend]

Classes

struct  AudioInputPort
 
struct  DPM
 
struct  MIDIInputPort
 
struct  MPM
 
struct  PortID
 
struct  PortMetaData
 
class  PortRegistrationFailure
 
struct  SortByPortName
 

Public Types

typedef std::map< std::string, std::shared_ptr< Port >, SortByPortNamePorts
 
typedef std::list< std::shared_ptr< Port > > PortList
 
typedef std::shared_ptr< CircularSampleBufferAudioPortScope
 
typedef std::shared_ptr< CircularEventBufferMIDIPortMonitor
 
typedef std::shared_ptr< DPMAudioPortMeter
 
typedef std::shared_ptr< MPMMIDIPortMeter
 
typedef std::map< std::string, AudioInputPort, SortByPortNameAudioInputPorts
 
typedef std::map< std::string, MIDIInputPort, SortByPortNameMIDIInputPorts
 

Public Member Functions

 PortManager ()
 
virtual ~PortManager ()
 
PortEngineport_engine ()
 
uint32_t port_name_size () const
 
std::string my_name () const
 
size_t total_port_count () const
 
size_t session_port_count () const
 
void list_cycle_ports () const
 
void list_all_ports () const
 
std::shared_ptr< Portregister_input_port (DataType, const std::string &portname, bool async=false, PortFlags extra_flags=PortFlags(0))
 
std::shared_ptr< Portregister_output_port (DataType, const std::string &portname, bool async=false, PortFlags extra_flags=PortFlags(0))
 
int unregister_port (std::shared_ptr< Port >)
 
int connect (const std::string &source, const std::string &destination)
 
int disconnect (const std::string &source, const std::string &destination)
 
int disconnect (std::shared_ptr< Port >)
 
int disconnect (std::string const &)
 
int reestablish_ports ()
 
int reconnect_ports ()
 
bool connected (const std::string &)
 
bool physically_connected (const std::string &)
 
int get_connections (const std::string &, std::vector< std::string > &, bool process_context_safe=true)
 
std::shared_ptr< Portget_port_by_name (const std::string &)
 
void port_renamed (const std::string &, const std::string &)
 
std::string make_port_name_relative (const std::string &name) const
 
std::string make_port_name_non_relative (const std::string &name) const
 
std::string get_pretty_name_by_name (const std::string &portname) const
 
std::string get_hardware_port_name_by_name (const std::string &portname) const
 
std::string short_port_name_from_port_name (std::string const &full_name) const
 
bool port_is_mine (const std::string &fullname) const
 
bool port_is_physical (const std::string &) const
 
void get_physical_outputs (DataType type, std::vector< std::string > &, MidiPortFlags include=MidiPortFlags(0), MidiPortFlags exclude=MidiPortFlags(0))
 
void get_physical_inputs (DataType type, std::vector< std::string > &, MidiPortFlags include=MidiPortFlags(0), MidiPortFlags exclude=MidiPortFlags(0))
 
ChanCount n_physical_outputs () const
 
ChanCount n_physical_inputs () const
 
int get_ports (const std::string &port_name_pattern, DataType type, PortFlags flags, std::vector< std::string > &)
 
int get_ports (DataType, PortList &)
 
void set_port_pretty_name (std::string const &, std::string const &)
 
void remove_session_ports ()
 
void reinit (bool with_ratio=false)
 
void clear_pending_port_deletions ()
 
virtual void add_pending_port_deletion (Port *)=0
 
PBD::RingBuffer< Port * > & port_deletions_pending ()
 
bool check_for_ambiguous_latency (bool log=false) const
 
bool can_request_input_monitoring () const
 
void request_input_monitoring (const std::string &, bool) const
 
void ensure_input_monitoring (const std::string &, bool) const
 
void registration_callback ()
 
int graph_order_callback ()
 
void connect_callback (const std::string &, const std::string &, bool connection)
 
bool port_remove_in_progress () const
 
MidiPortFlags midi_port_metadata (std::string const &)
 
void get_configurable_midi_ports (std::vector< std::string > &, bool for_input)
 
void get_midi_selection_ports (std::vector< std::string > &)
 
void add_midi_port_flags (std::string const &, MidiPortFlags)
 
void remove_midi_port_flags (std::string const &, MidiPortFlags)
 
void reset_input_meters ()
 
AudioInputPorts audio_input_ports () const
 
MIDIInputPorts midi_input_ports () const
 
MonitorPortmonitor_port ()
 

Static Public Member Functions

static void falloff_cache_calc (pframes_t, samplecnt_t)
 
static bool port_is_virtual_piano (std::string const &)
 
static bool port_is_control_only (std::string const &)
 
static bool port_is_physical_input_monitor_enable (std::string const &)
 

Public Attributes

PBD::Signal< void()> MidiSelectionPortsChanged
 
PBD::Signal< void()> MidiPortInfoChanged
 
PBD::Signal< void(std::string)> PortPrettyNameChanged
 
PBD::Signal< void()> GraphReordered
 
PBD::Signal< void()> PortRegisteredOrUnregistered
 
PBD::Signal< void(std::weak_ptr< Port >, std::string, std::weak_ptr< Port >, std::string, bool)> PortConnectedOrDisconnected
 
PBD::Signal< void(DataType, std::vector< std::string >, bool)> PhysInputChanged
 

Protected Member Functions

std::shared_ptr< Portregister_port (DataType type, const std::string &portname, bool input, bool async=false, PortFlags extra_flags=PortFlags(0))
 
void port_registration_failure (const std::string &portname)
 
void silence (pframes_t nframes, Session *s=0)
 
void silence_outputs (pframes_t nframes)
 
void check_monitoring ()
 
void cycle_start (pframes_t nframes, Session *s=0)
 
void cycle_end (pframes_t nframes, Session *s=0)
 
void cycle_end_fade_out (gain_t, gain_t, pframes_t, Session *s=0)
 
void filter_midi_ports (std::vector< std::string > &, MidiPortFlags, MidiPortFlags)
 
void set_port_buffer_sizes (pframes_t)
 

Static Protected Member Functions

static std::string port_info_file ()
 
static std::string midi_port_info_file ()
 

Protected Attributes

std::shared_ptr< AudioBackend_backend
 
SerializedRCUManager< Ports_ports
 
bool _port_remove_in_progress
 
PBD::RingBuffer< Port * > _port_deletions_pending
 
std::shared_ptr< Ports const > _cycle_ports
 

Private Types

typedef std::map< PortID, PortMetaDataPortInfo
 

Private Member Functions

void run_input_meters (pframes_t, samplecnt_t)
 
void set_pretty_names (std::vector< std::string > const &, DataType, bool)
 
void fill_midi_port_info_locked ()
 
void load_port_info ()
 
void save_port_info ()
 
void update_input_ports (bool)
 

Private Attributes

MonitorPort _monitor_port
 
Glib::Threads::Mutex _port_info_mutex
 
PortInfo _port_info
 
bool _midi_info_dirty
 
SerializedRCUManager< AudioInputPorts_audio_input_ports
 
SerializedRCUManager< MIDIInputPorts_midi_input_ports
 
std::atomic< int > _reset_meters
 

Detailed Description

Definition at line 48 of file port_manager.h.

Member Typedef Documentation

◆ AudioInputPorts

Definition at line 115 of file port_manager.h.

◆ AudioPortMeter

typedef std::shared_ptr<DPM> ARDOUR::PortManager::AudioPortMeter

Definition at line 95 of file port_manager.h.

◆ AudioPortScope

Definition at line 93 of file port_manager.h.

◆ MIDIInputPorts

Definition at line 116 of file port_manager.h.

◆ MIDIPortMeter

typedef std::shared_ptr<MPM> ARDOUR::PortManager::MIDIPortMeter

Definition at line 96 of file port_manager.h.

◆ MIDIPortMonitor

Definition at line 94 of file port_manager.h.

◆ PortInfo

Definition at line 382 of file port_manager.h.

◆ PortList

typedef std::list<std::shared_ptr<Port> > ARDOUR::PortManager::PortList

Definition at line 91 of file port_manager.h.

◆ Ports

typedef std::map<std::string, std::shared_ptr<Port>, SortByPortName> ARDOUR::PortManager::Ports

Definition at line 90 of file port_manager.h.

Constructor & Destructor Documentation

◆ PortManager()

ARDOUR::PortManager::PortManager ( )

◆ ~PortManager()

virtual ARDOUR::PortManager::~PortManager ( )
inlinevirtual

Definition at line 119 of file port_manager.h.

Member Function Documentation

◆ add_midi_port_flags()

void ARDOUR::PortManager::add_midi_port_flags ( std::string const &  ,
MidiPortFlags   
)

◆ add_pending_port_deletion()

virtual void ARDOUR::PortManager::add_pending_port_deletion ( Port )
pure virtual

Implemented in ARDOUR::AudioEngine.

◆ audio_input_ports()

AudioInputPorts ARDOUR::PortManager::audio_input_ports ( ) const

◆ can_request_input_monitoring()

bool ARDOUR::PortManager::can_request_input_monitoring ( ) const

◆ check_for_ambiguous_latency()

bool ARDOUR::PortManager::check_for_ambiguous_latency ( bool  log = false) const

◆ check_monitoring()

void ARDOUR::PortManager::check_monitoring ( )
protected

◆ clear_pending_port_deletions()

void ARDOUR::PortManager::clear_pending_port_deletions ( )

◆ connect()

int ARDOUR::PortManager::connect ( const std::string &  source,
const std::string &  destination 
)

◆ connect_callback()

void ARDOUR::PortManager::connect_callback ( const std::string &  ,
const std::string &  ,
bool  connection 
)

◆ connected()

bool ARDOUR::PortManager::connected ( const std::string &  )

◆ cycle_end()

void ARDOUR::PortManager::cycle_end ( pframes_t  nframes,
Session s = 0 
)
protected

Signal the end of an audio cycle. This signifies that the cycle began with cycle_start has ended. This MUST be called at the end of each cycle. Realtime safe.

◆ cycle_end_fade_out()

void ARDOUR::PortManager::cycle_end_fade_out ( gain_t  ,
gain_t  ,
pframes_t  ,
Session s = 0 
)
protected

◆ cycle_start()

void ARDOUR::PortManager::cycle_start ( pframes_t  nframes,
Session s = 0 
)
protected

Signal the start of an audio cycle. This MUST be called before any reading/writing for this cycle. Realtime safe.

◆ disconnect() [1/3]

int ARDOUR::PortManager::disconnect ( const std::string &  source,
const std::string &  destination 
)

◆ disconnect() [2/3]

int ARDOUR::PortManager::disconnect ( std::shared_ptr< Port )

◆ disconnect() [3/3]

int ARDOUR::PortManager::disconnect ( std::string const &  )

◆ ensure_input_monitoring()

void ARDOUR::PortManager::ensure_input_monitoring ( const std::string &  ,
bool   
) const

◆ falloff_cache_calc()

static void ARDOUR::PortManager::falloff_cache_calc ( pframes_t  ,
samplecnt_t   
)
static

◆ fill_midi_port_info_locked()

void ARDOUR::PortManager::fill_midi_port_info_locked ( )
private

◆ filter_midi_ports()

void ARDOUR::PortManager::filter_midi_ports ( std::vector< std::string > &  ,
MidiPortFlags  ,
MidiPortFlags   
)
protected

◆ get_configurable_midi_ports()

void ARDOUR::PortManager::get_configurable_midi_ports ( std::vector< std::string > &  ,
bool  for_input 
)

◆ get_connections()

int ARDOUR::PortManager::get_connections ( const std::string &  ,
std::vector< std::string > &  ,
bool  process_context_safe = true 
)

◆ get_hardware_port_name_by_name()

std::string ARDOUR::PortManager::get_hardware_port_name_by_name ( const std::string &  portname) const

◆ get_midi_selection_ports()

void ARDOUR::PortManager::get_midi_selection_ports ( std::vector< std::string > &  )

◆ get_physical_inputs()

void ARDOUR::PortManager::get_physical_inputs ( DataType  type,
std::vector< std::string > &  ,
MidiPortFlags  include = MidiPortFlags(0),
MidiPortFlags  exclude = MidiPortFlags(0) 
)

◆ get_physical_outputs()

void ARDOUR::PortManager::get_physical_outputs ( DataType  type,
std::vector< std::string > &  ,
MidiPortFlags  include = MidiPortFlags(0),
MidiPortFlags  exclude = MidiPortFlags(0) 
)

◆ get_port_by_name()

std::shared_ptr<Port> ARDOUR::PortManager::get_port_by_name ( const std::string &  )

◆ get_ports() [1/2]

int ARDOUR::PortManager::get_ports ( const std::string &  port_name_pattern,
DataType  type,
PortFlags  flags,
std::vector< std::string > &   
)

◆ get_ports() [2/2]

int ARDOUR::PortManager::get_ports ( DataType  ,
PortList  
)

◆ get_pretty_name_by_name()

std::string ARDOUR::PortManager::get_pretty_name_by_name ( const std::string &  portname) const

◆ graph_order_callback()

int ARDOUR::PortManager::graph_order_callback ( )

◆ list_all_ports()

void ARDOUR::PortManager::list_all_ports ( ) const

◆ list_cycle_ports()

void ARDOUR::PortManager::list_cycle_ports ( ) const

◆ load_port_info()

void ARDOUR::PortManager::load_port_info ( )
private

◆ make_port_name_non_relative()

std::string ARDOUR::PortManager::make_port_name_non_relative ( const std::string &  name) const

◆ make_port_name_relative()

std::string ARDOUR::PortManager::make_port_name_relative ( const std::string &  name) const

◆ midi_input_ports()

MIDIInputPorts ARDOUR::PortManager::midi_input_ports ( ) const

◆ midi_port_info_file()

static std::string ARDOUR::PortManager::midi_port_info_file ( )
staticprotected

◆ midi_port_metadata()

MidiPortFlags ARDOUR::PortManager::midi_port_metadata ( std::string const &  )

◆ monitor_port()

MonitorPort& ARDOUR::PortManager::monitor_port ( )
inline

Definition at line 273 of file port_manager.h.

◆ my_name()

std::string ARDOUR::PortManager::my_name ( ) const

◆ n_physical_inputs()

ChanCount ARDOUR::PortManager::n_physical_inputs ( ) const

◆ n_physical_outputs()

ChanCount ARDOUR::PortManager::n_physical_outputs ( ) const

◆ physically_connected()

bool ARDOUR::PortManager::physically_connected ( const std::string &  )

◆ port_deletions_pending()

PBD::RingBuffer<Port*>& ARDOUR::PortManager::port_deletions_pending ( )
inline

Definition at line 197 of file port_manager.h.

◆ port_engine()

PortEngine& ARDOUR::PortManager::port_engine ( )

◆ port_info_file()

static std::string ARDOUR::PortManager::port_info_file ( )
staticprotected

◆ port_is_control_only()

static bool ARDOUR::PortManager::port_is_control_only ( std::string const &  )
static

◆ port_is_mine()

bool ARDOUR::PortManager::port_is_mine ( const std::string &  fullname) const

◆ port_is_physical()

bool ARDOUR::PortManager::port_is_physical ( const std::string &  ) const

◆ port_is_physical_input_monitor_enable()

static bool ARDOUR::PortManager::port_is_physical_input_monitor_enable ( std::string const &  )
static

◆ port_is_virtual_piano()

static bool ARDOUR::PortManager::port_is_virtual_piano ( std::string const &  )
static

◆ port_name_size()

uint32_t ARDOUR::PortManager::port_name_size ( ) const

◆ port_registration_failure()

void ARDOUR::PortManager::port_registration_failure ( const std::string &  portname)
protected

◆ port_remove_in_progress()

bool ARDOUR::PortManager::port_remove_in_progress ( ) const
inline

Definition at line 233 of file port_manager.h.

◆ port_renamed()

void ARDOUR::PortManager::port_renamed ( const std::string &  ,
const std::string &   
)

◆ reconnect_ports()

int ARDOUR::PortManager::reconnect_ports ( )

◆ reestablish_ports()

int ARDOUR::PortManager::reestablish_ports ( )

◆ register_input_port()

std::shared_ptr<Port> ARDOUR::PortManager::register_input_port ( DataType  ,
const std::string &  portname,
bool  async = false,
PortFlags  extra_flags = PortFlags(0) 
)

◆ register_output_port()

std::shared_ptr<Port> ARDOUR::PortManager::register_output_port ( DataType  ,
const std::string &  portname,
bool  async = false,
PortFlags  extra_flags = PortFlags(0) 
)

◆ register_port()

std::shared_ptr<Port> ARDOUR::PortManager::register_port ( DataType  type,
const std::string &  portname,
bool  input,
bool  async = false,
PortFlags  extra_flags = PortFlags(0) 
)
protected

◆ registration_callback()

void ARDOUR::PortManager::registration_callback ( )

◆ reinit()

void ARDOUR::PortManager::reinit ( bool  with_ratio = false)

reset port-buffers. e.g. after freewheeling

◆ remove_midi_port_flags()

void ARDOUR::PortManager::remove_midi_port_flags ( std::string const &  ,
MidiPortFlags   
)

◆ remove_session_ports()

void ARDOUR::PortManager::remove_session_ports ( )

◆ request_input_monitoring()

void ARDOUR::PortManager::request_input_monitoring ( const std::string &  ,
bool   
) const

◆ reset_input_meters()

void ARDOUR::PortManager::reset_input_meters ( )

◆ run_input_meters()

void ARDOUR::PortManager::run_input_meters ( pframes_t  ,
samplecnt_t   
)
private

◆ save_port_info()

void ARDOUR::PortManager::save_port_info ( )
private

◆ session_port_count()

size_t ARDOUR::PortManager::session_port_count ( ) const

◆ set_port_buffer_sizes()

void ARDOUR::PortManager::set_port_buffer_sizes ( pframes_t  )
protected

◆ set_port_pretty_name()

void ARDOUR::PortManager::set_port_pretty_name ( std::string const &  ,
std::string const &   
)

◆ set_pretty_names()

void ARDOUR::PortManager::set_pretty_names ( std::vector< std::string > const &  ,
DataType  ,
bool   
)
private

◆ short_port_name_from_port_name()

std::string ARDOUR::PortManager::short_port_name_from_port_name ( std::string const &  full_name) const

◆ silence()

void ARDOUR::PortManager::silence ( pframes_t  nframes,
Session s = 0 
)
protected

◆ silence_outputs()

void ARDOUR::PortManager::silence_outputs ( pframes_t  nframes)
protected

◆ total_port_count()

size_t ARDOUR::PortManager::total_port_count ( ) const
inline

Definition at line 128 of file port_manager.h.

◆ unregister_port()

int ARDOUR::PortManager::unregister_port ( std::shared_ptr< Port )

◆ update_input_ports()

void ARDOUR::PortManager::update_input_ports ( bool  )
private

Member Data Documentation

◆ _audio_input_ports

SerializedRCUManager<AudioInputPorts> ARDOUR::PortManager::_audio_input_ports
private

Definition at line 388 of file port_manager.h.

◆ _backend

std::shared_ptr<AudioBackend> ARDOUR::PortManager::_backend
protected

Definition at line 278 of file port_manager.h.

◆ _cycle_ports

std::shared_ptr<Ports const> ARDOUR::PortManager::_cycle_ports
protected

List of ports to be used between cycle_start() and cycle_end()

Definition at line 289 of file port_manager.h.

◆ _midi_info_dirty

bool ARDOUR::PortManager::_midi_info_dirty
private

Definition at line 386 of file port_manager.h.

◆ _midi_input_ports

SerializedRCUManager<MIDIInputPorts> ARDOUR::PortManager::_midi_input_ports
private

Definition at line 389 of file port_manager.h.

◆ _monitor_port

MonitorPort ARDOUR::PortManager::_monitor_port
private

Definition at line 324 of file port_manager.h.

◆ _port_deletions_pending

PBD::RingBuffer<Port*> ARDOUR::PortManager::_port_deletions_pending
protected

Definition at line 283 of file port_manager.h.

◆ _port_info

PortInfo ARDOUR::PortManager::_port_info
private

Definition at line 385 of file port_manager.h.

◆ _port_info_mutex

Glib::Threads::Mutex ARDOUR::PortManager::_port_info_mutex
mutableprivate

Definition at line 384 of file port_manager.h.

◆ _port_remove_in_progress

bool ARDOUR::PortManager::_port_remove_in_progress
protected

Definition at line 282 of file port_manager.h.

◆ _ports

SerializedRCUManager<Ports> ARDOUR::PortManager::_ports
protected

Definition at line 280 of file port_manager.h.

◆ _reset_meters

std::atomic<int> ARDOUR::PortManager::_reset_meters
private

Definition at line 390 of file port_manager.h.

◆ GraphReordered

PBD::Signal<void()> ARDOUR::PortManager::GraphReordered

Emitted if the backend notifies us of a graph order event

Definition at line 253 of file port_manager.h.

◆ MidiPortInfoChanged

PBD::Signal<void()> ARDOUR::PortManager::MidiPortInfoChanged

Emitted if anything other than the selection property for a MIDI port changes

Definition at line 248 of file port_manager.h.

◆ MidiSelectionPortsChanged

PBD::Signal<void()> ARDOUR::PortManager::MidiSelectionPortsChanged

Emitted if the list of ports to be used for MIDI selection tracking changes

Definition at line 246 of file port_manager.h.

◆ PhysInputChanged

PBD::Signal<void(DataType, std::vector<std::string>, bool)> ARDOUR::PortManager::PhysInputChanged

Definition at line 265 of file port_manager.h.

◆ PortConnectedOrDisconnected

PBD::Signal<void(std::weak_ptr<Port>, std::string, std::weak_ptr<Port>, std::string, bool)> ARDOUR::PortManager::PortConnectedOrDisconnected

Emitted if a Port is connected or disconnected. The Port parameters are the ports being connected / disconnected, or 0 if they are not known to Ardour. The std::string parameters are the (long) port names. The bool parameter is true if ports were connected, or false for disconnected.

Definition at line 263 of file port_manager.h.

◆ PortPrettyNameChanged

PBD::Signal<void(std::string)> ARDOUR::PortManager::PortPrettyNameChanged

Emitted if pretty-name of a port changed

Definition at line 250 of file port_manager.h.

◆ PortRegisteredOrUnregistered

PBD::Signal<void()> ARDOUR::PortManager::PortRegisteredOrUnregistered

Emitted if a Port is registered or unregistered

Definition at line 256 of file port_manager.h.


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