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

◆ hook_sound_container_to_buffers()

MAYAFLUX_API std::vector< std::shared_ptr< Buffers::ContainerBuffer > > MayaFlux::hook_sound_container_to_buffers ( const std::shared_ptr< MayaFlux::Kakshya::SoundFileContainer > &  container)

Connects a SoundFileContainer to the buffer system for immediate playback.

Parameters
containerSoundFileContainer to connect to buffers
Returns
Vector of shared pointers to created ContainerBuffer instances

Establishes connection between loaded audio container and engine's buffer system, enabling immediate audio playback through the standard processing pipeline. Creates ContainerBuffer instances for each channel and connects to AUDIO_BACKEND token. Multiple containers can be connected simultaneously for layered playback.

Definition at line 84 of file Depot.cpp.

85{
86 auto buffer_manager = MayaFlux::get_buffer_manager();
87 uint32_t num_channels = container->get_num_channels();
88 std::vector<std::shared_ptr<Buffers::ContainerBuffer>> created_buffers;
89
91 Journal::Component::API,
92 Journal::Context::BufferManagement,
93 "Setting up audio playback for {} channels...",
94 num_channels);
95
96 for (uint32_t channel = 0; channel < num_channels; ++channel) {
97 auto container_buffer = buffer_manager->create_audio_buffer<MayaFlux::Buffers::ContainerBuffer>(
99 channel,
100 container,
101 channel);
102
103 container_buffer->initialize();
104
105 created_buffers.push_back(std::move(container_buffer));
106
107 MF_INFO(
108 Journal::Component::API,
109 Journal::Context::BufferManagement,
110 "✓ Created buffer for channel {}",
111 channel);
112 }
113
114 return created_buffers;
115}
#define MF_INFO(comp, ctx,...)
#define MF_TRACE(comp, ctx,...)
void initialize()
Initialize the buffer after construction.
AudioBuffer implementation backed by a StreamContainer.
@ AUDIO_BACKEND
Standard audio processing backend configuration.
std::shared_ptr< Buffers::BufferManager > get_buffer_manager()
Gets the buffer manager from the default engine.
Definition Graph.cpp:81

References MayaFlux::Journal::API, MayaFlux::Buffers::AUDIO_BACKEND, MayaFlux::Journal::BufferManagement, get_buffer_manager(), MayaFlux::Buffers::ContainerBuffer::initialize(), MF_INFO, and MF_TRACE.

Referenced by register_container().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: