vsdk  7.1.1
Vsdk::Audio::Pipeline

Route audio from a ProducerModule to ConsumerModule, with ModifierModule in the middle. More...

Public Types

using ModifierIterator = details::Iterator< decltype(_modifiers)>
 
using ConsumerIterator = details::Iterator< decltype(_consumers)>
 

Public Member Functions

 Pipeline ()=default
 
 Pipeline (Pipeline const &other)=delete
 Cannot copy because Modifiers & Consumers cannot be shared nor cloned. More...
 
Pipelineoperator= (Pipeline const &other)=delete
 Cannot copy because Modifiers & Consumers cannot be shared nor cloned. More...
 
 Pipeline (Pipeline &&other)
 
Pipelineoperator= (Pipeline &&)
 
 ~Pipeline ()
 Stops the pipeline if running and unsubscribe from the producer. More...
 
void run ()
 Synchronously runs the pipeline (if supported by the provider). More...
 
void start ()
 Asynchronously runs the pipeline (if supported by the provider). More...
 
void stop ()
 Stops a pipeline that's been start()-ed. More...
 
void setProducer (ProducerPtr producer)
 Sets a new producer that's already been constructed outside. More...
 
template<class T , typename... Args>
auto setProducer (Args &&... args) -> std::shared_ptr< T >
 Sets a new producer by constructing it with args. More...
 
template<class T , typename... Args>
auto pushBackModifier (Args &&... args) -> ModifierIterator
 
template<class T , typename... Args>
auto pushFrontModifier (Args &&... args) -> ModifierIterator
 
template<class T , typename... Args>
auto pushBackConsumer (Args &&... args) -> ConsumerIterator
 
template<class T , typename... Args>
auto pushFrontConsumer (Args &&... args) -> ConsumerIterator
 
template<class T , typename... Args>
auto insertModifier (ModifierIterator pos, Args &&... args) -> ModifierIterator
 
template<class T , typename... Args>
auto insertConsumer (ConsumerIterator pos, Args &&... args) -> ConsumerIterator
 
auto pushBackModifier (ModifierPtr ptr) -> ModifierIterator
 
auto pushBackConsumer (ConsumerPtr ptr) -> ConsumerIterator
 
auto pushFrontModifier (ModifierPtr ptr) -> ModifierIterator
 
auto pushFrontConsumer (ConsumerPtr ptr) -> ConsumerIterator
 
auto insertModifier (ModifierIterator pos, ModifierPtr ptr) -> ModifierIterator
 
auto insertConsumer (ConsumerIterator pos, ConsumerPtr ptr) -> ConsumerIterator
 
void eraseModifier (ModifierIterator it)
 
void eraseConsumer (ConsumerIterator it)
 
auto producer () const -> ProducerPtr
 Gets this pipeline's producer in a generic form. More...
 
template<typename T >
auto producer () const -> std::shared_ptr< T >
 Gets this pipeline's producer statically casted to T. More...
 

Detailed Description

Route audio from a ProducerModule to ConsumerModule, with ModifierModule in the middle.

Member Typedef Documentation

◆ ModifierIterator

using Vsdk::Audio::Pipeline::ModifierIterator = details::Iterator<decltype(_modifiers)>

◆ ConsumerIterator

using Vsdk::Audio::Pipeline::ConsumerIterator = details::Iterator<decltype(_consumers)>

Constructor & Destructor Documentation

◆ Pipeline() [1/3]

Vsdk::Audio::Pipeline::Pipeline ( )
default

◆ Pipeline() [2/3]

Vsdk::Audio::Pipeline::Pipeline ( Pipeline const &  other)
delete

Cannot copy because Modifiers & Consumers cannot be shared nor cloned.

◆ Pipeline() [3/3]

Pipeline::Pipeline ( Pipeline &&  other)

◆ ~Pipeline()

Pipeline::~Pipeline ( )

Stops the pipeline if running and unsubscribe from the producer.

Member Function Documentation

◆ operator=() [1/2]

Pipeline& Vsdk::Audio::Pipeline::operator= ( Pipeline const &  other)
delete

Cannot copy because Modifiers & Consumers cannot be shared nor cloned.

◆ operator=() [2/2]

Pipeline & Pipeline::operator= ( Pipeline &&  other)

◆ run()

void Pipeline::run ( )

Synchronously runs the pipeline (if supported by the provider).

Effectively calls:

producer.open();
producer.run();
producer.close();
Exceptions
Vsdk::Exceptionif:
  • The pipeline is already running ;
  • No producer has been set prior ;
  • The producer fails to open ;
  • The producer fails to run ;
  • The producer fails to close ;

◆ start()

void Pipeline::start ( )

Asynchronously runs the pipeline (if supported by the provider).

Effectively calls:

producer.open();
producer.start();
Note
Does nothing if start() has already been called.
Exceptions
Vsdk::Exceptionif:
  • No producer has been set prior ;
  • The producer fails to open ;
  • The producer fails to start ;

◆ stop()

void Pipeline::stop ( )

Stops a pipeline that's been start()-ed.

Effectively calls:

producer.stop();
producer.close();
Note
Does nothing if start() has not been called.
Exceptions
Vsdk::Exceptionif:
  • No producer has been set prior ;
  • The producer fails to stop ;
  • The producer fails to close ;

◆ setProducer() [1/2]

void Pipeline::setProducer ( ProducerPtr  producer)

Sets a new producer that's already been constructed outside.

Note
If the pipeline is running it will first be stopped before setting the producer.

◆ setProducer() [2/2]

template<class T , typename... Args>
auto Vsdk::Audio::Pipeline::setProducer ( Args &&...  args) -> std::shared_ptr<T>

Sets a new producer by constructing it with args.

◆ pushBackModifier() [1/2]

template<class T , typename... Args>
auto Vsdk::Audio::Pipeline::pushBackModifier ( Args &&...  args) -> ModifierIterator

◆ pushFrontModifier() [1/2]

template<class T , typename... Args>
auto Vsdk::Audio::Pipeline::pushFrontModifier ( Args &&...  args) -> ModifierIterator

◆ pushBackConsumer() [1/2]

template<class T , typename... Args>
auto Vsdk::Audio::Pipeline::pushBackConsumer ( Args &&...  args) -> ConsumerIterator

◆ pushFrontConsumer() [1/2]

template<class T , typename... Args>
auto Vsdk::Audio::Pipeline::pushFrontConsumer ( Args &&...  args) -> ConsumerIterator

◆ insertModifier() [1/2]

template<class T , typename... Args>
auto Vsdk::Audio::Pipeline::insertModifier ( ModifierIterator  pos,
Args &&...  args 
) -> ModifierIterator

◆ insertConsumer() [1/2]

template<class T , typename... Args>
auto Vsdk::Audio::Pipeline::insertConsumer ( ConsumerIterator  pos,
Args &&...  args 
) -> ConsumerIterator

◆ pushBackModifier() [2/2]

auto Pipeline::pushBackModifier ( ModifierPtr  ptr) -> ModifierIterator

◆ pushBackConsumer() [2/2]

auto Pipeline::pushBackConsumer ( ConsumerPtr  ptr) -> ConsumerIterator

◆ pushFrontModifier() [2/2]

auto Pipeline::pushFrontModifier ( ModifierPtr  ptr) -> ModifierIterator

◆ pushFrontConsumer() [2/2]

auto Pipeline::pushFrontConsumer ( ConsumerPtr  ptr) -> ConsumerIterator

◆ insertModifier() [2/2]

auto Pipeline::insertModifier ( ModifierIterator  pos,
ModifierPtr  ptr 
) -> ModifierIterator

◆ insertConsumer() [2/2]

auto Pipeline::insertConsumer ( ConsumerIterator  pos,
ConsumerPtr  ptr 
) -> ConsumerIterator

◆ eraseModifier()

void Pipeline::eraseModifier ( ModifierIterator  it)

◆ eraseConsumer()

void Pipeline::eraseConsumer ( ConsumerIterator  it)

◆ producer() [1/2]

auto Vsdk::Audio::Pipeline::producer ( ) const -> ProducerPtr

Gets this pipeline's producer in a generic form.

◆ producer() [2/2]

template<typename T >
auto Vsdk::Audio::Pipeline::producer ( ) const -> std::shared_ptr<T>

Gets this pipeline's producer statically casted to T.

Note
Use the non-templated overload if you need to perform a type check
Vsdk::Audio::Pipeline::producer
auto producer() const -> ProducerPtr
Gets this pipeline's producer in a generic form.
Definition: Pipeline.hpp:259