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 788 of file IOManager.cpp.

790{
791 if (!container) {
793 "hook_audio_container_to_buffers: null container");
794 return {};
795 }
796
797 uint32_t num_channels = container->get_num_channels();
798 std::vector<std::shared_ptr<Buffers::SoundContainerBuffer>> created_buffers;
799
800 MF_TRACE(
803 "Setting up audio playback for {} channels...",
804 num_channels);
805
806 for (uint32_t channel = 0; channel < num_channels; ++channel) {
807 auto container_buffer = m_buffer_manager->create_audio_buffer<MayaFlux::Buffers::SoundContainerBuffer>(
809 channel,
810 container,
811 channel);
812
813 container_buffer->initialize();
814
815 created_buffers.push_back(std::move(container_buffer));
816
817 MF_INFO(
820 "✓ Created buffer for channel {}",
821 channel);
822 }
823
824 m_audio_buffers[container] = created_buffers;
825
826 return created_buffers;
827}
#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: