MayaFlux 0.4.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 540 of file IOManager.cpp.

542{
543 if (!container) {
545 "hook_audio_container_to_buffers: null container");
546 return {};
547 }
548
549 uint32_t num_channels = container->get_num_channels();
550 std::vector<std::shared_ptr<Buffers::SoundContainerBuffer>> created_buffers;
551
552 MF_TRACE(
555 "Setting up audio playback for {} channels...",
556 num_channels);
557
558 for (uint32_t channel = 0; channel < num_channels; ++channel) {
559 auto container_buffer = m_buffer_manager->create_audio_buffer<MayaFlux::Buffers::SoundContainerBuffer>(
561 channel,
562 container,
563 channel);
564
565 container_buffer->initialize();
566
567 created_buffers.push_back(std::move(container_buffer));
568
569 MF_INFO(
572 "✓ Created buffer for channel {}",
573 channel);
574 }
575
576 m_audio_buffers[container] = created_buffers;
577
578 return created_buffers;
579}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
#define MF_TRACE(comp, ctx,...)
uint32_t channel
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, channel, 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: