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

◆ terminate_active_buffers()

void MayaFlux::Buffers::BufferAccessControl::terminate_active_buffers ( )

Terminates all active Audio and VK buffers.

Definition at line 347 of file BufferAccessControl.cpp.

348{
349 for (const auto& token : m_unit_manager.get_active_audio_tokens()) {
351 for (uint32_t channel = 0; channel < unit.channel_count; ++channel) {
352 auto root_buffer = unit.get_buffer(channel);
353 root_buffer->clear();
354 for (auto& child : root_buffer->get_child_buffers()) {
355 if (child)
356 child->clear();
357 }
358 unit.root_buffers[channel].reset();
359 }
360 }
361
362 for (const auto& token : m_unit_manager.get_active_graphics_tokens()) {
364 auto root_buffer = unit.get_buffer();
365 root_buffer->clear();
366 for (auto& child : root_buffer->get_child_buffers()) {
367 if (child) {
369 child->clear();
370 }
371 }
372 unit.root_buffer.reset();
373 }
374}
static MayaFlux::Nodes::ProcessingToken token
Definition Timers.cpp:8
TokenUnitManager & m_unit_manager
Reference to the token/unit manager for storage operations.
void remove_graphics_buffer(const std::shared_ptr< Buffer > &buffer, ProcessingToken token)
Removes a graphics buffer from a token.
RootGraphicsUnit & get_graphics_unit_mutable(ProcessingToken token)
Gets an existing graphics unit without creating if missing (mutable)
RootAudioUnit & get_audio_unit_mutable(ProcessingToken token)
Gets an existing audio unit without creating if missing (mutable)
std::shared_ptr< RootAudioBuffer > get_buffer(uint32_t channel) const
std::shared_ptr< RootGraphicsBuffer > get_buffer() const

References MayaFlux::Buffers::TokenUnitManager::get_active_audio_tokens(), MayaFlux::Buffers::TokenUnitManager::get_active_graphics_tokens(), MayaFlux::Buffers::TokenUnitManager::get_audio_unit_mutable(), MayaFlux::Buffers::RootGraphicsUnit::get_buffer(), MayaFlux::Buffers::RootAudioUnit::get_buffer(), MayaFlux::Buffers::TokenUnitManager::get_graphics_unit_mutable(), m_unit_manager, remove_graphics_buffer(), and token.

+ Here is the call graph for this function: