Ardour  9.0-pre0-1221-ge44a66287a
ARDOUR::IO Class Reference

#include <io.h>

Inheritance diagram for ARDOUR::IO:
[legend]

Classes

class  IntBoolCombiner
 
struct  UserBundleInfo
 

Public Types

enum  Direction { Input , Output }
 

Public Member Functions

 IO (Session &, const std::string &name, Direction, DataType default_type=DataType::AUDIO, bool sendish=false)
 
 IO (Session &, const XMLNode &, DataType default_type=DataType::AUDIO, bool sendish=false)
 
virtual ~IO ()
 
Direction direction () const
 
DataType default_type () const
 
void set_default_type (DataType t)
 
bool active () const
 
void set_active (bool yn)
 
bool set_name (const std::string &str)
 
void set_pretty_name (const std::string &str)
 
std::string pretty_name () const
 
void set_audio_channel_names (std::vector< std::string > const &acn)
 
virtual void silence (samplecnt_t)
 
int ensure_io (ChanCount cnt, bool clear, void *src)
 
int connect_ports_to_bundle (std::shared_ptr< Bundle >, bool exclusive, void *)
 
int connect_ports_to_bundle (std::shared_ptr< Bundle >, bool, bool, void *)
 
int disconnect_ports_from_bundle (std::shared_ptr< Bundle >, void *)
 
BundleList bundles_connected ()
 
std::shared_ptr< Bundlebundle ()
 
bool can_add_port (DataType) const
 
int add_port (std::string connection, void *src, DataType type=DataType::NIL)
 
int remove_port (std::shared_ptr< Port >, void *src)
 
int connect (std::shared_ptr< Port > our_port, std::string other_port, void *src)
 
int disconnect (std::shared_ptr< Port > our_port, std::string other_port, void *src)
 
int disconnect (void *src)
 
bool connected_to (std::shared_ptr< const IO >) const
 
bool connected_to (const std::string &) const
 
bool connected () const
 
bool physically_connected () const
 
bool has_ext_connection () const
 
samplecnt_t latency () const
 
samplecnt_t connected_latency (bool for_playback) const
 
void set_private_port_latencies (samplecnt_t value, bool playback)
 
void set_public_port_latencies (samplecnt_t value, bool playback) const
 
void set_public_port_latency_from_connections () const
 
std::shared_ptr< PortSetports ()
 
std::shared_ptr< PortSet const > ports () const
 
bool has_port (std::shared_ptr< Port >) const
 
std::shared_ptr< Portnth (uint32_t n) const
 
std::shared_ptr< Portport_by_name (const std::string &str) const
 
std::shared_ptr< AudioPortaudio (uint32_t n) const
 
std::shared_ptr< MidiPortmidi (uint32_t n) const
 
const ChanCountn_ports () const
 
XMLNodeget_state () const
 
int set_state (const XMLNode &, int version)
 
int set_state_2X (const XMLNode &, int, bool)
 
void collect_input (BufferSet &bufs, pframes_t nframes, ChanCount offset)
 
void copy_to_outputs (BufferSet &bufs, DataType type, pframes_t nframes, samplecnt_t offset)
 
void flush_buffers (pframes_t nframes)
 
int set_ports (const std::string &str)
 
- Public Member Functions inherited from ARDOUR::SessionObject
 SessionObject (Session &session, const std::string &name)
 
Sessionsession () const
 
std::string name () const
 
- Public Member Functions inherited from ARDOUR::SessionHandleRef
 SessionHandleRef (ARDOUR::Session &s)
 
virtual ~SessionHandleRef ()
 
- Public Member Functions inherited from PBD::ScopedConnectionList
 ScopedConnectionList ()
 
 ScopedConnectionList (const ScopedConnectionList &)=delete
 
ScopedConnectionListoperator= (const ScopedConnectionList &)=delete
 
virtual ~ScopedConnectionList ()
 
void add_connection (const UnscopedConnection &c)
 
void drop_connections ()
 
std::list< ScopedConnectionList * >::size_type size () const
 
- Public Member Functions inherited from PBD::Stateful
 Stateful ()
 
virtual ~Stateful ()
 
virtual bool apply_change (PropertyBase const &)
 
PropertyChange apply_changes (PropertyList const &)
 
const OwnedPropertyListproperties () const
 
void add_property (PropertyBase &s)
 
void add_extra_xml (XMLNode &)
 
XMLNodeextra_xml (const std::string &str, bool add_if_missing=false)
 
void save_extra_xml (const XMLNode &)
 
const PBD::IDid () const
 
bool set_id (const XMLNode &)
 
void set_id (const std::string &)
 
void reset_id ()
 
void clear_changes ()
 
virtual void clear_owned_changes ()
 
PropertyListget_changes_as_properties (PBD::Command *) const
 
virtual void rdiff (std::vector< PBD::Command * > &) const
 
bool changed () const
 
virtual PropertyListproperty_factory (const XMLNode &) const
 
virtual void suspend_property_changes ()
 
virtual void resume_property_changes ()
 
bool property_changes_suspended () const
 
- Public Member Functions inherited from PBD::Destructible
virtual ~Destructible ()
 
virtual void drop_references ()
 

Static Public Member Functions

static void prepare_for_reset (XMLNode &, const std::string &)
 
static std::string name_from_state (const XMLNode &)
 
static void set_name_in_state (XMLNode &, const std::string &)
 
- Static Public Member Functions inherited from ARDOUR::SessionObject
static void make_property_quarks ()
 

Public Attributes

PBD::Signal< void(IOChange, void *)> changed
 
PBD::SignalWithCombiner< IntBoolCombiner, int(ChanCount)> PortCountChanging
 
- Public Attributes inherited from PBD::Stateful
PBD::Signal< void(const PropertyChange &)> PropertyChanged
 
- Public Attributes inherited from PBD::Destructible
PBD::Signal< void()> Destroyed
 
PBD::Signal< void()> DropReferences
 

Static Public Attributes

static const std::string state_node_name
 
static PBD::Signal< void(ChanCount)> PortCountChanged
 
- Static Public Attributes inherited from PBD::Stateful
static int current_state_version
 
static int loading_state_version
 

Protected Member Functions

virtual XMLNodestate () const
 
- Protected Member Functions inherited from ARDOUR::SessionHandleRef
virtual void session_going_away ()
 
virtual void insanity_check ()
 
- Protected Member Functions inherited from PBD::Stateful
void add_instant_xml (XMLNode &, const std::string &directory_path)
 
XMLNodeinstant_xml (const std::string &str, const std::string &directory_path)
 
void add_properties (XMLNode &) const
 
PropertyChange set_values (XMLNode const &)
 
virtual void post_set (const PropertyChange &)
 
virtual void send_change (const PropertyChange &)
 
virtual void mid_thaw (const PropertyChange &)
 
bool regenerate_xml_or_string_ids () const
 

Protected Attributes

Direction _direction
 
DataType _default_type
 
bool _active
 
bool _sendish
 
- Protected Attributes inherited from ARDOUR::SessionObject
PBD::Property< std::string > _name
 
- Protected Attributes inherited from ARDOUR::SessionHandleRef
ARDOUR::Session_session
 
- Protected Attributes inherited from PBD::Stateful
XMLNode_extra_xml
 
XMLNode_instant_xml
 
PBD::PropertyChange _pending_changed
 
Glib::Threads::Mutex _lock
 
std::string _xml_node_name
 name of node to use for this object in XML More...
 
OwnedPropertyList_properties
 

Private Member Functions

void reestablish_port_subscriptions ()
 
int ensure_ports (ChanCount, bool clear, void *src)
 
void bundle_changed (Bundle::Change)
 
int set_port_state_2X (const XMLNode &node, int version, bool in)
 
int get_port_counts (const XMLNode &node, int version, ChanCount &n, std::shared_ptr< Bundle > &c)
 
int get_port_counts_2X (const XMLNode &node, int version, ChanCount &n, std::shared_ptr< Bundle > &c)
 
int create_ports (const XMLNode &, int version)
 
std::shared_ptr< Bundlefind_possible_bundle (const std::string &desired_name)
 
int ensure_ports_locked (ChanCount, bool clear, bool &changed)
 
std::string build_legal_port_name (std::shared_ptr< PortSet const >, DataType type)
 
int32_t find_port_hole (std::shared_ptr< PortSet const >, const char *base)
 
void setup_bundle ()
 
std::string bundle_channel_name (uint32_t, uint32_t, DataType) const
 
void apply_pretty_name ()
 
void connection_change (std::shared_ptr< ARDOUR::Port >, std::shared_ptr< ARDOUR::Port >)
 

Static Private Member Functions

static int parse_io_string (const std::string &, std::vector< std::string > &chns)
 
static int parse_gain_string (const std::string &, std::vector< std::string > &chns)
 

Private Attributes

SerializedRCUManager< PortSet_ports
 
PBD::ScopedConnectionList _port_connections
 
std::shared_ptr< Bundle_bundle
 a bundle representing our ports More...
 
std::vector< std::string > _audio_channel_names
 
std::string _pretty_name_prefix
 
BufferSet _buffers
 

Detailed Description

A collection of ports (all input or all output) with connections.

An IO can contain ports of varying types, making routes/inserts/etc with varied combinations of types (eg MIDI and audio) possible.

Definition at line 71 of file io.h.

Member Enumeration Documentation

◆ Direction

Enumerator
Input 
Output 

Definition at line 76 of file io.h.

Constructor & Destructor Documentation

◆ IO() [1/2]

ARDOUR::IO::IO ( Session ,
const std::string &  name,
Direction  ,
DataType  default_type = DataType::AUDIO,
bool  sendish = false 
)

◆ IO() [2/2]

ARDOUR::IO::IO ( Session ,
const XMLNode ,
DataType  default_type = DataType::AUDIO,
bool  sendish = false 
)

◆ ~IO()

virtual ARDOUR::IO::~IO ( )
virtual

Member Function Documentation

◆ active()

bool ARDOUR::IO::active ( ) const
inline

Definition at line 91 of file io.h.

◆ add_port()

int ARDOUR::IO::add_port ( std::string  connection,
void *  src,
DataType  type = DataType::NIL 
)

◆ apply_pretty_name()

void ARDOUR::IO::apply_pretty_name ( )
private

◆ audio()

std::shared_ptr<AudioPort> ARDOUR::IO::audio ( uint32_t  n) const

◆ build_legal_port_name()

std::string ARDOUR::IO::build_legal_port_name ( std::shared_ptr< PortSet const >  ,
DataType  type 
)
private

◆ bundle()

std::shared_ptr<Bundle> ARDOUR::IO::bundle ( )
inline

Definition at line 112 of file io.h.

◆ bundle_changed()

void ARDOUR::IO::bundle_changed ( Bundle::Change  )
private

◆ bundle_channel_name()

std::string ARDOUR::IO::bundle_channel_name ( uint32_t  ,
uint32_t  ,
DataType   
) const
private

◆ bundles_connected()

BundleList ARDOUR::IO::bundles_connected ( )

◆ can_add_port()

bool ARDOUR::IO::can_add_port ( DataType  ) const

◆ collect_input()

void ARDOUR::IO::collect_input ( BufferSet bufs,
pframes_t  nframes,
ChanCount  offset 
)

◆ connect()

int ARDOUR::IO::connect ( std::shared_ptr< Port our_port,
std::string  other_port,
void *  src 
)

◆ connect_ports_to_bundle() [1/2]

int ARDOUR::IO::connect_ports_to_bundle ( std::shared_ptr< Bundle ,
bool  exclusive,
void *   
)

◆ connect_ports_to_bundle() [2/2]

int ARDOUR::IO::connect_ports_to_bundle ( std::shared_ptr< Bundle ,
bool  ,
bool  ,
void *   
)

◆ connected()

bool ARDOUR::IO::connected ( ) const

◆ connected_latency()

samplecnt_t ARDOUR::IO::connected_latency ( bool  for_playback) const

◆ connected_to() [1/2]

bool ARDOUR::IO::connected_to ( const std::string &  ) const

◆ connected_to() [2/2]

bool ARDOUR::IO::connected_to ( std::shared_ptr< const IO ) const

◆ connection_change()

void ARDOUR::IO::connection_change ( std::shared_ptr< ARDOUR::Port ,
std::shared_ptr< ARDOUR::Port  
)
private

◆ copy_to_outputs()

void ARDOUR::IO::copy_to_outputs ( BufferSet bufs,
DataType  type,
pframes_t  nframes,
samplecnt_t  offset 
)

◆ create_ports()

int ARDOUR::IO::create_ports ( const XMLNode ,
int  version 
)
private

◆ default_type()

DataType ARDOUR::IO::default_type ( ) const
inline

Definition at line 88 of file io.h.

◆ direction()

Direction ARDOUR::IO::direction ( ) const
inline

Definition at line 86 of file io.h.

◆ disconnect() [1/2]

int ARDOUR::IO::disconnect ( std::shared_ptr< Port our_port,
std::string  other_port,
void *  src 
)

◆ disconnect() [2/2]

int ARDOUR::IO::disconnect ( void *  src)

◆ disconnect_ports_from_bundle()

int ARDOUR::IO::disconnect_ports_from_bundle ( std::shared_ptr< Bundle ,
void *   
)

◆ ensure_io()

int ARDOUR::IO::ensure_io ( ChanCount  cnt,
bool  clear,
void *  src 
)

◆ ensure_ports()

int ARDOUR::IO::ensure_ports ( ChanCount  ,
bool  clear,
void *  src 
)
private

◆ ensure_ports_locked()

int ARDOUR::IO::ensure_ports_locked ( ChanCount  ,
bool  clear,
bool &  changed 
)
private

◆ find_port_hole()

int32_t ARDOUR::IO::find_port_hole ( std::shared_ptr< PortSet const >  ,
const char *  base 
)
private

◆ find_possible_bundle()

std::shared_ptr<Bundle> ARDOUR::IO::find_possible_bundle ( const std::string &  desired_name)
private

◆ flush_buffers()

void ARDOUR::IO::flush_buffers ( pframes_t  nframes)

◆ get_port_counts()

int ARDOUR::IO::get_port_counts ( const XMLNode node,
int  version,
ChanCount n,
std::shared_ptr< Bundle > &  c 
)
private

◆ get_port_counts_2X()

int ARDOUR::IO::get_port_counts_2X ( const XMLNode node,
int  version,
ChanCount n,
std::shared_ptr< Bundle > &  c 
)
private

◆ get_state()

XMLNode& ARDOUR::IO::get_state ( ) const
virtual

Implements PBD::Stateful.

◆ has_ext_connection()

bool ARDOUR::IO::has_ext_connection ( ) const

◆ has_port()

bool ARDOUR::IO::has_port ( std::shared_ptr< Port ) const

◆ latency()

samplecnt_t ARDOUR::IO::latency ( ) const

◆ midi()

std::shared_ptr<MidiPort> ARDOUR::IO::midi ( uint32_t  n) const

◆ n_ports()

const ChanCount& ARDOUR::IO::n_ports ( ) const

◆ name_from_state()

static std::string ARDOUR::IO::name_from_state ( const XMLNode )
static

◆ nth()

std::shared_ptr<Port> ARDOUR::IO::nth ( uint32_t  n) const

◆ parse_gain_string()

static int ARDOUR::IO::parse_gain_string ( const std::string &  ,
std::vector< std::string > &  chns 
)
staticprivate

◆ parse_io_string()

static int ARDOUR::IO::parse_io_string ( const std::string &  ,
std::vector< std::string > &  chns 
)
staticprivate

◆ physically_connected()

bool ARDOUR::IO::physically_connected ( ) const

◆ port_by_name()

std::shared_ptr<Port> ARDOUR::IO::port_by_name ( const std::string &  str) const

◆ ports() [1/2]

std::shared_ptr<PortSet> ARDOUR::IO::ports ( )

◆ ports() [2/2]

std::shared_ptr<PortSet const> ARDOUR::IO::ports ( ) const

◆ prepare_for_reset()

static void ARDOUR::IO::prepare_for_reset ( XMLNode ,
const std::string &   
)
static

◆ pretty_name()

std::string ARDOUR::IO::pretty_name ( ) const
inline

Definition at line 96 of file io.h.

◆ reestablish_port_subscriptions()

void ARDOUR::IO::reestablish_port_subscriptions ( )
private

◆ remove_port()

int ARDOUR::IO::remove_port ( std::shared_ptr< Port ,
void *  src 
)

◆ set_active()

void ARDOUR::IO::set_active ( bool  yn)
inline

Definition at line 92 of file io.h.

◆ set_audio_channel_names()

void ARDOUR::IO::set_audio_channel_names ( std::vector< std::string > const &  acn)
inline

Definition at line 98 of file io.h.

◆ set_default_type()

void ARDOUR::IO::set_default_type ( DataType  t)
inline

Definition at line 89 of file io.h.

◆ set_name()

bool ARDOUR::IO::set_name ( const std::string &  str)
virtual

Reimplemented from ARDOUR::SessionObject.

◆ set_name_in_state()

static void ARDOUR::IO::set_name_in_state ( XMLNode ,
const std::string &   
)
static

◆ set_port_state_2X()

int ARDOUR::IO::set_port_state_2X ( const XMLNode node,
int  version,
bool  in 
)
private

◆ set_ports()

int ARDOUR::IO::set_ports ( const std::string &  str)

◆ set_pretty_name()

void ARDOUR::IO::set_pretty_name ( const std::string &  str)

◆ set_private_port_latencies()

void ARDOUR::IO::set_private_port_latencies ( samplecnt_t  value,
bool  playback 
)

◆ set_public_port_latencies()

void ARDOUR::IO::set_public_port_latencies ( samplecnt_t  value,
bool  playback 
) const

◆ set_public_port_latency_from_connections()

void ARDOUR::IO::set_public_port_latency_from_connections ( ) const

◆ set_state()

int ARDOUR::IO::set_state ( const XMLNode ,
int  version 
)
virtual

Implements PBD::Stateful.

◆ set_state_2X()

int ARDOUR::IO::set_state_2X ( const XMLNode ,
int  ,
bool   
)

◆ setup_bundle()

void ARDOUR::IO::setup_bundle ( )
private

◆ silence()

virtual void ARDOUR::IO::silence ( samplecnt_t  )
virtual

◆ state()

virtual XMLNode& ARDOUR::IO::state ( ) const
protectedvirtual

Member Data Documentation

◆ _active

bool ARDOUR::IO::_active
protected

Definition at line 211 of file io.h.

◆ _audio_channel_names

std::vector<std::string> ARDOUR::IO::_audio_channel_names
private

Definition at line 222 of file io.h.

◆ _buffers

BufferSet ARDOUR::IO::_buffers
private

Definition at line 254 of file io.h.

◆ _bundle

std::shared_ptr<Bundle> ARDOUR::IO::_bundle
private

a bundle representing our ports

Definition at line 220 of file io.h.

◆ _default_type

DataType ARDOUR::IO::_default_type
protected

Definition at line 210 of file io.h.

◆ _direction

Direction ARDOUR::IO::_direction
protected

Definition at line 209 of file io.h.

◆ _port_connections

PBD::ScopedConnectionList ARDOUR::IO::_port_connections
private

Definition at line 218 of file io.h.

◆ _ports

SerializedRCUManager<PortSet> ARDOUR::IO::_ports
private

Definition at line 215 of file io.h.

◆ _pretty_name_prefix

std::string ARDOUR::IO::_pretty_name_prefix
private

Definition at line 253 of file io.h.

◆ _sendish

bool ARDOUR::IO::_sendish
protected

Definition at line 212 of file io.h.

◆ changed

PBD::Signal<void(IOChange, void *)> ARDOUR::IO::changed

Definition at line 151 of file io.h.

◆ PortCountChanged

PBD::Signal<void(ChanCount)> ARDOUR::IO::PortCountChanged
static

Definition at line 191 of file io.h.

◆ PortCountChanging

PBD::SignalWithCombiner<IntBoolCombiner, int(ChanCount)> ARDOUR::IO::PortCountChanging

Emitted when the port count is about to change. Objects can attach to this, and return a non-zero if they want to prevent the change from happening.

Definition at line 189 of file io.h.

◆ state_node_name

const std::string ARDOUR::IO::state_node_name
static

Definition at line 74 of file io.h.


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