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

◆ hook_audio_container_to_buffers()

std::vector< std::shared_ptr< Buffers::SoundContainerBuffer > > MayaFlux::IO::IOManager::hook_audio_container_to_buffers ( const std::shared_ptr< Kakshya::SoundFileContainer > &  container)

Wire a SoundFileContainer to the audio buffer system.

Creates per-channel SoundContainerBuffers with AUDIO_BACKEND token, stores them keyed by container pointer, and returns them.

Parameters
containerLoaded SoundFileContainer to wire.
Returns
Per-channel SoundContainerBuffers, or empty on failure.

Definition at line 409 of file IOManager.cpp.

411{
412 if (!container) {
414 "hook_audio_container_to_buffers: null container");
415 return {};
416 }
417
418 uint32_t num_channels = container->get_num_channels();
419 std::vector<std::shared_ptr<Buffers::SoundContainerBuffer>> created_buffers;
420
421 MF_TRACE(
424 "Setting up audio playback for {} channels...",
425 num_channels);
426
427 for (uint32_t channel = 0; channel < num_channels; ++channel) {
428 auto container_buffer = m_buffer_manager->create_audio_buffer<MayaFlux::Buffers::SoundContainerBuffer>(
430 channel,
431 container,
432 channel);
433
434 container_buffer->initialize();
435
436 created_buffers.push_back(std::move(container_buffer));
437
438 MF_INFO(
441 "✓ Created buffer for channel {}",
442 channel);
443 }
444
445 m_audio_buffers[container] = created_buffers;
446
447 return created_buffers;
448}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
#define MF_TRACE(comp, ctx,...)
void initialize()
Initialize the buffer after construction.
AudioBuffer implementation backed by a StreamContainer.
std::unordered_map< std::shared_ptr< Kakshya::SoundFileContainer >, std::vector< std::shared_ptr< Buffers::SoundContainerBuffer > > > m_audio_buffers
std::shared_ptr< Buffers::BufferManager > m_buffer_manager
@ AUDIO_BACKEND
Standard audio processing backend configuration.
@ BufferManagement
Buffer Management (Buffers::BufferManager, creating buffers)
@ Runtime
General runtime operations (default fallback)
@ API
MayaFlux/API Wrapper and convenience functions.

References MayaFlux::Journal::API, MayaFlux::Buffers::AUDIO_BACKEND, MayaFlux::Journal::BufferManagement, MayaFlux::Buffers::SoundContainerBuffer::initialize(), m_audio_buffers, m_buffer_manager, MF_ERROR, MF_INFO, MF_TRACE, and MayaFlux::Journal::Runtime.

+ Here is the call graph for this function: