Base class for Pipeline modules that aquire and dispatch audio buffers (like Producer::File)
More...
Base class for Pipeline modules that aquire and dispatch audio buffers (like Producer::File)
◆ 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.
◆ lastError()
auto ProducerModule::lastError |
( |
| ) |
const -> std::string |
◆ 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()
bool ProducerModule::open |
( |
| ) |
|
|
noexcept |
Attempts to open the underlying resource(s) of the producer.
- Note
-
Blocking call
-
lastError()
is reset at the beginning of this function
- Postcondition
state() == State::Opened
◆ run()
bool ProducerModule::run |
( |
| ) |
|
|
noexcept |
- Note
-
Blocking call, no asynchronous work should be performed
-
lastError()
is reset at the beginning of this function
- Warning
- Do not override if you do not support synchronous operations!
- Precondition
state() == State::Opened
- Postcondition
state() == State::Opened
◆ start()
bool ProducerModule::start |
( |
| ) |
|
|
noexcept |
- Note
-
Non-blocking call: producer might not be started right after this
-
lastError()
is reset at the beginning of this function
- Warning
- Do not override if you do not support async operations!
- Precondition
state() == State::Opened
◆ pause()
bool ProducerModule::pause |
( |
| ) |
|
|
noexcept |
Attempts to pause a started producer.
- Note
-
Non-blocking call: producer might not be paused right after this
-
lastError()
is reset at the beginning of this function
- Warning
- Do not override if you do not support pausing!
◆ resume()
bool ProducerModule::resume |
( |
| ) |
|
|
noexcept |
Attempts to resume a paused producer.
- Note
-
Non-blocking call: producer might not be resumed right after this
-
lastError()
is reset at the beginning of this function
- Warning
- Do not override if you do not support resuming!
◆ stop()
bool ProducerModule::stop |
( |
| ) |
|
|
noexcept |
Attempts to stop a started producer.
- Note
-
Non-blocking call: producer state might not be
Idle
after this
-
lastError()
is reset at the beginning of this function
- Warning
- Do not override if you do not support async operations!
◆ close()
bool ProducerModule::close |
( |
| ) |
|
|
noexcept |
- Note
-
Blocking call: producer should wait for proper closing
-
lastError()
is reset at the beginning of this function
- 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
◆ 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 |
◆ 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 |
◆ _state
std::atomic<State> Vsdk::Audio::ProducerModule::_state |
|
protected |