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

◆ get_node_output()

std::optional< double > MayaFlux::Nodes::Network::DuctNetwork::get_node_output ( size_t index) const
nodiscardoverridevirtual

Pressure at one point along the duct, from the last block.

Reimplemented from MayaFlux::Nodes::Network::NodeNetwork.

Definition at line 540 of file DuctNetwork.cpp.

541{
542 while (m_audio_buffer_lock.test_and_set(std::memory_order_acquire)) {
543 std::this_thread::yield();
544 }
545 const std::optional<double> value = index < m_field.size()
546 ? std::optional<double> { m_field[index] }
547 : std::nullopt;
548 m_audio_buffer_lock.clear(std::memory_order_release);
549 return value;
550}
std::atomic_flag m_audio_buffer_lock
Spinlock guarding m_last_audio_buffer.

References MayaFlux::Nodes::Network::NodeNetwork::m_audio_buffer_lock, and m_field.