![]() |
VISR
0.11.8
Versatile Interactive Scene Renderer
|
#include <audio_port_base.hpp>
Public Member Functions | |
AudioPortBase (char const *name, Component &container, AudioSampleType::Id sampleType, PortBase::Direction direction) | |
AudioPortBase (char const *name, Component &container, AudioSampleType::Id sampleType, PortBase::Direction direction, std::size_t width) | |
virtual | ~AudioPortBase () |
void | setWidth (std::size_t newWidth) |
std::size_t | width () const noexcept |
std::size_t | alignmentBytes () noexcept |
std::size_t | alignmentSamples () noexcept |
std::size_t | channelStrideSamples () const noexcept |
std::size_t | channelStrideBytes () const noexcept |
AudioSampleType::Id | sampleType () const noexcept |
std::size_t | sampleSize () const noexcept |
impl::AudioPortBaseImplementation & | implementation () |
impl::AudioPortBaseImplementation const & | implementation () const |
Protected Member Functions | |
void * | basePointer () |
void const * | basePointer () const |
Base class for audio ports. Audio ports can form part of the external interface of components and denote start and end points od audio signal connections. An audio port is characterised by a sample type (fundamental integral and floating-point data type as well as complex floating-point types), the width, that is, the number of elementary audio signals represented by this port.
|
explicit |
Constructor, construct a base audio port object with width zero. The width can be set later on during initialization using setWidth().
name | Zero-terminated charracter array containing the name of the port. The port name must be unique within all audio ports of the containing component |
container | The component to contain that port. |
sampleType | Enumeration value denoting the data type of the samples used by this port. |
direction | The direction of the port (either input or output) |
|
explicit |
Constructor, construct a base audio port object with a width parameter.
name | Zero-terminated charracter array containing the name of the port. The port name must be unique within all audio ports of the containing component |
container | The component to contain that port. |
sampleType | Enumeration value denoting the data type of the samples used by this port. |
direction | The direction of the port (either input or output) |
width | The width, i.e., the number of separate audio channels. This value can be changed before runtime. |
|
virtual |
Destructor (virtual). Audio ports can possibley be created and held polymorphically, although this is not done in standard components.
|
noexcept |
Return the alignment of the channel vectors in bytes. This method can be called at any point of the lifetime of an audio port, and the alignment is guaranteed not to change.
|
noexcept |
Return the guaranteed alignment of the channel vectors (in multiples of the sample size). This function can be called at any point of the audio port's lifetime and the alignment remains constant througout that lifetime.
|
protected |
Return the data pointer to fir first (technically zeroth) channel. The type of this pointer is char and needs to be casted in derived, typed port classes.
|
protected |
Return the data pointer to fir first (technically zeroth) channel, costant versiob The type of this pointer is char and needs to be casted in derived, typed port classes.
|
noexcept |
Return the number of bytesbetween the start of consecutive audio channels.
|
noexcept |
Return the number of samples between the start of consecutive audio channels.
impl::AudioPortBaseImplementation & visr::AudioPortBase::implementation | ( | ) |
Return apointer to the opaque implemenentation object. This method is not to be used by implementation code.
impl::AudioPortBaseImplementation const & visr::AudioPortBase::implementation | ( | ) | const |
Return apointer to the opaque implemenentation object, const version. This method is not to be used by implementation code.
|
noexcept |
Return the size (in bytes) of the data type provided by this port
|
noexcept |
Return an enumeration value denoting the type of the audio samples used by this port.
void visr::AudioPortBase::setWidth | ( | std::size_t | newWidth | ) |
Set the width (i.e., the number of individual audio signals) contained within this port. The new value overwrites any previously set values and can be called multiple times on a single port. This method must only be called in the initialisation phase of the signal flow, not during runtime.
newWidth | The new width (number of single audio signals). |
std::logic_error | If the method is called during runtime. |
|
noexcept |
Return the number of individual channels held by this port.