MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ clone_to() [1/2]

std::shared_ptr< AudioBuffer > MayaFlux::Buffers::AudioBuffer::clone_to ( uint32_t  channel)
virtual

Creates a clone of this audio buffer for a specific channel.

Parameters
channelChannel identifier for the cloned buffer
Returns
Shared pointer to the cloned audio buffer

This method creates a new instance of the audio buffer with the same data and properties, but assigned to a different audio channel. The cloned buffer can be used independently in audio processing chains.

NOTE: The moment of cloning is the divergence point between the original and the cloned. While they both will follow the same processing chain or have the same default procesor, any changes made to one buffer after cloning will not affect the other.

Definition at line 84 of file AudioBuffer.cpp.

85{
86 auto buffer = std::make_shared<AudioBuffer>(channel, m_num_samples);
87 buffer->get_data() = m_data;
88 buffer->set_default_processor(m_default_processor);
89 buffer->set_processing_chain(get_processing_chain(), true);
90
91 return buffer;
92}
uint32_t m_num_samples
Capacity of the buffer in audio samples.
std::shared_ptr< BufferProcessor > m_default_processor
Default audio transformation processor for this buffer.
std::vector< double > m_data
Vector storing the actual double-precision audio sample data.
virtual std::shared_ptr< BufferProcessingChain > get_processing_chain() override
Gets the audio transformation chain attached to this buffer.

References get_processing_chain(), m_data, m_default_processor, and m_num_samples.

Referenced by clone_to().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: