27 std::out_of_range err(
"Channel index out of range for audio node registration");
28 std::cerr << err.what() <<
'\n';
33void register_audio_node(
const std::shared_ptr<Nodes::Node>& node,
const std::vector<uint32_t>& channels)
35 for (
const auto& channel : channels) {
45 "Channel index out of range for audio node registration");
52 for (
const auto& channel : channels) {
60 if (channel >= manager->get_channel_count(
token)) {
62 "Channel index out of range for audio node registration");
64 manager->remove_from_root(node,
token, channel);
103 return std::make_shared<Buffers::BufferProcessingChain>();
117void connect_node_to_buffer(
const std::shared_ptr<Nodes::Node>& node,
const std::shared_ptr<Buffers::AudioBuffer>& buffer,
float mix,
bool clear_before)
182 std::shared_ptr<Buffers::AudioBuffer> buffer = std::make_shared<Buffers::AudioBuffer>(channel);
193 const std::vector<uint32_t>& channels)
204 uint32_t channel,
double mix)
213 const std::vector<uint32_t>& channels,
216 for (
const auto& channel : channels) {
222 const uint32_t channel)
232 const std::vector<uint32_t>& channels)
234 for (
const auto& channel : channels) {
#define MF_ERROR(comp, ctx,...)
Core engine lifecycle and configuration API.
static MayaFlux::Nodes::ProcessingToken token
Top-level aggregation buffer for computational data streams.
std::shared_ptr< Nodes::NodeGraphManager > get_node_graph_manager()
Gets the node graph manager.
std::shared_ptr< Buffers::BufferManager > get_buffer_manager()
Gets the buffer manager.
Container for top-level nodes in a processing channel with multi-modal support.
ProcessingToken
Bitfield enum defining processing characteristics and backend requirements for buffer operations.
@ AUDIO_BACKEND
Standard audio processing backend configuration.
@ GRAPHICS_BACKEND
Standard graphics processing backend configuration.
std::variant< AudioProcessingFunction, GraphicsProcessingFunction > BufferProcessingFunction
@ NodeProcessing
Node graph processing (Nodes::NodeGraphManager)
@ API
MayaFlux/API Wrapper and convenience functions.
ProcessingToken
Enumerates the different processing domains for nodes.
@ AUDIO_RATE
Nodes that process at the audio sample rate.
void connect_node_to_buffer(const std::shared_ptr< Nodes::Node > &node, const std::shared_ptr< Buffers::AudioBuffer > &buffer, float mix, bool clear_before)
Connects a node to a specific buffer.
std::shared_ptr< Buffers::AudioBuffer > create_input_listener_buffer(uint32_t channel, bool add_to_output)
Creates a new AudioBuffer for input listening.
void register_node(const std::shared_ptr< Nodes::Node > &node, const Nodes::ProcessingToken &token, uint32_t channel)
std::shared_ptr< Buffers::BufferProcessingChain > create_processing_chain()
Creates a new processing chain for the default engine.
void unregister_node(const std::shared_ptr< Nodes::Node > &node, const Nodes::ProcessingToken &token, uint32_t channel)
Removes a node from the root node of specified channels.
void unregister_graphics_buffer(const std::shared_ptr< Buffers::VKBuffer > &buffer)
Unregisters a VKBuffer from the default engine's buffer manager.
void add_processor(const std::shared_ptr< Buffers::BufferProcessor > &processor, const std::shared_ptr< Buffers::Buffer > &buffer, Buffers::ProcessingToken token)
Adds a processor to a specific buffer.
std::shared_ptr< Nodes::NodeGraphManager > get_node_graph_manager()
Gets the node graph manager from the default engine.
Buffers::RootAudioBuffer & get_root_audio_buffer(uint32_t channel)
Gets the audio buffer for a specific channel.
void register_node_network(const std::shared_ptr< Nodes::NodeNetwork > &network, const Nodes::ProcessingToken &token)
Registers a node network with the default engine's node graph manager.
void remove_supplied_buffer_from_channels(const std::shared_ptr< Buffers::AudioBuffer > &buffer, const std::vector< uint32_t > &channels)
Removes a supplied buffer from multiple channels.
std::vector< std::shared_ptr< Buffers::AudioBuffer > > clone_buffer_to_channels(const std::shared_ptr< Buffers::AudioBuffer > &buffer, const std::vector< uint32_t > &channels)
Clones a buffer to multiple channels.
void unregister_audio_buffer(const std::shared_ptr< Buffers::AudioBuffer > &buffer, uint32_t channel)
Unregisters an AudioBuffer from the default engine's buffer manager.
void supply_buffer_to_channels(const std::shared_ptr< Buffers::AudioBuffer > &buffer, const std::vector< uint32_t > &channels, double mix)
Supplies a buffer to multiple channels with mixing.
void supply_buffer_to_channel(const std::shared_ptr< Buffers::AudioBuffer > &buffer, uint32_t channel, double mix)
Supplies a buffer to a single channel with mixing.
void register_audio_buffer(const std::shared_ptr< Buffers::AudioBuffer > &buffer, uint32_t channel)
Registers an AudioBuffer with the default engine's buffer manager.
void detach_from_audio_input(const std::shared_ptr< Buffers::AudioBuffer > &buffer, uint32_t channel)
Stops reading audio data from the default input source.
void register_audio_node(const std::shared_ptr< Nodes::Node > &node, uint32_t channel)
Adds a node to the root node of a specific channel.
void unregister_node_network(const std::shared_ptr< Nodes::NodeNetwork > &network, const Nodes::ProcessingToken &token)
Unregisters a node network from the default engine's node graph manager.
void unregister_audio_node(const std::shared_ptr< Nodes::Node > &node, uint32_t channel)
Removes a node from the root node of a specific channel.
std::shared_ptr< Buffers::BufferManager > get_buffer_manager()
Gets the buffer manager from the default engine.
void register_graphics_buffer(const std::shared_ptr< Buffers::VKBuffer > &buffer, Buffers::ProcessingToken token)
Registers a VKBuffer with the default engine's buffer manager.
Core::Engine & get_context()
Gets the default engine instance.
std::shared_ptr< Buffers::BufferProcessor > attach_quick_process(Buffers::BufferProcessingFunction processor, const std::shared_ptr< Buffers::AudioBuffer > &buffer)
Attaches a processing function to a specific buffer.
Nodes::RootNode & get_audio_channel_root(uint32_t channel)
Gets the root node for a specific channel.
std::vector< double > mix(const std::vector< std::vector< double > > &streams)
Mix multiple data streams with equal weighting.
void read_from_audio_input(const std::shared_ptr< Buffers::AudioBuffer > &buffer, uint32_t channel)
Reads audio data from the default input source into a buffer.
void connect_node_to_channel(const std::shared_ptr< Nodes::Node > &node, uint32_t channel_index, float mix, bool clear_before)
Connects a node to a specific output channel.
void remove_supplied_buffer_from_channel(const std::shared_ptr< Buffers::AudioBuffer > &buffer, const uint32_t channel)
Removes a supplied buffer from multiple channels.
Main namespace for the Maya Flux audio engine.