12 std::shared_ptr<Kakshya::DynamicSoundStream> stream,
17 : m_stream(
std::move(stream))
18 , m_processor(
std::make_shared<Buffers::StreamSliceProcessor>())
21 , m_scheduler(scheduler)
23 , m_buf_size(buf_size)
83 const double seconds =
static_cast<double>(milliseconds) / 1000.0;
88 std::ranges::fill(
m_buffer->get_data(), 0.0);
100 "SamplingPipeline::rebuild_for called before build. Use build_for instead to avoid redundant setup.");
105 const double seconds =
static_cast<double>(milliseconds) / 1000.0;
110 std::ranges::fill(
m_buffer->get_data(), 0.0);
120 "SamplingPipeline::play index {} exceeds slot count {}", index,
m_processor->slot_count());
142 "SamplingPipeline::play_continuous index {} exceeds slot count {}", index,
m_processor->slot_count());
168 "SamplingPipeline::stop index {} exceeds slot count {}", index,
m_processor->slot_count());
#define MF_RT_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
uint32_t get_buffer_size(ProcessingToken token) const
Gets the buffer size for a token.
uint64_t get_sample_rate() const
Gets the sample rate for a token (audio-specific)
bool supply_buffer_to(const std::shared_ptr< AudioBuffer > &buffer, ProcessingToken token, uint32_t channel, double mix=1.0, bool force=false)
bool remove_supplied_buffer(const std::shared_ptr< AudioBuffer > &buffer, ProcessingToken token, uint32_t channel)
Token-based multimodal buffer management system for unified data stream processing.
Fundamental unit of operation in buffer processing pipelines.
static std::shared_ptr< BufferPipeline > create(Vruta::TaskScheduler &scheduler, std::shared_ptr< Buffers::BufferManager > buffer_manager=nullptr)
Coroutine-based execution engine for composable, multi-strategy buffer processing.
CaptureBuilder & on_capture_processing()
Set processing control to ON_CAPTURE mode.
CaptureBuilder & for_cycles(uint32_t count)
Set number of cycles to capture (enables ACCUMULATE mode).
Fluent builder interface for constructing BufferCapture configurations.
std::shared_ptr< Buffers::AudioBuffer > m_buffer
Kakshya::StreamSlice & slice(size_t index)
Direct access to a voice's StreamSlice for configuration.
CaptureBuilder & capture()
Access the capture operation builder for fluent configuration.
void build()
Finalize configuration and start processing.
void build_for(uint64_t milliseconds)
Finalize configuration and start processing for a bounded duration.
std::shared_ptr< Buffers::StreamSliceProcessor > m_processor
Vruta::TaskScheduler & m_scheduler
void play_continuous(size_t index=0)
Activate a voice with looping enabled.
Buffers::BufferManager & m_mgr
void play(size_t index=0)
Activate a voice, resetting its cursor to loop_start.
void stop(size_t index=0)
Deactivate a voice.
BufferPipeline & pipeline()
Access the internal pipeline for fluent configuration.
std::shared_ptr< BufferPipeline > m_pipeline
void rebuild_for(uint64_t milliseconds)
Stop and restart pipeline execution for a bounded duration.
SamplingPipeline(std::shared_ptr< Kakshya::DynamicSoundStream > stream, Buffers::BufferManager &mgr, Vruta::TaskScheduler &scheduler, uint32_t channel, uint32_t buf_size)
Begin construction with a loaded stream and output channel.
Token-based multimodal task scheduling system for unified coroutine processing.
@ AUDIO_BACKEND
Standard audio processing backend configuration.
@ Configuration
Configuration and parameter updates.
@ Kriya
Automatable tasks and fluent scheduling api for Nodes and Buffers.
uint64_t seconds_to_blocks(double seconds, uint32_t sample_rate, uint32_t block_size)
Convert seconds to number of processing blocks.
A bounded region of a DynamicSoundStream with associated playback parameters.