ardour
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ARDOUR::IO Class Reference

#include <io.h>

Inheritance diagram for ARDOUR::IO:
ARDOUR::SessionObject ARDOUR::Latent ARDOUR::SessionHandleRef PBD::StatefulDestructible PBD::ScopedConnectionList PBD::Stateful PBD::Destructible ARDOUR::ClickIO

Classes

class  BoolCombiner
 
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)
 
virtual void silence (framecnt_t)
 
void increment_port_buffer_offset (pframes_t offset)
 
int ensure_io (ChanCount cnt, bool clear, void *src)
 
int connect_ports_to_bundle (boost::shared_ptr< Bundle >, bool exclusive, void *)
 
int disconnect_ports_from_bundle (boost::shared_ptr< Bundle >, void *)
 
BundleList bundles_connected ()
 
boost::shared_ptr< Bundlebundle ()
 
int add_port (std::string connection, void *src, DataType type=DataType::NIL)
 
int remove_port (boost::shared_ptr< Port >, void *src)
 
int connect (boost::shared_ptr< Port > our_port, std::string other_port, void *src)
 
int disconnect (boost::shared_ptr< Port > our_port, std::string other_port, void *src)
 
int disconnect (void *src)
 
bool connected_to (boost::shared_ptr< const IO >) const
 
bool connected_to (const std::string &) const
 
bool connected () const
 
bool physically_connected () const
 
framecnt_t signal_latency () const
 
framecnt_t latency () const
 
PortSetports ()
 
const PortSetports () const
 
bool has_port (boost::shared_ptr< Port >) const
 
boost::shared_ptr< Portnth (uint32_t n) const
 
boost::shared_ptr< Portport_by_name (const std::string &str) const
 
boost::shared_ptr< AudioPortaudio (uint32_t n) const
 
boost::shared_ptr< MidiPortmidi (uint32_t n) const
 
const ChanCountn_ports () const
 
virtual XMLNodestate (bool full)
 
XMLNodeget_state (void)
 
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 process_input (boost::shared_ptr< Processor >, framepos_t start_frame, framepos_t end_frame, pframes_t nframes)
 
void copy_to_outputs (BufferSet &bufs, DataType type, pframes_t nframes, framecnt_t offset)
 
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 ()
 
virtual ~ScopedConnectionList ()
 
void add_connection (const UnscopedConnection &c)
 
void drop_connections ()
 
- Public Member Functions inherited from PBD::Stateful
 Stateful ()
 
virtual ~Stateful ()
 
virtual bool apply_changes (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 (Command *) const
 
virtual void rdiff (std::vector< 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
 Destructible ()
 
virtual ~Destructible ()
 
void drop_references ()
 
- Public Member Functions inherited from ARDOUR::Latent
 Latent ()
 
virtual ~Latent ()
 
framecnt_t user_latency () const
 
framecnt_t effective_latency () const
 
virtual void set_user_latency (framecnt_t val)
 

Static Public Member Functions

static void prepare_for_reset (XMLNode &, const std::string &)
 
static int disable_connecting ()
 
static int enable_connecting ()
 
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::Signal2< void, IOChange,
void * > 
changed
 
PBD::Signal1< bool, ChanCount,
BoolCombiner
PortCountChanging
 
XMLNodepending_state_node
 
int pending_state_node_version
 
bool pending_state_node_in
 
- Public Attributes inherited from PBD::Stateful
PBD::Signal1< void, const
PropertyChange & > 
PropertyChanged
 
- Public Attributes inherited from PBD::Destructible
PBD::Signal0< void > Destroyed
 
PBD::Signal0< void > DropReferences
 

Static Public Attributes

static const std::string state_node_name = "IO"
 
static PBD::Signal1< void,
ChanCount
PortCountChanged
 
static PBD::Signal0< int > ConnectingLegal
 
static bool connecting_legal = false
 
- Static Public Attributes inherited from PBD::Stateful
static int current_state_version = 0
 
static int loading_state_version = 0
 

Protected Attributes

PortSet _ports
 
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
 
- Protected Attributes inherited from ARDOUR::Latent
framecnt_t _user_latency
 

Private Member Functions

int connecting_became_legal ()
 
int ensure_ports (ChanCount, bool clear, void *src)
 
void check_bundles_connected ()
 
void bundle_changed (Bundle::Change)
 
int get_port_counts (const XMLNode &node, int version, ChanCount &n, boost::shared_ptr< Bundle > &c)
 
int get_port_counts_2X (const XMLNode &node, int version, ChanCount &n, boost::shared_ptr< Bundle > &c)
 
int create_ports (const XMLNode &, int version)
 
int make_connections (const XMLNode &, int, bool)
 
int make_connections_2X (const XMLNode &, int, bool)
 
boost::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 (DataType type)
 
int32_t find_port_hole (const char *base)
 
void setup_bundle ()
 
std::string bundle_channel_name (uint32_t, uint32_t, DataType) const
 
void disconnect_check (boost::shared_ptr< ARDOUR::Port >, boost::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

Glib::Threads::Mutex io_lock
 
PBD::ScopedConnection connection_legal_c
 
boost::shared_ptr< Bundle_bundle
 a bundle representing our ports More...
 
std::vector< UserBundleInfo * > _bundles_connected
 user bundles connected to our ports More...
 
BufferSet _buffers
 

Additional Inherited Members

- 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 &)
 
PropertyChange set_values (XMLNode const &)
 
virtual void post_set (const PropertyChange &)
 
virtual void send_change (const PropertyChange &)
 
virtual void mid_thaw (const PropertyChange &)
 

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 67 of file io.h.

Member Enumeration Documentation

Enumerator
Input 
Output 

Definition at line 72 of file io.h.

Constructor & Destructor Documentation

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

Definition at line 74 of file io.cc.

IO::~IO ( )
virtual

Definition at line 88 of file io.cc.

Member Function Documentation

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

Definition at line 87 of file io.h.

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

Add a port.

Parameters
destinationName of port to connect new port to.
srcSource for emitted ConfigurationChanged signal.
typeData type of port. Default value (NIL) will use this IO's default type.

Definition at line 312 of file io.cc.

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

Definition at line 1430 of file io.cc.

string IO::build_legal_port_name ( DataType  type)
private

Definition at line 1341 of file io.cc.

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

Definition at line 102 of file io.h.

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

Definition at line 1333 of file io.cc.

std::string IO::bundle_channel_name ( uint32_t  c,
uint32_t  n,
DataType  t 
) const
private

Definition at line 1529 of file io.cc.

BundleList IO::bundles_connected ( )
Returns
Bundles connected to our ports

Definition at line 1483 of file io.cc.

void IO::check_bundles_connected ( )
private

Set _bundles_connected to those bundles that are connected such that every port on every bundle channel x is connected to port x in _ports.

Definition at line 150 of file io.cc.

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

Definition at line 1653 of file io.cc.

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

Definition at line 224 of file io.cc.

int IO::connect_ports_to_bundle ( boost::shared_ptr< Bundle c,
bool  exclusive,
void *  src 
)

Definition at line 1247 of file io.cc.

bool IO::connected ( ) const

Definition at line 1582 of file io.cc.

bool IO::connected_to ( boost::shared_ptr< const IO other) const

Definition at line 1596 of file io.cc.

bool ARDOUR::IO::connected_to ( const std::string &  ) const
int IO::connecting_became_legal ( )
private

Definition at line 693 of file io.cc.

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

Definition at line 1681 of file io.cc.

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

Definition at line 886 of file io.cc.

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

Definition at line 84 of file io.h.

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

Definition at line 82 of file io.h.

int IO::disable_connecting ( )
static

Definition at line 1317 of file io.cc.

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

Definition at line 378 of file io.cc.

void IO::disconnect_check ( boost::shared_ptr< ARDOUR::Port a,
boost::shared_ptr< ARDOUR::Port b 
)
private

Definition at line 100 of file io.cc.

int IO::disconnect_ports_from_bundle ( boost::shared_ptr< Bundle c,
void *  src 
)

Definition at line 1285 of file io.cc.

int IO::enable_connecting ( )
static

Definition at line 1324 of file io.cc.

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

Caller must hold process lock

Definition at line 507 of file io.cc.

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

Caller must hold process lock

Definition at line 470 of file io.cc.

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

Caller must hold process lock

Definition at line 397 of file io.cc.

int32_t IO::find_port_hole ( const char *  base)
private

Definition at line 1396 of file io.cc.

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

Definition at line 710 of file io.cc.

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

Definition at line 832 of file io.cc.

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

Definition at line 804 of file io.cc.

XMLNode & IO::get_state ( void  )
virtual

Implements PBD::Stateful.

Definition at line 517 of file io.cc.

bool IO::has_port ( boost::shared_ptr< Port p) const

Definition at line 1734 of file io.cc.

void IO::increment_port_buffer_offset ( pframes_t  offset)

Definition at line 125 of file io.cc.

framecnt_t IO::latency ( ) const

Definition at line 1221 of file io.cc.

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

Definition at line 908 of file io.cc.

int IO::make_connections_2X ( const XMLNode node,
int  ,
bool  in 
)
private

Definition at line 1004 of file io.cc.

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

Definition at line 1437 of file io.cc.

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

Definition at line 135 of file io.h.

string IO::name_from_state ( const XMLNode node)
static

Definition at line 1556 of file io.cc.

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

Definition at line 122 of file io.h.

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

Definition at line 1175 of file io.cc.

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

Definition at line 1149 of file io.cc.

bool IO::physically_connected ( ) const

Definition at line 1722 of file io.cc.

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

Definition at line 1707 of file io.cc.

PortSet& ARDOUR::IO::ports ( )
inline

Definition at line 117 of file io.h.

const PortSet& ARDOUR::IO::ports ( ) const
inline

Definition at line 118 of file io.h.

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

Definition at line 965 of file io.cc.

void IO::process_input ( boost::shared_ptr< Processor proc,
framepos_t  start_frame,
framepos_t  end_frame,
pframes_t  nframes 
)

Call a processor's ::run() method, giving it our buffers Caller must hold process lock.

Definition at line 1637 of file io.cc.

int IO::remove_port ( boost::shared_ptr< Port port,
void *  src 
)

Definition at line 251 of file io.cc.

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

Definition at line 88 of file io.h.

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

Definition at line 85 of file io.h.

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

Reimplemented from ARDOUR::SessionObject.

Definition at line 1195 of file io.cc.

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

Definition at line 1568 of file io.cc.

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

Definition at line 1100 of file io.cc.

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

Implements PBD::Stateful.

Definition at line 581 of file io.cc.

int IO::set_state_2X ( const XMLNode node,
int  version,
bool  in 
)

Definition at line 643 of file io.cc.

void IO::setup_bundle ( )
private

Setup a bundle that describe our inputs or outputs. Also creates the bundle if necessary.

Definition at line 1447 of file io.cc.

framecnt_t ARDOUR::IO::signal_latency ( ) const
inlinevirtual

Implements ARDOUR::Latent.

Definition at line 114 of file io.h.

void IO::silence ( framecnt_t  nframes)
virtual

Definition at line 137 of file io.cc.

XMLNode & IO::state ( bool  full)
virtual

Definition at line 523 of file io.cc.

Member Data Documentation

bool ARDOUR::IO::_active
protected

Definition at line 209 of file io.h.

BufferSet ARDOUR::IO::_buffers
private

Definition at line 251 of file io.h.

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

a bundle representing our ports

Definition at line 216 of file io.h.

std::vector<UserBundleInfo*> ARDOUR::IO::_bundles_connected
private

user bundles connected to our ports

Definition at line 224 of file io.h.

DataType ARDOUR::IO::_default_type
protected

Definition at line 208 of file io.h.

Direction ARDOUR::IO::_direction
protected

Definition at line 207 of file io.h.

PortSet ARDOUR::IO::_ports
protected

Definition at line 206 of file io.h.

bool ARDOUR::IO::_sendish
protected

Definition at line 210 of file io.h.

PBD::Signal2<void, IOChange, void *> ARDOUR::IO::changed

Definition at line 141 of file io.h.

bool IO::connecting_legal = false
static

Definition at line 186 of file io.h.

PBD::Signal0< int > IO::ConnectingLegal
static

Definition at line 185 of file io.h.

PBD::ScopedConnection ARDOUR::IO::connection_legal_c
private

Definition at line 214 of file io.h.

Glib::Threads::Mutex ARDOUR::IO::io_lock
mutableprivate

Definition at line 203 of file io.h.

XMLNode* ARDOUR::IO::pending_state_node

Definition at line 188 of file io.h.

bool ARDOUR::IO::pending_state_node_in

Definition at line 190 of file io.h.

int ARDOUR::IO::pending_state_node_version

Definition at line 189 of file io.h.

PBD::Signal1< void, ChanCount > IO::PortCountChanged
static

Definition at line 177 of file io.h.

PBD::Signal1<bool, ChanCount, BoolCombiner> ARDOUR::IO::PortCountChanging

Emitted when the port count is about to change. Objects can attach to this, and return `true' if they want to prevent the change from happening.

Definition at line 172 of file io.h.

const string IO::state_node_name = "IO"
static

Definition at line 70 of file io.h.


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