|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
BufferProcessor that drives a pool of independent StreamSlices against DynamicSoundStream instances, mixing results into the attached AudioBuffer each processing cycle. More...
#include <StreamSliceProcessor.hpp>
Inheritance diagram for MayaFlux::Buffers::StreamSliceProcessor:
Collaboration diagram for MayaFlux::Buffers::StreamSliceProcessor:Classes | |
| struct | Slot |
Public Member Functions | |
| bool | any_active () const |
| Check if any slot is active. | |
| void | bind (size_t index) |
| Activate a slot, resetting its processor cursor to region start. | |
| bool | is_compatible_with (const std::shared_ptr< Buffer > &buffer) const override |
| Checks if this processor can handle the specified buffer type. | |
| void | load (size_t index, Kakshya::StreamSlice slice) |
| Assign a StreamSlice to a slot. | |
| void | on_attach (const std::shared_ptr< Buffer > &buffer) override |
| Called when this processor is attached to a buffer. | |
| void | on_detach (const std::shared_ptr< Buffer > &buffer) override |
| Called when this processor is detached from a buffer. | |
| void | processing_function (const std::shared_ptr< Buffer > &buffer) override |
| The core processing function that must be implemented by derived classes. | |
| void | set_on_end (std::function< void(size_t)> cb) |
| Register a callback fired when a slot's one-shot playback ends. | |
| Kakshya::StreamSlice & | slice (size_t index) |
| const Kakshya::StreamSlice & | slice (size_t index) const |
| size_t | slot_count () const |
| Get the current number of slots. | |
| StreamSliceProcessor ()=default | |
| void | unbind (size_t index) |
| Deactivate a slot, stopping its processor without resetting the cursor. | |
| ~StreamSliceProcessor () override=default | |
Public Member Functions inherited from MayaFlux::Buffers::BufferProcessor | |
| virtual ProcessingToken | get_processing_token () const |
| Gets the current processing token for this buffer. | |
| void | process (const std::shared_ptr< Buffer > &buffer) |
| Applies a computational transformation to the data in the provided buffer. | |
| virtual void | set_processing_token (ProcessingToken token) |
| Gets the preferred processing backend for this processor. | |
| virtual | ~BufferProcessor ()=default |
| Virtual destructor for proper cleanup of derived classes. | |
Private Member Functions | |
| void | detach_slot (size_t index) |
Private Attributes | |
| uint32_t | m_frames_per_block {} |
| std::function< void(size_t)> | m_on_end |
| std::vector< Slot > | m_slots |
Additional Inherited Members | |
Protected Attributes inherited from MayaFlux::Buffers::BufferProcessor | |
| ProcessingToken | m_processing_token { ProcessingToken::AUDIO_BACKEND } |
BufferProcessor that drives a pool of independent StreamSlices against DynamicSoundStream instances, mixing results into the attached AudioBuffer each processing cycle.
Each slot owns a CursorAccessProcessor responsible for cursor advancement, loop wrapping, speed scaling, and dynamic slot allocation on the stream. StreamSlice acts as a region descriptor only – cursor state is internal to the per-slot processor. Multiple StreamSliceProcessor instances may reference the same DynamicSoundStream without contention; each allocates an independent dynamic slot via DynamicSoundStream::allocate_dynamic_slot().
load() must be called after attachment to a buffer. Attachment populates the frame block size used to construct the per-slot CursorAccessProcessor. Calling load() before attachment is a no-op with an error log.
Inactive slots contribute silence. Active slot outputs are accumulated into the buffer in index order with no further scaling applied here beyond what CursorAccessProcessor produces.
Definition at line 30 of file StreamSliceProcessor.hpp.