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

◆ adopt_modulator()

void MayaFlux::Nodes::Node::adopt_modulator ( const std::shared_ptr< Node > & modulator)

Gives a newly held modulator every channel this node is used on.

Parameters
modulatorThe node being attached, ignored when null

Call from a setter after assigning the modulator.

Definition at line 114 of file Node.cpp.

115{
116 if (!modulator)
117 return;
118
119 uint32_t direct = m_direct_channels_mask.load(std::memory_order_acquire);
120 for (uint32_t channel = 0; channel < 32; ++channel) {
121 uint32_t paths = ((direct >> channel) & 1U)
122 + m_channel_usage_counts[channel].load(std::memory_order_acquire);
123 for (uint32_t i = 0; i < paths; ++i) {
124 modulator->add_channel_usage(channel);
125 }
126 }
127}
std::atomic< uint32_t > m_direct_channels_mask
Channels registered directly through register_channel_usage.
Definition Node.hpp:792
std::array< std::atomic< uint32_t >, 32 > m_channel_usage_counts
Per channel count of consumer paths held through add_channel_usage.
Definition Node.hpp:797

References m_channel_usage_counts, and m_direct_channels_mask.

Referenced by MayaFlux::Nodes::Generator::Impulse::set_amplitude_modulator(), MayaFlux::Nodes::Generator::Phasor::set_amplitude_modulator(), MayaFlux::Nodes::Generator::Sine::set_amplitude_modulator(), MayaFlux::Nodes::Generator::Impulse::set_frequency_modulator(), MayaFlux::Nodes::Generator::Phasor::set_frequency_modulator(), MayaFlux::Nodes::Generator::Sine::set_frequency_modulator(), MayaFlux::Nodes::Filters::Filter::set_input_node(), MayaFlux::Nodes::Generator::Logic::set_input_node(), MayaFlux::Nodes::Generator::Polynomial::set_input_node(), MayaFlux::Nodes::Generator::Logic::set_input_nodes(), and MayaFlux::Nodes::Generator::Counter::set_reset_trigger().

Here is the caller graph for this function: