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

◆ apply_controls()

void MayaFlux::Nodes::Network::DuctNetwork::apply_controls ( )
private

Definition at line 472 of file DuctNetwork.cpp.

473{
474 if (const auto pickup = m_controls.pickup.pending()) {
475 apply_pickup_position(*pickup);
476 }
477 if (const auto output = m_controls.output.pending()) {
478 m_output.store(*output > 0.5 ? Output::PICKUP : Output::RADIATED, std::memory_order_relaxed);
479 }
480
481 const auto forward = [this](std::string_view name, Control& control) {
482 if (name == "scale" || name == "pickup" || name == "output") {
483 return;
484 }
485 if (const auto value = control.pending()) {
486 const ParameterKey key = parameter_key(name);
487 m_active->mouth->set_mapped_parameter(key, *value);
488 m_active->bell->set_mapped_parameter(key, *value);
489 }
490 };
491
492 std::apply(
493 [&](const auto&... member) { (forward(member.name, member.get(m_controls)), ...); },
494 Reflect::Generated::Description<DuctControls>::members());
495}
std::shared_ptr< Prepared > m_active
@ PICKUP
Pressure inside the duct at the pickup position.
@ RADIATED
Pressure radiated at one metre, from the flow out of the bell.
void apply_pickup_position(double position)
constexpr ParameterKey parameter_key(std::string_view name) noexcept

References apply_pickup_position(), m_active, m_controls, m_output, MayaFlux::Nodes::Network::parameter_key(), PICKUP, and RADIATED.

Referenced by process_batch().

Here is the call graph for this function:
Here is the caller graph for this function: