![]() |
VISR
0.11.1
Versatile Interactive Scene Renderer
|
#include <composite_component.hpp>
Public Types | |
using | ChannelRange = visr::ChannelRange |
using | ChannelList = visr::ChannelList |
Public Member Functions | |
CompositeComponent (SignalFlowContext const &context, char const *name, CompositeComponent *parent=nullptr) | |
~CompositeComponent () | |
std::size_t | numberOfComponents () const |
impl::CompositeComponentImplementation & | implementation () |
impl::CompositeComponentImplementation const & | implementation () const |
void | parameterConnection (char const *sendComponent, char const *sendPort, char const *receiveComponent, char const *receivePort) |
void | parameterConnection (ParameterPortBase &sender, ParameterPortBase &receiver) |
void | audioConnection (char const *sendComponent, char const *sendPort, ChannelList const &sendIndices, char const *receiveComponent, char const *receivePort, ChannelList const &receiveIndices) |
void | audioConnection (AudioPortBase &sendPort, ChannelList const &sendIndices, AudioPortBase &receivePort, ChannelList const &receiveIndices) |
void | audioConnection (AudioPortBase &sendPort, AudioPortBase &receivePort) |
![]() | |
Component (SignalFlowContext const &context, char const *componentName, CompositeComponent *parent) | |
Component (SignalFlowContext const &context, std::string const &componentName, CompositeComponent *parent) | |
Component (Component const &)=delete | |
Component (Component &&)=delete | |
Component & | operator= (Component const &)=delete |
Component & | operator= (Component &&)=delete |
virtual | ~Component () |
std::string const & | name () const |
std::string | fullName () const |
void | status (StatusMessage::Kind status, char const *message) |
template<typename ... MessageArgs> | |
void | status (StatusMessage::Kind status, MessageArgs ... args) |
bool | isComposite () const |
AudioPortBase & | audioPort (char const *portName) |
AudioPortBase const & | audioPort (char const *portName) const |
AudioPortBase & | audioPort (std::string const &portName) |
AudioPortBase const & | audioPort (std::string const &portName) const |
ParameterPortBase & | parameterPort (char const *portName) |
ParameterPortBase const & | parameterPort (char const *portName) const |
ParameterPortBase & | parameterPort (std::string const &portName) |
ParameterPortBase const & | parameterPort (std::string const &portName) const |
SamplingFrequencyType | samplingFrequency () const |
std::size_t | period () const |
bool | isTopLevel () const |
impl::ComponentImplementation & | implementation () |
impl::ComponentImplementation const & | implementation () const |
Additional Inherited Members | |
![]() | |
static const std::string & | nameSeparator () |
![]() | |
Component (impl::ComponentImplementation *impl) | |
Base class for processing components that are composed of other components (atomic and composite). In this way, processing components can be structured hierarchically. Composite components store the contained sub-components, external audio and parameter ports, and conenctions between the ports.
Making the types for defining audio connections known inside CompositeConponent and derived classes These are convenience aliases to make the syntax in derived signal flows more concise.
|
explicit |
Constructor.
context | Reference to a signal flow context object providing basic runtime parameters as period length or sampling frequency. |
name | "the name of the component. Used to address the component inside other components and for status reporting. |
parent | Reference (pointer) to a parent component if the present object is part of a containing signal flow. If nullptr is passed, this component is the top level. |
visr::CompositeComponent::~CompositeComponent | ( | ) |
Destructor.
void visr::CompositeComponent::audioConnection | ( | char const * | sendComponent, |
char const * | sendPort, | ||
ChannelList const & | sendIndices, | ||
char const * | receiveComponent, | ||
char const * | receivePort, | ||
ChannelList const & | receiveIndices | ||
) |
Register an audio connection between a sending and a receiving audio port. This overload uses C strings to denote both the names of the components holding the ports and the output ports itself. Lists of channel indices are to be specified for the sending and the receiving port. The sizes of these lists must be identical, and the contained indices must not exceed the width of the send and receive port, respectively. Empty lists for both the send and receive indices are permitted and result in no connection.
sendComponent | Name of the component holding the sending audio port. If the send port is an external input of this component, use "" or "this" |
sendPort | The name of the sending port. |
sendIndices | A list of channel indices denoting the send channels of the sending side. |
receiveComponent | Name of the component holding the receiving audio port. If the receive port is an external output of the present component, use "" or "this" |
receivePort | The name of the receiving port. |
receiveIndices | A list of channel indices denoting the receive channels within the receiver port. |
std::invalid_argument | if a specified component or port does not exist. |
void visr::CompositeComponent::audioConnection | ( | AudioPortBase & | sendPort, |
ChannelList const & | sendIndices, | ||
AudioPortBase & | receivePort, | ||
ChannelList const & | receiveIndices | ||
) |
Register an audio connection between a sending and a receiving audio port. This overload uses audio ports (either directly referencing external in- and output of this components or retrieving ports of contained components using the Component::audioPort() method). Lists of channel indices are to be specified for the sending and the receiving port. The sizes of these lists must be identical, and the contained indices must not exceed the width of the send and receive port, respectively. Empty lists for both the send and receive indices are permitted and result in no connection.
sendPort | The send port object. |
sendIndices | A list of channel indices denoting the send channels of the sending side. |
receivePort | The receive port object. |
receiveIndices | A list of channel indices denoting the receive channels within the receiver port. |
void visr::CompositeComponent::audioConnection | ( | AudioPortBase & | sendPort, |
AudioPortBase & | receivePort | ||
) |
Register an audio connection between all channels of a sending and a receiving audio port. This overload uses audio ports (either directly referencing external in- and output of this components or retrieving ports of contained components using the Component::audioPort() method). It establishes one-to-one connections between the channels of the sender and the receiver.
sendPort | The send port object. |
receivePort | The receive port object. |
std::invalid_argument | if the port widths do not match. |
impl::CompositeComponentImplementation & visr::CompositeComponent::implementation | ( | ) |
Return a reference to the internal data structures holding ports and contained components. From the user point of view, these data structure is opaque and unknown.
impl::CompositeComponentImplementation const & visr::CompositeComponent::implementation | ( | ) | const |
Return a reference to the internal data structures holding ports and contained components, const version. From the user point of view, these data structure is opaque and unknown.
std::size_t visr::CompositeComponent::numberOfComponents | ( | ) | const |
The number of contained components (not including the composite itself). This method considers only atomic and composite components at the next level, i.e., not recursively.
void visr::CompositeComponent::parameterConnection | ( | char const * | sendComponent, |
char const * | sendPort, | ||
char const * | receiveComponent, | ||
char const * | receivePort | ||
) |
Register a connection between parameter ports (both real ports of contained components or external placeholder ports).
sendComponent | The name of the component holding the send port (local name, not the fully qualified name). When specifiying an external port of a composite component, use an empty string or "this" . |
sendPort | The local (not fully qualified) name of the send port. |
receiveComponent | The name of the component holding the receive port (local name, not the fully qualified name). When specifiying an external port of a composite component, use an empty string or "this" . |
receivePort | The local (not fully qualified) name of the receive port. |
std::invalid_argument | if a specified component or port does not exist. |
void visr::CompositeComponent::parameterConnection | ( | ParameterPortBase & | sender, |
ParameterPortBase & | receiver | ||
) |
Register a connection between parameter ports (both real ports of contained components or external placeholder ports).
sender | Reference to the sendig port (retrieved, for example using Component::parameterPort() ) |
receiver | Reference to the sendig port (retrieved, for example using Component::parameterPort() ) |