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

◆ release_modulator()

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

Withdraws every channel this node gave a modulator through adopt_modulator.

Parameters
modulatorThe node being detached, ignored when null

Call from a setter before replacing or clearing the modulator.

Definition at line 129 of file Node.cpp.

130{
131 if (!modulator)
132 return;
133
134 uint32_t direct = m_direct_channels_mask.load(std::memory_order_acquire);
135 for (uint32_t channel = 0; channel < 32; ++channel) {
136 uint32_t paths = ((direct >> channel) & 1U)
137 + m_channel_usage_counts[channel].load(std::memory_order_acquire);
138 for (uint32_t i = 0; i < paths; ++i) {
139 modulator->remove_channel_usage(channel);
140 }
141 }
142}
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::clear_modulators(), MayaFlux::Nodes::Generator::Phasor::clear_modulators(), MayaFlux::Nodes::Generator::Sine::clear_modulators(), MayaFlux::Nodes::Generator::Counter::clear_reset_trigger(), 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: