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

◆ register_channel_usage()

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

Mark the specificed channel as a processor/user.

Parameters
channel_idThe ID of the channel to register

This method uses a bitmask to track which channels are currently using this node. It allows the node to manage its state based on channel usage, which is important for the audio engine's processing lifecycle. When a channel registers usage, the node can adjust its processing state accordingly, such as preventing state resets within the same cycle, or use the same output for multiple channels

Definition at line 31 of file Node.cpp.

32{
33 if (channel_id >= 32)
34 return;
35
36 auto channel_bit = static_cast<uint32_t>((0x0ffffffff) & (1ULL << (uint64_t)channel_id));
37
38 m_active_channels_mask.fetch_or(channel_bit, std::memory_order_acq_rel);
39}
std::atomic< uint32_t > m_active_channels_mask
Bitmask tracking which channels are currently using this node.
Definition Node.hpp:590

References m_active_channels_mask.