|
MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
|
Fluent builder interface for constructing BufferCapture configurations. More...
#include <Capture.hpp>
Collaboration diagram for MayaFlux::Kriya::CaptureBuilder:Public Member Functions | |
| CaptureBuilder (std::shared_ptr< Buffers::AudioBuffer > buffer) | |
| Construct builder with target AudioBuffer. | |
| CaptureBuilder & | for_cycles (uint32_t count) |
| Set number of cycles to capture (enables ACCUMULATE mode). | |
| CaptureBuilder & | on_capture_processing () |
| Set processing control to ON_CAPTURE mode. | |
| CaptureBuilder & | manual_processing () |
| Set processing control to MANUAL mode. | |
| CaptureBuilder & | auto_processing () |
| Set processing control to AUTOMATIC mode. | |
| CaptureBuilder & | until_condition (std::function< bool()> predicate) |
| Set stop condition (enables TRIGGERED mode). | |
| CaptureBuilder & | as_circular (uint32_t buffer_size) |
| Enable circular buffer mode with specified size. | |
| CaptureBuilder & | with_window (uint32_t window_size, float overlap_ratio=0.0F) |
| Configure windowed capture (enables WINDOWED mode). | |
| CaptureBuilder & | on_data_ready (OperationFunction callback) |
| Set data ready callback. | |
| CaptureBuilder & | on_cycle_complete (std::function< void(uint32_t)> callback) |
| Set cycle completion callback. | |
| CaptureBuilder & | on_data_expired (std::function< void(const Kakshya::DataVariant &, uint32_t)> callback) |
| Set data expiration callback. | |
| CaptureBuilder & | with_tag (const std::string &tag) |
| Assign identification tag. | |
| CaptureBuilder & | with_metadata (const std::string &key, const std::string &value) |
| Add metadata key-value pair. | |
| std::string | get_tag () |
| Get the assigned tag for this capture. | |
| operator BufferOperation () | |
| Convert to BufferOperation for pipeline integration. | |
Private Attributes | |
| BufferCapture | m_capture |
| Internal BufferCapture being configured. | |
Fluent builder interface for constructing BufferCapture configurations.
CaptureBuilder provides a fluent, chainable API for constructing BufferCapture objects with complex configurations. It follows the builder pattern to make capture setup more readable and maintainable, especially for advanced capture scenarios with multiple parameters and callbacks.
Design Philosophy: The builder pattern is used here to address the complexity of BufferCapture configuration while maintaining type safety and compile-time validation. It provides a more expressive API than constructor overloading for complex capture scenarios.
Integration: CaptureBuilder seamlessly converts to BufferOperation, allowing it to be used directly in BufferPipeline construction without explicit conversion. This maintains the fluent nature of the Kriya pipeline API.
Example Usage:
Definition at line 231 of file Capture.hpp.