Base class for Pipeline modules that aquire and dispatch audio buffers (like Producer::File)
More...
#include <ProducerModule.hpp>
Base class for Pipeline modules that aquire and dispatch audio buffers (like Producer::File)
◆ StateChangedCallback
◆ Iterator
Iterator pointing to a subscriber of this producer.
◆ State
| Enumerator |
|---|
| Closed | Ready to be open()-ed.
|
| Opened | Ready to call run() or start()
|
| Running | Inside of run()
|
| Started | start() (or resume()) has been called and work is in progress
|
| Paused | pause() has been called
|
| Idle | Either stop() has been called or audio production is over, new work can be launched.
|
◆ ProducerModule() [1/3]
| ProducerModule::ProducerModule |
( |
| ) |
|
◆ ProducerModule() [2/3]
◆ ~ProducerModule()
| ProducerModule::~ProducerModule |
( |
| ) |
|
|
pure virtual |
◆ ProducerModule() [3/3]
| Vsdk::Audio::ProducerModule::ProducerModule |
( |
ProducerModule const & | | ) |
|
|
delete |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ subscribeFirst()
| auto ProducerModule::subscribeFirst |
( |
AudioCallback | c | ) |
-> Iterator |
Subscribes as first in the list of audio buffer receivers for this producer.
◆ subscribeLast()
| auto ProducerModule::subscribeLast |
( |
AudioCallback | c | ) |
-> Iterator |
Subscribes as last in the list of audio buffer receivers for this producer.
◆ unsubscribe()
| void ProducerModule::unsubscribe |
( |
Iterator | it | ) |
|
|
noexcept |
Unsubscribes from this producer audio buffer dispatch list.
◆ state()
| auto ProducerModule::state |
( |
| ) |
const -> State |
◆ isOpened()
| bool ProducerModule::isOpened |
( |
| ) |
const |
◆ isRunning()
| bool ProducerModule::isRunning |
( |
| ) |
const |
◆ isStarted()
| bool ProducerModule::isStarted |
( |
| ) |
const |
◆ isPaused()
| bool ProducerModule::isPaused |
( |
| ) |
const |
◆ isIdle()
| bool ProducerModule::isIdle |
( |
| ) |
const |
◆ isClosed()
| bool ProducerModule::isClosed |
( |
| ) |
const |
◆ open()
| void ProducerModule::open |
( |
| ) |
|
Attempts to open the underlying resource(s) of the producer.
- Note
-
- Postcondition
state() == State::Opened
- Exceptions
-
| Vsdk::Exception | if error occurs |
◆ run()
| void ProducerModule::run |
( |
| ) |
|
- Note
-
Blocking call, no asynchronous work should be performed
- Warning
- Do not override if you do not support synchronous operations!
- Precondition
state() == State::Opened
- Postcondition
state() == State::Opened
- Exceptions
-
| Vsdk::Exception | if error occurs |
◆ start()
| void ProducerModule::start |
( |
| ) |
|
- Note
-
Non-blocking call: producer might not be started right after this
- Warning
- Do not override if you do not support async operations!
- Precondition
state() == State::Opened
- Exceptions
-
| Vsdk::Exception | if error occurs |
◆ pause()
| void ProducerModule::pause |
( |
| ) |
|
Attempts to pause a started producer.
- Note
-
Non-blocking call: producer might not be paused right after this
- Warning
- Do not override if you do not support pausing!
- Exceptions
-
| Vsdk::Exception | if error occurs |
◆ resume()
| void ProducerModule::resume |
( |
| ) |
|
Attempts to resume a paused producer.
- Note
-
Non-blocking call: producer might not be resumed right after this
- Warning
- Do not override if you do not support resuming!
- Exceptions
-
| Vsdk::Exception | if error occurs |
◆ stop()
| void ProducerModule::stop |
( |
| ) |
|
Attempts to stop a started producer.
- Note
-
Non-blocking call: producer state might not be
Idle after this
- Warning
- Do not override if you do not support async operations!
- Exceptions
-
| Vsdk::Exception | if error occurs |
◆ close()
| void ProducerModule::close |
( |
| ) |
|
- Note
-
Blocking call: producer should wait for proper closing
- Warning
-
Attempting to close a running producer will fail
-
Attempting to close a started producer will first try to close it
- Postcondition
state() == State::Closed
- Exceptions
-
| Vsdk::Exception | if error occurs |
◆ openImpl()
| void ProducerModule::openImpl |
( |
| ) |
|
|
protectedvirtual |
◆ runImpl()
| void ProducerModule::runImpl |
( |
| ) |
|
|
protectedvirtual |
◆ startImpl()
| void ProducerModule::startImpl |
( |
| ) |
|
|
protectedvirtual |
◆ pauseImpl()
| void ProducerModule::pauseImpl |
( |
| ) |
|
|
protectedvirtual |
◆ resumeImpl()
| void ProducerModule::resumeImpl |
( |
| ) |
|
|
protectedvirtual |
◆ stopImpl()
| void ProducerModule::stopImpl |
( |
| ) |
|
|
protectedvirtual |
◆ closeImpl()
| void ProducerModule::closeImpl |
( |
| ) |
|
|
protectedvirtual |
◆ setStateChangedCallback()
◆ setState()
| void ProducerModule::setState |
( |
State | s | ) |
|
|
protected |
◆ dispatchBuffer()
| void ProducerModule::dispatchBuffer |
( |
Buffer | buffer, |
|
|
bool | last ) |
|
protected |
◆ dispatchAudio()
template<typename T>
| void Vsdk::Audio::ProducerModule::dispatchAudio |
( |
T && | data, |
|
|
int | sampleRate, |
|
|
int | channelCount, |
|
|
bool | isLast ) |
|
protected |