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

◆ process()

void MayaFlux::Nodes::Network::AdvanceOperator::process ( float  dt)
overridevirtual

Process for one batch cycle.

Parameters
dtTime delta or sample count (operator-specific)

Implements MayaFlux::Nodes::Network::NetworkOperator.

Definition at line 50 of file RelationOperators.cpp.

51{
52 const auto num_frames = static_cast<uint32_t>(frames);
53
54 for (auto& slot : slots()) {
55 const bool active = slot.active;
56 auto block = slot.prepare_block(num_frames);
57
58 if (slot.node) {
59 extract_node_samples(slot.node, m_scratch, m_scratch_pos, num_frames);
60 for (uint32_t i = 0; i < num_frames; ++i) {
61 block[i] = active ? m_scratch[i] : 0.0;
62 }
63 if (num_frames > 0) {
64 slot.level = m_scratch[num_frames - 1];
65 }
66 } else {
67 const double level = slot.level;
68 for (uint32_t i = 0; i < num_frames; ++i) {
69 block[i] = active ? level : 0.0;
70 }
71 }
72 }
73}
std::span< RelationSlot > slots() const noexcept
void extract_node_samples(const std::shared_ptr< Nodes::Node > &node, std::vector< double > &buffer, size_t &buffer_pos, size_t num_samples)
Extract num_samples from node into buffer using snapshot guard.

References MayaFlux::Nodes::Network::extract_node_samples(), m_scratch, m_scratch_pos, and MayaFlux::Nodes::Network::RelationOperator::slots().

+ Here is the call graph for this function: