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

◆ register_buffer()

MAYAFLUX_API void MayaFlux::register_buffer ( const std::shared_ptr< Buffers::Buffer > &  buffer,
const CreationContext ctx 
)

Definition at line 65 of file Creator.cpp.

66{
67 auto token = get_buffer_token(ctx.domain.value());
68
69 if (auto audio_buffer = std::dynamic_pointer_cast<Buffers::AudioBuffer>(buffer)) {
70 if (ctx.channel.has_value()) {
71 register_audio_buffer(audio_buffer, ctx.channel.value());
72 } else if (ctx.channels.has_value()) {
73 clone_buffer_to_channels(audio_buffer, ctx.channels.value(), token);
74 }
75 return;
76 }
77
78 if (auto vk_buffer = std::dynamic_pointer_cast<Buffers::VKBuffer>(buffer)) {
80 return;
81 }
82}
static MayaFlux::Nodes::ProcessingToken token
Definition Timers.cpp:8
void register_audio_buffer(const std::shared_ptr< Buffers::AudioBuffer > &buffer, uint32_t channel)
Registers an AudioBuffer with the default engine's buffer manager.
Definition Graph.cpp:150
void register_graphics_buffer(const std::shared_ptr< Buffers::VKBuffer > &buffer, Buffers::ProcessingToken token)
Registers a VKBuffer with the default engine's buffer manager.
Definition Graph.cpp:160
MAYAFLUX_API Buffers::ProcessingToken get_buffer_token(Domain domain)
Extracts buffer processing token from domain.
Definition Domain.hpp:184
std::optional< uint32_t > channel
Definition Creator.hpp:10
std::optional< std::vector< uint32_t > > channels
Definition Creator.hpp:11
std::optional< Domain > domain
Definition Creator.hpp:9

References MayaFlux::CreationContext::channel, MayaFlux::CreationContext::channels, clone_buffer_to_channels(), MayaFlux::CreationContext::domain, get_buffer_token(), register_audio_buffer(), register_graphics_buffer(), and token.

Referenced by MayaFlux::CreationHandle< T >::apply_buffer_context(), and operator|().

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