Wraps a PositionableAudioSource with transport-level control:
More...
#include <transport_source.hpp>
Wraps a PositionableAudioSource with transport-level control:
- start / stop toggle whether get_next_audio_block emits source audio or silence.
- set_gain applies a linear gain ramp across the next block (no per-sample click on level changes).
- position / length / looping pass through to the wrapped source.
The transport does not own the source — caller is responsible for keeping the PositionableAudioSource* alive at least as long as get_next_audio_block may be called.
◆ AudioTransportSource()
| pulp::audio::AudioTransportSource::AudioTransportSource |
( |
| ) |
|
|
default |
◆ current_gain()
| float pulp::audio::AudioTransportSource::current_gain |
( |
| ) |
const |
|
inline |
◆ gain()
| float pulp::audio::AudioTransportSource::gain |
( |
| ) |
const |
|
inline |
◆ get_next_audio_block()
| void pulp::audio::AudioTransportSource::get_next_audio_block |
( |
BufferView< float > | out, |
|
|
int | start_sample, |
|
|
int | num_samples ) |
|
inlineoverridevirtual |
Fill num_samples of out, starting at start_sample within out.
The source writes (not adds) into the range so callers don't need to pre-zero.
Implements pulp::audio::AudioSource.
◆ get_next_read_position()
| uint64_t pulp::audio::AudioTransportSource::get_next_read_position |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ get_total_length()
| uint64_t pulp::audio::AudioTransportSource::get_total_length |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ is_looping()
| bool pulp::audio::AudioTransportSource::is_looping |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ is_playing()
| bool pulp::audio::AudioTransportSource::is_playing |
( |
| ) |
const |
|
inline |
◆ prepare_to_play()
| void pulp::audio::AudioTransportSource::prepare_to_play |
( |
int | samples_per_block_expected, |
|
|
double | sample_rate ) |
|
inlineoverridevirtual |
Called before playback begins.
samples_per_block_expected is the maximum block length the host will ever ask for; implementations may allocate scratch buffers of that size here.
Implements pulp::audio::AudioSource.
◆ release_resources()
| void pulp::audio::AudioTransportSource::release_resources |
( |
| ) |
|
|
inlineoverridevirtual |
◆ set_gain()
| void pulp::audio::AudioTransportSource::set_gain |
( |
float | new_gain | ) |
|
|
inline |
Set the target gain.
The change is applied as a per-sample ramp from the current gain to new_gain across the next block — click-free under typical fader motion.
◆ set_looping()
| void pulp::audio::AudioTransportSource::set_looping |
( |
bool | | ) |
|
|
inlineoverridevirtual |
◆ set_next_read_position()
| void pulp::audio::AudioTransportSource::set_next_read_position |
( |
uint64_t | new_position | ) |
|
|
inlineoverridevirtual |
Move the read head to new_position (frames from the start of the source).
For finite sources, positions past get_total_length() are caller-defined behavior — most implementations clamp to total length or wrap on the next read.
Implements pulp::audio::PositionableAudioSource.
◆ set_source()
Bind a source (or nullptr to detach). Resets gain ramp state.
◆ source()
◆ start()
| void pulp::audio::AudioTransportSource::start |
( |
| ) |
|
|
inline |
◆ stop()
| void pulp::audio::AudioTransportSource::stop |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following file: