12 const std::shared_ptr<Buffers::BufferManager>& buffer_manager,
13 uint32_t input_channel,
17 auto input_buffer = std::make_shared<Buffers::AudioBuffer>(input_channel);
18 buffer_manager->register_input_listener(input_buffer, input_channel);
30 const std::shared_ptr<Buffers::BufferManager>& buffer_manager,
31 uint32_t input_channel)
33 auto input_buffer = std::make_shared<Buffers::AudioBuffer>(input_channel);
34 buffer_manager->register_input_listener(input_buffer, input_channel);
40 const std::string& filepath,
45 if (!file_container) {
47 "Failed to load audio file: {}", filepath);
50 auto file_buffer = std::make_shared<Buffers::FileBridgeBuffer>(channel, file_container);
51 file_buffer->setup_chain_and_processor();
63 const std::string& filepath,
67 if (!file_container) {
69 "Failed to load audio file: {}", filepath);
72 auto file_buffer = std::make_shared<Buffers::FileBridgeBuffer>(channel, file_container);
73 file_buffer->setup_chain_and_processor();
79 const std::string& filepath,
80 std::shared_ptr<Kakshya::DynamicSoundStream> target_stream,
84 if (!file_container) {
86 "Failed to load audio file: {}", filepath);
89 auto temp_buffer = std::make_shared<Buffers::FileBridgeBuffer>(0, file_container);
90 temp_buffer->setup_chain_and_processor();
121 std::shared_ptr<Buffers::AudioBuffer> target,
122 uint64_t start_frame,
149 std::shared_ptr<Buffers::AudioBuffer> target)
160 std::shared_ptr<Kakshya::DynamicSoundStream> target)
170 std::shared_ptr<Buffers::AudioBuffer> buffer,
232 , m_capture(
std::move(capture))
233 , m_tag(m_capture.get_tag())
Audio file loading and container management API.
static MayaFlux::Nodes::ProcessingToken token
BufferCapture & for_cycles(uint32_t count)
Set the number of times to execute this capture operation.
CaptureMode
Defines the data capture and retention strategy.
@ TRANSIENT
Single cycle capture (default) - data expires after 1 cycle.
@ ACCUMULATE
Accumulate over multiple cycles in container.
Flexible data capture interface for buffer-based processing pipelines.
std::function< bool(uint32_t)> m_condition
std::vector< std::shared_ptr< Buffers::AudioBuffer > > m_source_buffers
static BufferOperation modify_buffer(std::shared_ptr< Buffers::AudioBuffer > buffer, Buffers::BufferProcessingFunction modifier)
Create a modify operation for direct buffer manipulation.
ExecutionPhase m_execution_phase
std::shared_ptr< Buffers::AudioBuffer > m_target_buffer
static BufferOperation capture_file(const std::string &filepath, uint32_t channel=0, uint32_t cycle_count=0)
Create a file capture operation that reads from file and stores in stream.
static CaptureBuilder capture_input_from(const std::shared_ptr< Buffers::BufferManager > &buffer_manager, uint32_t input_channel)
Create CaptureBuilder for input channel with fluent configuration.
std::vector< std::shared_ptr< Kakshya::DynamicSoundStream > > m_source_containers
static BufferOperation when(std::function< bool(uint32_t)> condition)
Create a conditional operation for pipeline branching.
Buffers::BufferProcessingFunction m_buffer_modifier
BufferOperation & for_cycles(uint32_t count)
BufferOperation(OpType type, BufferCapture capture)
BufferOperation & as_process_phase()
Hint that this operation should execute in process phase.
static bool is_capture_phase_operation(const BufferOperation &op)
std::shared_ptr< Kakshya::DynamicSoundStream > m_target_container
static BufferOperation capture(BufferCapture capture)
Create a capture operation using BufferCapture configuration.
BufferOperation & with_tag(const std::string &tag)
Assign identification tag.
static BufferOperation load_from_container(std::shared_ptr< Kakshya::DynamicSoundStream > source, std::shared_ptr< Buffers::AudioBuffer > target, uint64_t start_frame=0, uint32_t length=0)
Create a load operation from container to buffer.
BufferOperation & every_n_cycles(uint32_t n)
Set cycle interval for periodic execution.
static BufferOperation fuse_containers(std::vector< std::shared_ptr< Kakshya::DynamicSoundStream > > sources, TransformVectorFunction fusion_func, std::shared_ptr< Kakshya::DynamicSoundStream > target)
Create a fusion operation for multiple DynamicSoundStream sources.
static BufferOperation dispatch_to(OperationFunction handler)
Create a dispatch operation for external processing.
bool is_streaming() const
Check if this operation is a streaming operation.
static BufferOperation route_to_buffer(std::shared_ptr< Buffers::AudioBuffer > target)
Create a routing operation to AudioBuffer destination.
TransformVectorFunction m_fusion_function
BufferOperation & with_priority(uint8_t priority)
Set execution priority for scheduler ordering.
static CaptureBuilder capture_from(std::shared_ptr< Buffers::AudioBuffer > buffer)
Create a CaptureBuilder for fluent capture configuration.
BufferOperation & on_token(Buffers::ProcessingToken token)
Set processing token for execution context.
OpType get_type() const
Getters for internal state (read-only)
Buffers::ProcessingToken m_token
static BufferOperation capture_input(const std::shared_ptr< Buffers::BufferManager > &buffer_manager, uint32_t input_channel, BufferCapture::CaptureMode mode=BufferCapture::CaptureMode::ACCUMULATE, uint32_t cycle_count=0)
Create capture operation from input channel using convenience API.
uint32_t m_cycle_interval
static BufferOperation route_to_container(std::shared_ptr< Kakshya::DynamicSoundStream > target)
Create a routing operation to DynamicSoundStream destination.
static BufferOperation file_to_stream(const std::string &filepath, std::shared_ptr< Kakshya::DynamicSoundStream > target_stream, uint32_t cycle_count=0)
Create operation to route file data to DynamicSoundStream.
uint32_t m_modify_cycle_count
std::shared_ptr< Kakshya::DynamicSoundStream > m_source_container
TransformationFunction m_transformer
BufferOperation & as_streaming()
Mark this operation as streaming (executes continuously) Useful for modify_buffer and similar statefu...
OperationFunction m_dispatch_handler
OpType
Defines the fundamental operation types in the processing pipeline.
@ BRANCH
Branch to sub-pipeline based on conditions.
@ SYNC
Synchronize with timing/cycles for coordination.
@ LOAD
Load data from container to buffer with position control.
@ CONDITION
Conditional operation for branching logic.
@ FUSE
Fuse multiple sources using custom fusion functions.
@ ROUTE
Route data to destination (buffer or container)
@ CAPTURE
Capture data from source buffer using BufferCapture strategy.
@ MODIFY
Modify Buffer Data using custom quick process.
@ DISPATCH
Dispatch to external handler for custom processing.
@ TRANSFORM
Apply transformation function to data variants.
static BufferOperation fuse_data(std::vector< std::shared_ptr< Buffers::AudioBuffer > > sources, TransformVectorFunction fusion_func, std::shared_ptr< Buffers::AudioBuffer > target)
Create a fusion operation for multiple AudioBuffer sources.
static BufferOperation transform(TransformationFunction transformer)
Create a transform operation with custom transformation function.
static CaptureBuilder capture_file_from(const std::string &filepath, uint32_t channel=0)
Create CaptureBuilder for file with fluent configuration.
static bool is_process_phase_operation(const BufferOperation &op)
ExecutionPhase get_execution_phase() const
Get the execution phase hint for this operation.
Fundamental unit of operation in buffer processing pipelines.
CaptureBuilder & on_capture_processing()
Set processing control to ON_CAPTURE mode.
Fluent builder interface for constructing BufferCapture configurations.
ProcessingToken
Bitfield enum defining processing characteristics and backend requirements for buffer operations.
@ AUDIO_BACKEND
Standard audio processing backend configuration.
std::variant< AudioProcessingFunction, GraphicsProcessingFunction > BufferProcessingFunction
@ AsyncIO
Async I/O operations ( network, streaming)
@ Kriya
Automatable tasks and fluent scheduling api for Nodes and Buffers.
std::function< Kakshya::DataVariant(std::vector< Kakshya::DataVariant > &, uint32_t)> TransformVectorFunction
std::function< Kakshya::DataVariant(Kakshya::DataVariant &, uint32_t)> TransformationFunction
std::function< void(Kakshya::DataVariant &, uint32_t)> OperationFunction
std::shared_ptr< MayaFlux::Kakshya::SoundFileContainer > load_audio_file(const std::string &filepath)
Loads an audio file into a SoundFileContainer with automatic format detection.