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

◆ remove_supplied_audio_buffer()

bool MayaFlux::Buffers::BufferSupplyMixing::remove_supplied_audio_buffer ( const std::shared_ptr< AudioBuffer > &  buffer,
ProcessingToken  token,
uint32_t  channel 
)

Removes a previously supplied buffer from a token and channel.

Parameters
bufferBuffer to remove
tokenProcessing domain
channelChannel index
Returns
True if the buffer was successfully removed, false otherwise

Cleans up the mixing relationship between the supplied buffer and the target channel.

Definition at line 63 of file BufferSupplyMixing.cpp.

67{
68 if (!buffer) {
70 "BufferSupplyMixing: Invalid buffer for removal");
71 return false;
72 }
73
76 "BufferSupplyMixing: Token/channel combination out of range for removal (token: {}, channel: {})",
77 static_cast<int>(token), channel);
78 return false;
79 }
80
82 auto root_buffer = unit.get_buffer(channel);
83 auto processing_chain = unit.get_chain(channel);
84
85 if (std::shared_ptr<MixProcessor> mix_processor = processing_chain->get_processor<MixProcessor>(root_buffer)) {
86 return mix_processor->remove_source(buffer);
87 }
88 return false;
89}
#define MF_ERROR(comp, ctx,...)
static MayaFlux::Nodes::ProcessingToken token
Definition Timers.cpp:8
TokenUnitManager & m_unit_manager
Reference to the token/unit manager.
uint32_t get_audio_channel_count(ProcessingToken token) const
Gets the number of channels in an audio unit.
bool has_audio_unit(ProcessingToken token) const
Checks if an audio unit exists for the given token.
RootAudioUnit & get_audio_unit_mutable(ProcessingToken token)
Gets an existing audio unit without creating if missing (mutable)
@ BufferManagement
Buffer Management (Buffers::BufferManager, creating buffers)
@ Core
Core engine, backend, subsystems.
std::shared_ptr< RootAudioBuffer > get_buffer(uint32_t channel) const

References MayaFlux::Journal::BufferManagement, MayaFlux::Journal::Core, MayaFlux::Buffers::TokenUnitManager::get_audio_channel_count(), MayaFlux::Buffers::TokenUnitManager::get_audio_unit_mutable(), MayaFlux::Buffers::RootAudioUnit::get_buffer(), MayaFlux::Buffers::TokenUnitManager::has_audio_unit(), m_unit_manager, MF_ERROR, and token.

+ Here is the call graph for this function: