MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Buffers::MixProcessor Class Reference

Processes multiple audio buffers and mixes their data into a single output buffer. More...

#include <MixProcessor.hpp>

+ Inheritance diagram for MayaFlux::Buffers::MixProcessor:
+ Collaboration diagram for MayaFlux::Buffers::MixProcessor:

Public Member Functions

bool register_source (std::shared_ptr< AudioBuffer > source, double mix_level=1.0, bool once=false)
 register an AudioBuffer source to be mixed into the output of specified channel
 
void processing_function (std::shared_ptr< Buffer > buffer) override
 the mechanism to mix output from one buffer to another channel
 
bool remove_source (std::shared_ptr< AudioBuffer > buffer)
 Removes a source buffer from the mix.
 
- Public Member Functions inherited from MayaFlux::Buffers::BufferProcessor
virtual ~BufferProcessor ()=default
 Virtual destructor for proper cleanup of derived classes.
 
void process (std::shared_ptr< Buffer > buffer)
 Applies a computational transformation to the data in the provided buffer.
 
virtual void on_attach (std::shared_ptr< Buffer >)
 Called when this processor is attached to a buffer.
 
virtual void on_detach (std::shared_ptr< Buffer >)
 Called when this processor is detached from a buffer.
 
virtual void set_processing_token (ProcessingToken token)
 Gets the preferred processing backend for this processor.
 
virtual ProcessingToken get_processing_token () const
 Gets the current processing token for this buffer.
 
virtual bool is_compatible_with (std::shared_ptr< Buffer >) const
 Checks if this processor can handle the specified buffer type.
 

Private Member Functions

void cleanup ()
 
void validate_sources ()
 

Private Attributes

std::vector< MixSourcem_sources
 

Additional Inherited Members

- Protected Attributes inherited from MayaFlux::Buffers::BufferProcessor
ProcessingToken m_processing_token { ProcessingToken::AUDIO_BACKEND }
 

Detailed Description

Processes multiple audio buffers and mixes their data into a single output buffer.

This processor allows multiple audio sources to be registered, each with its own mix level. It can handle both continuous mixing and one-time mixes based on the once flag.

This is the primary mechanism for single audio buffer to be mixed into multiple channels. Compared to Nodes, buffers are inherently single channel due to their transient nature and the architecture of MayaFlux that adds processors to buffers instead of processing buffers themselves Hence, process once and supply to multiple channels is the most efficient method to send concurrent data to multiple channels.

Definition at line 61 of file MixProcessor.hpp.


The documentation for this class was generated from the following files: