MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
Graph.hpp
Go to the documentation of this file.
1#pragma once
2
5
6namespace MayaFlux {
7
8namespace Nodes {
9 class Node;
10 class NodeGraphManager;
11 class RootNode;
12 class NodeNetwork;
13}
14
15namespace Buffers {
16 class Buffer;
17 class AudioBuffer;
18 class VKBuffer;
19 class RootAudioBuffer;
20 class BufferManager;
21 class BufferProcessor;
22 class BufferProcessingChain;
23}
24
25//-------------------------------------------------------------------------
26// Node Graph Management
27//-------------------------------------------------------------------------
28
29/**
30 * @brief Gets the node graph manager from the default engine
31 * @return Shared pointer to the centrally managed NodeGraphManager
32 *
33 * Returns the node graph manager that's managed by the default engine instance.
34 * All node operations using the convenience functions will use this manager.
35 */
36MAYAFLUX_API std::shared_ptr<Nodes::NodeGraphManager> get_node_graph_manager();
37
38/**
39 * @brief Adds a node to the root node of a specific channel
40 * @param node Node to add
41 * @param channel Channel index
42 *
43 * Adds the node as a child of the root node for the specified channel.
44 * Uses the default engine's node graph manager.
45 */
46MAYAFLUX_API void register_audio_node(const std::shared_ptr<Nodes::Node>& node, uint32_t channel = 0);
47
48/**
49 * @brief Adds a node to the root node of specified channels
50 * @param node Node to add
51 * @param channels Vector of channel indices
52 *
53 * Adds the node as a child of the root node for the specified channels.
54 * Uses the default engine's node graph manager.
55 */
56MAYAFLUX_API void register_audio_node(const std::shared_ptr<Nodes::Node>& node, const std::vector<uint32_t>& channels);
57
58MAYAFLUX_API void register_node(
59 const std::shared_ptr<Nodes::Node>& node,
61 uint32_t channel = 0);
62
63/**
64 * @brief Removes a node from the root node of a specific channel
65 * @param node Node to remove
66 * @param channel Channel index
67 *
68 * Removes the node from being a child of the root node for the specified channel.
69 * Uses the default engine's node graph manager.
70 */
71MAYAFLUX_API void unregister_audio_node(const std::shared_ptr<Nodes::Node>& node, uint32_t channel = 0);
72
73/**
74 * @brief Removes a node from the root node of specified channels
75 * @param node Node to remove
76 * @param channels Vector of channel indices
77 *
78 * Removes the node from being a child of the root node for the specified channels.
79 * Uses the default engine's node graph manager.
80 */
81MAYAFLUX_API void unregister_node(
82 const std::shared_ptr<Nodes::Node>& node,
84 uint32_t channel = 0);
85
86/**
87 * @brief Removes a node from the root node from list of channels
88 * @param node Node to remove
89 * @param channels Channel indices
90 *
91 * Removes the node from being a child of the root node for the list of channels
92 * Uses the default engine's node graph manager.
93 */
94MAYAFLUX_API void unregister_audio_node(const std::shared_ptr<Nodes::Node>& node, const std::vector<uint32_t>& channels);
95
96/**
97 * @brief Gets the root node for a specific channel
98 * @param channel Channel index
99 * @return The root node for the specified channel
100 *
101 * The root node is the top-level node in the processing hierarchy for a channel.
102 * Uses the default engine's node graph manager.
103 */
104MAYAFLUX_API Nodes::RootNode& get_audio_channel_root(uint32_t channel = 0);
105
106template <typename NodeType, typename... Args>
107 requires std::derived_from<NodeType, Nodes::Node>
108auto create_node(Args&&... args) -> std::shared_ptr<NodeType>
109{
110 auto node = std::make_shared<NodeType>(std::forward<Args>(args)...);
112 return node;
113}
114
115//-------------------------------------------------------------------------
116// Node Network Management
117//-------------------------------------------------------------------------
118
119/**
120 * @brief Registers a node network with the default engine's node graph manager
121 * @param network NodeNetwork to register
122 *
123 * Adds the node network to the default engine's node graph manager.
124 * The network can then be used to manage nodes and their connections.
125 */
126MAYAFLUX_API void register_node_network(const std::shared_ptr<Nodes::NodeNetwork>& network, const Nodes::ProcessingToken& token = Nodes::ProcessingToken::AUDIO_RATE);
127
128/**
129 * @brief Unregisters a node network from the default engine's node graph manager
130 * @param network NodeNetwork to unregister
131 *
132 * Removes the node network from the default engine's node graph manager.
133 * The network will no longer be available for managing nodes and their connections.
134 */
135MAYAFLUX_API void unregister_node_network(const std::shared_ptr<Nodes::NodeNetwork>& network, const Nodes::ProcessingToken& token = Nodes::ProcessingToken::AUDIO_RATE);
136
137/**
138 * @brief Creates a new node network
139 * @return Shared pointer to the created NodeNetwork
140 *
141 * This function creates a new node network that can be used to manage
142 * complex node graphs with multiple channels and processing domains.
143 */
144
145template <typename NodeNetworkType, typename... Args>
146 requires std::derived_from<NodeNetworkType, Nodes::NodeNetwork>
147auto create_node_network(Args&&... args) -> std::shared_ptr<NodeNetworkType>
148{
149 auto network = std::make_shared<NodeNetworkType>(std::forward<Args>(args)...);
150 register_node_network(network);
151 return network;
152}
153
154//-------------------------------------------------------------------------
155// Buffer Management
156//-------------------------------------------------------------------------
157
158/**
159 * @brief Gets the buffer manager from the default engine
160 * @return Shared pointer to the centrally managed BufferManager
161 *
162 * Returns the buffer manager that's managed by the default engine instance.
163 * All buffer operations using the convenience functions will use this manager.
164 */
165MAYAFLUX_API std::shared_ptr<Buffers::BufferManager> get_buffer_manager();
166
167/**
168 * @brief Adds a processor to a specific buffer
169 * @param processor Processor to add
170 * @param buffer Buffer to add the processor to
171 *
172 * Adds the processor to the specified buffer's processing chain.
173 * Uses the default engine's buffer manager.
174 */
175MAYAFLUX_API void add_processor(const std::shared_ptr<Buffers::BufferProcessor>& processor, const std::shared_ptr<Buffers::Buffer>& buffer, Buffers::ProcessingToken token = Buffers::ProcessingToken::AUDIO_BACKEND);
176
177/**
178 * @brief Adds a processor to all buffers in a specific channel
179 * @param processor Processor to add
180 * @param token Processing domain
181 * @param channel Channel index
182 *
183 * Adds the processor to all buffers associated with the specified channel
184 * in the given processing domain.
185 * Uses the default engine's buffer manager.
186 */
187MAYAFLUX_API void add_processor(const std::shared_ptr<Buffers::BufferProcessor>& processor, Buffers::ProcessingToken token, uint32_t channel);
188
189/**
190 * @brief Adds a processor to all buffers in a processing domain
191 * @param processor Processor to add
192 * @param token Processing domain
193 *
194 * Adds the processor to all buffers associated with the given processing domain.
195 * Uses the default engine's buffer manager.
196 */
197MAYAFLUX_API void add_processor(const std::shared_ptr<Buffers::BufferProcessor>& processor, Buffers::ProcessingToken token = Buffers::ProcessingToken::AUDIO_BACKEND);
198
199/**
200 * @brief Registers an AudioBuffer with the default engine's buffer manager
201 * @param buffer AudioBuffer to register
202 * @param channel Channel index to associate with the buffer (default: 0)
203 *
204 * Adds the buffer to the default engine's buffer management system, enabling
205 * it to participate in the audio processing pipeline. The buffer will be
206 * processed during each audio cycle according to its configuration.
207 * Multiple buffers can be registered to the same channel for layered processing.
208 */
209MAYAFLUX_API void register_audio_buffer(const std::shared_ptr<Buffers::AudioBuffer>& buffer, uint32_t channel = 0);
210
211/**
212 * @brief Unregisters an AudioBuffer from the default engine's buffer manager
213 * @param buffer AudioBuffer to unregister
214 * @param channel Channel index the buffer was associated with (default: 0)
215 *
216 * Removes the buffer from the default engine's buffer management system.
217 * The buffer will no longer participate in audio processing cycles.
218 * This is essential for clean shutdown and preventing processing of
219 * destroyed or invalid buffers.
220 */
221MAYAFLUX_API void unregister_audio_buffer(const std::shared_ptr<Buffers::AudioBuffer>& buffer, uint32_t channel = 0);
222
223/**
224 * @brief creates a new buffer of the specified type and registers it
225 * @tparam BufferType Type of buffer to create (must be derived from AudioBuffer)
226 * @tparam Args Constructor argument types
227 * @param channel Channel index to create the buffer for
228 * @param buffer_size Size of the buffer in processing units
229 */
230template <typename BufferType, typename... Args>
231 requires std::derived_from<BufferType, Buffers::AudioBuffer>
232auto create_buffer(uint32_t channel, uint32_t buffer_size, Args&&... args) -> std::shared_ptr<BufferType>
233{
234 auto buffer = std::make_shared<BufferType>(channel, buffer_size, std::forward<Args>(args)...);
235 register_audio_buffer(buffer, channel);
236 return buffer;
237}
238
239/**
240 * @brief Registers a VKBuffer with the default engine's buffer manager
241 * @param buffer VKBuffer to register
242 *
243 * Adds the buffer to the default engine's buffer management system, enabling
244 * it to participate in the graphics processing pipeline.
245 */
246MAYAFLUX_API void register_graphics_buffer(const std::shared_ptr<Buffers::VKBuffer>& buffer, Buffers::ProcessingToken token = Buffers::ProcessingToken::GRAPHICS_BACKEND);
247
248/**
249 * @brief Unregisters a VKBuffer from the default engine's buffer manager
250 * @param buffer VKBuffer to unregister
251 *
252 * Removes the buffer from the default engine's buffer management system.
253 * The buffer will no longer participate in graphics processing cycles.
254 */
255MAYAFLUX_API void unregister_graphics_buffer(const std::shared_ptr<Buffers::VKBuffer>& buffer);
256
257/**
258 * @brief creates a new graphics buffer of the specified type and registers it
259 * @tparam BufferType Type of buffer to create (must be derived from VKBuffer)
260 * @tparam Args Constructor argument types
261 * @param args Constructor arguments for the buffer
262 * @return Shared pointer to the created buffer
263 */
264template <typename BufferType, typename... Args>
265 requires std::derived_from<BufferType, Buffers::VKBuffer>
266auto create_buffer(Args&&... args) -> std::shared_ptr<BufferType>
267{
268 auto buffer = std::make_shared<BufferType>(std::forward<Args>(args)...);
270 return buffer;
271}
272
273/**
274 * @brief Creates a new processor and adds it to a buffer
275 * @tparam ProcessorType Type of processor to create (must be derived from BufferProcessor)
276 * @tparam Args Constructor argument types
277 * @param buffer Buffer to add the processor to
278 * @param args Constructor arguments for the processor
279 * @return Shared pointer to the created processor
280 *
281 * This function creates a new processor of the specified type, initializes it with the provided arguments,
282 * and adds it to the specified buffer's processing chain.
283 */
284template <typename ProcessorType, typename... Args>
285 requires std::derived_from<ProcessorType, Buffers::BufferProcessor>
286auto create_processor(const std::shared_ptr<Buffers::AudioBuffer> buffer, Args&&... args) -> std::shared_ptr<ProcessorType>
287{
288 auto processor = std::make_shared<ProcessorType>(std::forward<Args>(args)...);
289 add_processor(processor, buffer);
290 return processor;
291}
292
293template <typename ProcessorType, typename... Args>
294 requires std::derived_from<ProcessorType, Buffers::BufferProcessor>
295auto create_processor(const std::shared_ptr<Buffers::VKBuffer> buffer, Args&&... args) -> std::shared_ptr<ProcessorType>
296{
297 auto processor = std::make_shared<ProcessorType>(std::forward<Args>(args)...);
298 add_processor(processor, buffer);
299 return processor;
300}
301
302/**
303 * @brief Creates a new processing chain for the default engine
304 * @return Shared pointer to the created BufferProcessingChain
305 *
306 * This function creates a new processing chain that can be used to manage
307 * audio processing for buffers. The chain can be customized with various
308 * processors and is managed by the default engine's buffer manager.
309 */
310MAYAFLUX_API std::shared_ptr<Buffers::BufferProcessingChain> create_processing_chain();
311
312/**
313 * @brief Gets the audio buffer for a specific channel
314 * @param channel Channel index
315 * @return Reference to the channel's AudioBuffer
316 *
317 * Returns the buffer from the default engine's buffer manager.
318 */
319MAYAFLUX_API Buffers::RootAudioBuffer& get_root_audio_buffer(uint32_t channel);
320
321/**
322 * @brief Connects a node to a specific output channel
323 * @param node Node to connect
324 * @param channel_index Channel index to connect to
325 * @param mix Mix level (0.0 to 1.0) for blending node output with existing channel content
326 * @param clear_before Whether to clear the channel buffer before adding node output
327 *
328 * Uses the default engine's buffer manager and node graph manager.
329 */
330MAYAFLUX_API void connect_node_to_channel(const std::shared_ptr<Nodes::Node>& node, uint32_t channel_index = 0, float mix = 0.5F, bool clear_before = false);
331
332/**
333 * @brief Connects a node to a specific buffer
334 * @param node Node to connect
335 * @param buffer Buffer to connect to
336 * @param mix Mix level (0.0 to 1.0) for blending node output with existing buffer content
337 * @param clear_before Whether to clear the buffer before adding node output
338 *
339 * Uses the default engine's node graph manager.
340 */
341MAYAFLUX_API void connect_node_to_buffer(const std::shared_ptr<Nodes::Node>& node, const std::shared_ptr<Buffers::AudioBuffer>& buffer, float mix = 0.5F, bool clear_before = true);
342
343//-------------------------------------------------------------------------
344// Audio Processing
345//-------------------------------------------------------------------------
346
347/**
348 * @brief Attaches a processing function to a specific buffer
349 * @param processor Function to process the buffer
350 * @param buffer Buffer to process
351 *
352 * The processor will be called during the default engine's audio processing cycle.
353 */
354MAYAFLUX_API std::shared_ptr<Buffers::BufferProcessor> attach_quick_process(Buffers::BufferProcessingFunction processor, const std::shared_ptr<Buffers::AudioBuffer>& buffer);
355
356/**
357 * @brief Attaches a processing function to a specific channel
358 * @param processor Function to process the buffer
359 * @param channel_id Channel index to process
360 *
361 * The processor will be called during the default engine's audio processing cycle
362 * and will operate on the specified output channel buffer.
363 */
364MAYAFLUX_API std::shared_ptr<Buffers::BufferProcessor> attach_quick_process(Buffers::BufferProcessingFunction processor, unsigned int channel_id = 0);
365
366/**
367 * @brief Reads audio data from the default input source into a buffer
368 * @param buffer Buffer to read audio data into
369 * @param channel Channel index to read from (default: 0)
370 *
371 * Reads audio data from the default input source (e.g., microphone)
372 * and fills the provided AudioBuffer with the captured audio samples.
373 * This function is typically used to capture live audio input for processing.
374 */
375MAYAFLUX_API void read_from_audio_input(const std::shared_ptr<Buffers::AudioBuffer>& buffer, uint32_t channel = 0);
376
377/**
378 * @brief Stops reading audio data from the default input source
379 * @param buffer Buffer to stop reading audio data from
380 * @param channel Channel index to stop reading from (default: 0)
381 */
382MAYAFLUX_API void detach_from_audio_input(const std::shared_ptr<Buffers::AudioBuffer>& buffer, uint32_t channel = 0);
383
384/**
385 * @brief Creates a new AudioBuffer for input listening
386 * @param channel Channel index to create the buffer for (default: 0)
387 * @param add_to_output Whether to add this buffer to the output channel (default: false)
388 * @return Shared pointer to the created AudioBuffer
389 *
390 * This function creates a new AudioBuffer that can be used to listen to audio input.
391 * If `add_to_output` is true, the buffer will be automatically added to the output channel
392 * for processing.
393 */
394MAYAFLUX_API std::shared_ptr<Buffers::AudioBuffer> create_input_listener_buffer(uint32_t channel = 0, bool add_to_output = false);
395
396/**
397 * @brief Clones a buffer to multiple channels
398 * @param buffer Buffer to clone
399 * @param channels Vector of channel indices to clone to
400 *
401 * Creates independent copies of the buffer for each specified channel.
402 * Each clone maintains the same data, processors, and processing chain,
403 * but operates independently on its assigned channel.
404 * Uses the default engine's buffer manager.
405 */
406MAYAFLUX_API std::vector<std::shared_ptr<Buffers::AudioBuffer>> clone_buffer_to_channels(const std::shared_ptr<Buffers::AudioBuffer>& buffer,
407 const std::vector<uint32_t>& channels);
408
409MAYAFLUX_API std::vector<std::shared_ptr<Buffers::AudioBuffer>> clone_buffer_to_channels(
410 const std::shared_ptr<Buffers::AudioBuffer>& buffer,
411 const std::vector<uint32_t>& channels,
413/**
414 * @brief Supplies a buffer to a single channel with mixing
415 * @param buffer Source buffer to supply
416 * @param channel Target channel index
417 * @param mix Mix level (default: 1.0)
418 *
419 * Convenience wrapper for single-channel buffer supply operations.
420 */
421MAYAFLUX_API void supply_buffer_to_channel(const std::shared_ptr<Buffers::AudioBuffer>& buffer,
422 uint32_t channel,
423 double mix = 1.0);
424
425/**
426 * @brief Supplies a buffer to multiple channels with mixing
427 * @param buffer Source buffer to supply
428 * @param channels Vector of channel indices to supply to
429 * @param mix Mix level for each channel (default: 1.0)
430 *
431 * Efficiently routes a single buffer's output to multiple channels using
432 * the MixProcessor system. This is ideal for sending the same signal to
433 * multiple outputs without duplicating processing.
434 */
435MAYAFLUX_API void supply_buffer_to_channels(const std::shared_ptr<Buffers::AudioBuffer>& buffer,
436 const std::vector<uint32_t>& channels,
437 double mix = 1.0);
438
439/**
440 * @brief Removes a supplied buffer from multiple channels
441 * @param buffer Buffer to remove from supply chains
442 * @param channels channel index to remove from
443 *
444 * Efficiently removes a buffer from channel mix processor.
445 */
446MAYAFLUX_API void remove_supplied_buffer_from_channel(const std::shared_ptr<Buffers::AudioBuffer>& buffer,
447 const uint32_t channel);
448
449/**
450 * @brief Removes a supplied buffer from multiple channels
451 * @param buffer Buffer to remove from supply chains
452 * @param channels Vector of channel indices to remove from
453 *
454 * Efficiently removes a buffer from multiple channel mix processors.
455 */
456MAYAFLUX_API void remove_supplied_buffer_from_channels(const std::shared_ptr<Buffers::AudioBuffer>& buffer,
457 const std::vector<uint32_t>& channels);
458
459}
static MayaFlux::Nodes::ProcessingToken token
Definition Timers.cpp:8
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
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.
@ Buffers
Buffers, Managers, processors and processing chains.
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.
Definition Graph.cpp:117
std::shared_ptr< Buffers::AudioBuffer > create_input_listener_buffer(uint32_t channel, bool add_to_output)
Creates a new AudioBuffer for input listening.
Definition Graph.cpp:180
void register_node(const std::shared_ptr< Nodes::Node > &node, const Nodes::ProcessingToken &token, uint32_t channel)
Definition Graph.cpp:72
std::shared_ptr< Buffers::BufferProcessingChain > create_processing_chain()
Creates a new processing chain for the default engine.
Definition Graph.cpp:101
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.
Definition Graph.cpp:57
auto create_processor(const std::shared_ptr< Buffers::AudioBuffer > buffer, Args &&... args) -> std::shared_ptr< ProcessorType >
Creates a new processor and adds it to a buffer.
Definition Graph.hpp:286
void unregister_graphics_buffer(const std::shared_ptr< Buffers::VKBuffer > &buffer)
Unregisters a VKBuffer from the default engine's buffer manager.
Definition Graph.cpp:165
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.
Definition Graph.cpp:86
std::shared_ptr< Nodes::NodeGraphManager > get_node_graph_manager()
Gets the node graph manager from the default engine.
Definition Graph.cpp:18
Buffers::RootAudioBuffer & get_root_audio_buffer(uint32_t channel)
Gets the audio buffer for a specific channel.
Definition Graph.cpp:106
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.
Definition Graph.cpp:126
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.
Definition Graph.cpp:231
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.
Definition Graph.cpp:192
void unregister_audio_buffer(const std::shared_ptr< Buffers::AudioBuffer > &buffer, uint32_t channel)
Unregisters an AudioBuffer from the default engine's buffer manager.
Definition Graph.cpp:155
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.
Definition Graph.cpp:212
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.
Definition Graph.cpp:203
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 detach_from_audio_input(const std::shared_ptr< Buffers::AudioBuffer > &buffer, uint32_t channel)
Stops reading audio data from the default input source.
Definition Graph.cpp:175
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.
Definition Graph.cpp:23
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.
Definition Graph.cpp:131
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.
Definition Graph.cpp:40
auto create_node(Args &&... args) -> std::shared_ptr< NodeType >
Definition Graph.hpp:108
std::shared_ptr< Buffers::BufferManager > get_buffer_manager()
Gets the buffer manager from the default engine.
Definition Graph.cpp:81
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
auto create_buffer(uint32_t channel, uint32_t buffer_size, Args &&... args) -> std::shared_ptr< BufferType >
creates a new buffer of the specified type and registers it
Definition Graph.hpp:232
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.
Definition Graph.cpp:140
Nodes::RootNode & get_audio_channel_root(uint32_t channel)
Gets the root node for a specific channel.
Definition Graph.cpp:67
auto create_node_network(Args &&... args) -> std::shared_ptr< NodeNetworkType >
Creates a new node network.
Definition Graph.hpp:147
std::vector< double > mix(const std::vector< std::vector< double > > &streams)
Mix multiple data streams with equal weighting.
Definition Yantra.cpp:1019
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.
Definition Graph.cpp:170
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.
Definition Graph.cpp:111
void remove_supplied_buffer_from_channel(const std::shared_ptr< Buffers::AudioBuffer > &buffer, const uint32_t channel)
Removes a supplied buffer from multiple channels.
Definition Graph.cpp:221
Main namespace for the Maya Flux audio engine.
Definition LiveAid.hpp:6