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