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

◆ prepare_audio_buffers()

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

Constructs and initializes per-channel SoundContainerBuffers without registering them.

Parameters
containerSource container.
Returns
One buffer per channel, unregistered, ready for manual routing.

Definition at line 114 of file Depot.cpp.

116{
117 if (!container) {
118 MF_ERROR(Journal::Component::API, Journal::Context::Runtime,
119 "prepare_audio_buffers failed: null container");
120 return {};
121 }
122
123 uint32_t num_channels = container->get_num_channels();
124 std::vector<std::shared_ptr<Buffers::SoundContainerBuffer>> created_buffers;
125
126 for (uint32_t ch = 0; ch < num_channels; ++ch) {
127 auto buf = std::make_shared<Buffers::SoundContainerBuffer>(
128 ch, Config::get_buffer_size(), container, ch);
129 buf->initialize();
130 created_buffers.push_back(std::move(buf));
131 }
132
133 return created_buffers;
134}
#define MF_ERROR(comp, ctx,...)

References MayaFlux::Journal::API, MayaFlux::Config::get_buffer_size(), MF_ERROR, and MayaFlux::Journal::Runtime.

+ Here is the call graph for this function: