MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
NodeUtils.hpp File Reference
#include "NodeSpec.hpp"
+ Include dependency graph for NodeUtils.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  MayaFlux
 Main namespace for the Maya Flux audio engine.
 
namespace  MayaFlux::Nodes
 Contains the node-based computational processing system components.
 

Typedefs

using MayaFlux::Nodes::NodeCondition = std::function< bool(NodeContext &)>
 Predicate function type for conditional callbacks.
 
using MayaFlux::Nodes::NodeHook = TypedHook<>
 Alias for TypedHook<NodeContext>.
 
template<typename ContextT = NodeContext>
using MayaFlux::Nodes::TypedHook = std::function< void(ContextT &)>
 Callback function type for node processing events, parameterised on context type.
 

Functions

void MayaFlux::Nodes::atomic_add_flag (std::atomic< NodeState > &state, NodeState flag)
 Atomically adds a flag to a node state.
 
void MayaFlux::Nodes::atomic_dec_modulator_count (std::atomic< uint32_t > &count, int amount)
 Atomically decrements the modulator count by a specified amount.
 
void MayaFlux::Nodes::atomic_inc_modulator_count (std::atomic< uint32_t > &count, int amount)
 Atomically increments the modulator count by a specified amount.
 
void MayaFlux::Nodes::atomic_remove_flag (std::atomic< NodeState > &state, NodeState flags)
 Atomically removes a flag from a node state.
 
void MayaFlux::Nodes::atomic_set_flag_strong (std::atomic< NodeState > &flag, const NodeState &desired)
 Atomically sets a node state flag to a specific value.
 
void MayaFlux::Nodes::atomic_set_flag_weak (std::atomic< NodeState > &flag, NodeState &expected, const NodeState &desired)
 Atomically sets a node state flag with weak memory ordering.
 
void MayaFlux::Nodes::atomic_set_strong (std::atomic< NodeState > &flag, NodeState &expected, const NodeState &desired)
 Atomically sets a node state flag with strong memory ordering.
 
template<typename ContextT >
bool MayaFlux::Nodes::callback_exists (const std::vector< TypedHook< ContextT > > &callbacks, const TypedHook< ContextT > &callback)
 Returns true if an equivalent callback is already present in the collection.
 
bool MayaFlux::Nodes::callback_pair_exists (const std::vector< std::pair< NodeHook, NodeCondition > > &callbacks, const NodeHook &callback, const NodeCondition &condition)
 Returns true if the exact callback+condition pair is already present.
 
bool MayaFlux::Nodes::conditional_callback_exists (const std::vector< std::pair< NodeHook, NodeCondition > > &callbacks, const NodeCondition &callback)
 Returns true if a condition function is already present in a conditional callback collection.
 
std::vector< uint32_t > MayaFlux::Nodes::get_active_channels (const std::shared_ptr< Nodes::Node > &node, uint32_t fallback_channel=0)
 Extracts active channel list from a node's channel mask.
 
std::vector< uint32_t > MayaFlux::Nodes::get_active_channels (uint32_t channel_mask, uint32_t fallback_channel=0)
 Extracts active channel list from a channel mask.
 
template<typename ContextT >
bool MayaFlux::Nodes::safe_add_callback (std::vector< TypedHook< ContextT > > &callbacks, const TypedHook< ContextT > &callback)
 Adds a callback to the collection if an equivalent one is not already present.
 
bool MayaFlux::Nodes::safe_add_conditional_callback (std::vector< std::pair< NodeHook, NodeCondition > > &callbacks, const NodeHook &callback, const NodeCondition &condition)
 Adds a conditional callback if the exact pair is not already present.
 
template<typename ContextT >
bool MayaFlux::Nodes::safe_remove_callback (std::vector< TypedHook< ContextT > > &callbacks, const TypedHook< ContextT > &callback)
 Removes all callbacks whose target_type() matches that of the supplied callback.
 
bool MayaFlux::Nodes::safe_remove_conditional_callback (std::vector< std::pair< NodeHook, NodeCondition > > &callbacks, const NodeCondition &callback)
 Removes all conditional callbacks whose condition target_type() matches.
 
void MayaFlux::Nodes::try_reset_processed_state (std::shared_ptr< Node > node)
 Attempts to reset the processed state of a node.
 
void MayaFlux::Nodes::update_routing_state (RoutingState &state)
 Updates the routing state for a node based on its current channel usage.