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 86 of file Depot.cpp.

88{
89 if (!container) {
90 MF_ERROR(Journal::Component::API, Journal::Context::Runtime,
91 "prepare_audio_buffers failed: null container");
92 return {};
93 }
94
95 uint32_t num_channels = container->get_num_channels();
96 std::vector<std::shared_ptr<Buffers::SoundContainerBuffer>> created_buffers;
97
98 for (uint32_t ch = 0; ch < num_channels; ++ch) {
99 auto buf = std::make_shared<Buffers::SoundContainerBuffer>(
100 ch, Config::get_buffer_size(), container, ch);
101 buf->initialize();
102 created_buffers.push_back(std::move(buf));
103 }
104
105 return created_buffers;
106}
#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: