Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::audio::StreamingSampleSourceConfig Struct Reference

#include <streaming_sample_source.hpp>

Public Attributes

std::uint32_t channels = 0
 Source channel count (1 or 2 typical).
std::uint64_t total_frames = 0
 Total length of the source in frames.
std::uint32_t sample_rate = 0
 Source sample rate (carried, not resampled here).
std::uint64_t preload_frames = 0
 Resident head length in frames.
std::uint64_t ring_capacity_frames = 0
 Streamed-tail ring capacity in frames.
std::uint64_t read_chunk_frames = 8192
 Background read granularity in frames (how much the reader pulls per refill step).
bool loop = false
 Loop the playback.
std::uint64_t loop_start = 0
 Loop start frame (resident-loop only).
std::uint64_t loop_end = 0
 Loop end frame, exclusive; 0 means total_frames.
bool start_background_thread = true
 Spawn the owned background reader thread in prepare().
StreamingUnderrunPolicy underrun_policy
 Whether a streaming underrun preserves the source cursor or consumes its missing interval.
std::uint64_t max_read_ahead_frames = 0
 Maximum distance the reader may produce ahead of the play cursor.

Member Data Documentation

◆ channels

std::uint32_t pulp::audio::StreamingSampleSourceConfig::channels = 0

Source channel count (1 or 2 typical).

◆ loop

bool pulp::audio::StreamingSampleSourceConfig::loop = false

Loop the playback.

Honored only for fully-resident sources; streamed sources play once and then report finished().

◆ loop_end

std::uint64_t pulp::audio::StreamingSampleSourceConfig::loop_end = 0

Loop end frame, exclusive; 0 means total_frames.

◆ loop_start

std::uint64_t pulp::audio::StreamingSampleSourceConfig::loop_start = 0

Loop start frame (resident-loop only).

◆ max_read_ahead_frames

std::uint64_t pulp::audio::StreamingSampleSourceConfig::max_read_ahead_frames = 0

Maximum distance the reader may produce ahead of the play cursor.

Zero leaves read-ahead bounded only by ring capacity. Deadline-bound sources use this to separate callback-sized storage from their production lookahead horizon.

◆ preload_frames

std::uint64_t pulp::audio::StreamingSampleSourceConfig::preload_frames = 0

Resident head length in frames.

Clamped to [0, total_frames]. The head guarantees a glitch-free note-on even if the reader thread is busy. When preload_frames >= total_frames the source is fully resident.

◆ read_chunk_frames

std::uint64_t pulp::audio::StreamingSampleSourceConfig::read_chunk_frames = 8192

Background read granularity in frames (how much the reader pulls per refill step).

Clamped to the ring capacity. Ignored when fully resident.

◆ ring_capacity_frames

std::uint64_t pulp::audio::StreamingSampleSourceConfig::ring_capacity_frames = 0

Streamed-tail ring capacity in frames.

Must comfortably exceed the audio block size; a few hundred ms is typical. Ignored when fully resident.

◆ sample_rate

std::uint32_t pulp::audio::StreamingSampleSourceConfig::sample_rate = 0

Source sample rate (carried, not resampled here).

◆ start_background_thread

bool pulp::audio::StreamingSampleSourceConfig::start_background_thread = true

Spawn the owned background reader thread in prepare().

Set false to drive refills manually via pump_background() (deterministic testing).

◆ total_frames

std::uint64_t pulp::audio::StreamingSampleSourceConfig::total_frames = 0

Total length of the source in frames.

◆ underrun_policy

StreamingUnderrunPolicy pulp::audio::StreamingSampleSourceConfig::underrun_policy
Initial value:

Whether a streaming underrun preserves the source cursor or consumes its missing interval.

Generated deadline-bound content advances; ordinary sample playback preserves every frame.


The documentation for this struct was generated from the following file: