vsdk 8.1.0
 
Loading...
Searching...
No Matches
Vsdk::Audio::Producer::BufferForwarder

#include <BufferForwarder.hpp>

Inheritance diagram for Vsdk::Audio::Producer::BufferForwarder:
Vsdk::Audio::ProducerModuleImpl< BufferForwarder > Vsdk::Audio::ProducerModule

Public Member Functions

 BufferForwarder () noexcept
 Constructs a BufferForwarder with an accelerationRate of 1.0.
 
void forward (Vsdk::Audio::Buffer buffer, bool last)
 Dumps the buffer into the pipeline.
 
void stream (Vsdk::Audio::Buffer buffer, bool last, std::size_t bufferSize)
 Synchronously streams the buffer into the pipeline at a rate of sample rate × channel count bytes per second.
 
void setAccelerationRate (double rate)
 Sets acceleration rate. Cannot be less than 1.0.
 
- Public Member Functions inherited from Vsdk::Audio::ProducerModuleImpl< BufferForwarder >
 ProducerModuleImpl ()=default
 
- Public Member Functions inherited from Vsdk::Audio::ProducerModule
 ProducerModule ()
 
 ProducerModule (ProducerModule &&)
 
ProducerModuleoperator= (ProducerModule &&)
 
virtual ~ProducerModule ()=0
 
 ProducerModule (ProducerModule const &)=delete
 
ProducerModuleoperator= (ProducerModule const &)=delete
 
auto subscribeFirst (AudioCallback c) -> Iterator
 Subscribes as first in the list of audio buffer receivers for this producer.
 
auto subscribeLast (AudioCallback c) -> Iterator
 Subscribes as last in the list of audio buffer receivers for this producer.
 
void unsubscribe (Iterator it) noexcept
 Unsubscribes from this producer audio buffer dispatch list.
 
auto lastError () const -> std::string
 
auto state () const -> State
 
bool isOpened () const
 
bool isRunning () const
 
bool isStarted () const
 
bool isPaused () const
 
bool isIdle () const
 
bool isClosed () const
 
bool open () noexcept
 Attempts to open the underlying resource(s) of the producer.
 
bool run () noexcept
 
bool start () noexcept
 
bool pause () noexcept
 Attempts to pause a started producer.
 
bool resume () noexcept
 Attempts to resume a paused producer.
 
bool stop () noexcept
 Attempts to stop a started producer.
 
bool close () noexcept
 

Protected Member Functions

void startImpl () override
 
void stopImpl () override
 
- Protected Member Functions inherited from Vsdk::Audio::ProducerModule
virtual void openImpl ()
 
virtual void runImpl ()
 
virtual void startImpl ()
 
virtual void pauseImpl ()
 
virtual void resumeImpl ()
 
virtual void stopImpl ()
 
virtual void closeImpl ()
 
void dispatchBuffer (Buffer buffer, bool last)
 
template<typename T >
void dispatchAudio (T &&data, int sampleRate, int channelCount, bool isLast)
 

Additional Inherited Members

- Public Types inherited from Vsdk::Audio::ProducerModule
enum class  State {
  Closed , Opened , Running , Started ,
  Paused , Idle
}
 
using Iterator = details::Iterator< decltype(_subscribers)>
 Iterator pointing to a subscriber of this producer.
 
- Static Public Member Functions inherited from Vsdk::Audio::ProducerModuleImpl< BufferForwarder >
static auto make (Args &&... args) -> std::shared_ptr< BufferForwarder >
 
- Protected Attributes inherited from Vsdk::Audio::ProducerModule
std::atomic< State_state
 

Constructor & Destructor Documentation

◆ BufferForwarder()

BufferForwarder::BufferForwarder ( )
noexcept

Constructs a BufferForwarder with an accelerationRate of 1.0.

Member Function Documentation

◆ forward()

void BufferForwarder::forward ( Vsdk::Audio::Buffer  buffer,
bool  last 
)

Dumps the buffer into the pipeline.

◆ stream()

void BufferForwarder::stream ( Vsdk::Audio::Buffer  buffer,
bool  last,
std::size_t  bufferSize 
)

Synchronously streams the buffer into the pipeline at a rate of sample rate × channel count bytes per second.

Parameters
bufferIf zero or >= buffer.size(), is equivalent to a call to forward(). If its value is >= sample rate × channel count, more than a second will be spent sleeping before the next audio dispatch is done

◆ setAccelerationRate()

void BufferForwarder::setAccelerationRate ( double  rate)

Sets acceleration rate. Cannot be less than 1.0.

◆ startImpl()

void BufferForwarder::startImpl ( )
overrideprotectedvirtual

Reimplemented from Vsdk::Audio::ProducerModule.

◆ stopImpl()

void BufferForwarder::stopImpl ( )
overrideprotectedvirtual

Reimplemented from Vsdk::Audio::ProducerModule.