ardour
|
#include <port_set.h>
Classes | |
class | audio_iterator |
class | iterator_base |
Public Types | |
typedef iterator_base< PortSet, Port > | iterator |
typedef iterator_base< const PortSet, const Port > | const_iterator |
Public Member Functions | |
PortSet () | |
size_t | num_ports () const |
size_t | num_ports (DataType type) const |
void | add (boost::shared_ptr< Port > port) |
bool | remove (boost::shared_ptr< Port > port) |
boost::shared_ptr< Port > | port (size_t index) const |
boost::shared_ptr< Port > | port (DataType t, size_t index) const |
boost::shared_ptr< AudioPort > | nth_audio_port (size_t n) const |
boost::shared_ptr< MidiPort > | nth_midi_port (size_t n) const |
bool | contains (boost::shared_ptr< const Port > port) const |
void | clear () |
const ChanCount & | count () const |
bool | empty () const |
iterator | begin (DataType type=DataType::NIL) |
iterator | end (DataType type=DataType::NIL) |
const_iterator | begin (DataType type=DataType::NIL) const |
const_iterator | end (DataType type=DataType::NIL) const |
audio_iterator | audio_begin () |
audio_iterator | audio_end () |
Private Types | |
typedef std::vector < boost::shared_ptr< Port > > | PortVec |
Private Attributes | |
std::vector< PortVec > | _ports |
PortVec | _all_ports |
ChanCount | _count |
An ordered list of Ports, possibly of various types.
This allows access to all the ports as a list, ignoring type, or accessing the nth port of a given type. Note that port(n) and nth_audio_port(n) may NOT return the same port.
Each port is held twice; once in a per-type vector of vectors (_ports) and once in a vector of all port (_all_ports). This is to speed up the fairly common case of iterating over all ports.
Definition at line 42 of file port_set.h.
typedef iterator_base<const PortSet, const Port> ARDOUR::PortSet::const_iterator |
Definition at line 94 of file port_set.h.
typedef iterator_base<PortSet, Port> ARDOUR::PortSet::iterator |
Definition at line 93 of file port_set.h.
|
private |
Definition at line 135 of file port_set.h.
ARDOUR::PortSet::PortSet | ( | ) |
Definition at line 30 of file port_set.cc.
void ARDOUR::PortSet::add | ( | boost::shared_ptr< Port > | port | ) |
Definition at line 86 of file port_set.cc.
|
inline |
Definition at line 131 of file port_set.h.
|
inline |
Definition at line 132 of file port_set.h.
|
inline |
Definition at line 96 of file port_set.h.
|
inline |
Definition at line 105 of file port_set.h.
void ARDOUR::PortSet::clear | ( | ) |
Remove all ports from the PortSet. Ports are not deregistered with the engine, it's the caller's responsibility to not leak here!
Definition at line 168 of file port_set.cc.
bool ARDOUR::PortSet::contains | ( | boost::shared_ptr< const Port > | port | ) | const |
Definition at line 129 of file port_set.cc.
|
inline |
Definition at line 69 of file port_set.h.
|
inline |
Definition at line 71 of file port_set.h.
|
inline |
Definition at line 100 of file port_set.h.
|
inline |
Definition at line 109 of file port_set.h.
boost::shared_ptr< AudioPort > ARDOUR::PortSet::nth_audio_port | ( | size_t | n | ) | const |
Definition at line 156 of file port_set.cc.
boost::shared_ptr< MidiPort > ARDOUR::PortSet::nth_midi_port | ( | size_t | n | ) | const |
Definition at line 162 of file port_set.cc.
size_t ARDOUR::PortSet::num_ports | ( | ) | const |
Get the total number of ports (of all types) in the PortSet
Definition at line 123 of file port_set.cc.
|
inline |
Definition at line 47 of file port_set.h.
boost::shared_ptr< Port > ARDOUR::PortSet::port | ( | size_t | index | ) | const |
nth port
Definition at line 135 of file port_set.cc.
boost::shared_ptr< Port > ARDOUR::PortSet::port | ( | DataType | t, |
size_t | index | ||
) | const |
nth port of type t, or nth port if t = NIL
Definition at line 142 of file port_set.cc.
bool ARDOUR::PortSet::remove | ( | boost::shared_ptr< Port > | port | ) |
Definition at line 101 of file port_set.cc.
|
private |
Definition at line 140 of file port_set.h.
|
private |
Definition at line 142 of file port_set.h.
|
private |
Definition at line 138 of file port_set.h.