MayaFlux 0.4.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 17 of file Depot.cpp.

18{
19 if (!container) {
20 MF_ERROR(Journal::Component::API, Journal::Context::Runtime,
21 "prepare_audio_buffers failed: null container");
22 return {};
23 }
24
25 uint32_t num_channels = container->get_num_channels();
26 std::vector<std::shared_ptr<Buffers::SoundContainerBuffer>> created_buffers;
27
28 for (uint32_t channel = 0; channel < num_channels; ++channel) {
29 auto container_buffer = std::make_shared<MayaFlux::Buffers::SoundContainerBuffer>(
30 channel,
31 Config::get_buffer_size(),
32 container,
33 channel);
34
35 container_buffer->initialize();
36
37 created_buffers.push_back(std::move(container_buffer));
38 }
39
40 return created_buffers;
41}
#define MF_ERROR(comp, ctx,...)
uint32_t channel

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

+ Here is the call graph for this function: