11 : m_frames_per_block(frames_per_block)
17 auto stream = std::dynamic_pointer_cast<DynamicSoundStream>(container);
20 "CursorAccessProcessor requires a DynamicSoundStream");
34 auto stream = std::dynamic_pointer_cast<DynamicSoundStream>(container);
37 "CursorAccessProcessor requires a DynamicSoundStream, slot index can potentially leak");
50 auto stream = std::dynamic_pointer_cast<DynamicSoundStream>(container);
53 "CursorAccessProcessor requires a DynamicSoundStream");
66 pd.resize(num_channels);
80 std::vector<uint64_t> { frame, 0 },
84 auto region_data = container->get_region_data(region);
88 if (!region_data.empty())
91 const uint64_t ch_count = std::min(
92 static_cast<uint64_t
>(region_data.size()),
95 for (
size_t c = 0; c < ch_count; ++c)
100 const auto int_advance =
static_cast<uint64_t
>(raw_advance);
103 const uint64_t next = frame + int_advance;
#define MF_ERROR(comp, ctx,...)
#define MF_RT_ERROR(comp, ctx,...)
void process(const std::shared_ptr< SignalSourceContainer > &container) override
Extract one block of frames into container processed_data[0].
std::vector< uint64_t > m_cursor
CursorAccessProcessor(uint64_t frames_per_block)
Construct with a fixed output block size.
void on_detach(const std::shared_ptr< SignalSourceContainer > &container) override
Called when this processor is detached from a container.
void set_loop_count(size_t n)
Set the number of loops to play before stopping.
void stop()
Deactivate without resetting the cursor position.
void set_frames_per_block(uint64_t frames_per_block)
Set the output block size in frames.
void set_speed(double speed)
Set the playback speed relative to nominal rate.
void reset()
Reset cursor to loop start and activate the processor.
std::function< void()> m_on_end
ContainerDataStructure m_structure
uint64_t m_frames_per_block
void set_loop_region(uint64_t start_frame, uint64_t end_frame)
Set the loop region in frames.
uint64_t loop_end() const
std::atomic< bool > m_is_processing
void on_attach(const std::shared_ptr< SignalSourceContainer > &container) override
Called when this processor is attached to a container.
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.
@ INTERLEAVED
Single DataVariant with interleaved data (LRLRLR for stereo)
void safe_copy_data_variant(const DataVariant &input, DataVariant &output)
Safely copy data from a DataVariant to another DataVariant, handling type conversion.
static uint64_t get_channel_count(const std::vector< DataDimension > &dimensions)
Extract channel count from dimensions.
OrganizationStrategy organization
static uint64_t get_samples_count_per_channel(const std::vector< DataDimension > &dimensions)
Get samples per channel (time dimension only).
Represents a point or span in N-dimensional space.