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

◆ add_channel_usage()

void MayaFlux::Nodes::Node::add_channel_usage ( uint32_t channel_id)

Adds one inherited use of a channel to this node and its modulators.

Parameters
channel_idThe channel the consuming node is used on

register_channel_usage is a channel claiming the node directly through routing. This is the counted form: a consuming node adds one use on each modulator it holds. The channel stays in this node's mask until every use added here has been removed, so several consumers can share one modulator without one of them withdrawing the channel from the others.

Definition at line 84 of file Node.cpp.

85{
86 if (channel_id >= 32)
87 return;
88
89 m_channel_usage_counts[channel_id].fetch_add(1, std::memory_order_acq_rel);
90 refresh_channel_bit(channel_id);
91 for (const auto& [role, modulator] : get_modulators()) {
92 modulator->add_channel_usage(channel_id);
93 }
94}
void refresh_channel_bit(uint32_t channel_id)
Recomputes one channel's bit in the active mask from direct and counted usage.
Definition Node.cpp:152
virtual std::vector< std::pair< ModulatorRole, std::shared_ptr< Node > > > get_modulators() const
Returns direct modulator nodes and their roles.
Definition Node.hpp:758
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 get_modulators(), m_channel_usage_counts, and refresh_channel_bit().

Here is the call graph for this function: