Reads a ValueChannelSet through the VisualPort contract. More...
#include <value_channel_visual_port.hpp>
Public Member Functions | |
| ValueChannelVisualPort (const dataplane::ValueChannelSet *channels) | |
| ValueChannelVisualPort (Processor &processor) | |
| The port over processor.value_channels(), or an empty port when the processor declares no channels. | |
| ValueChannelVisualPort (const ValueChannelVisualPort &)=delete | |
| ValueChannelVisualPort & | operator= (const ValueChannelVisualPort &)=delete |
| std::size_t | channel_count () const noexcept override |
| VisualChannelInfo | channel (std::size_t index) const noexcept override |
| Description of channel index (< channel_count()). | |
| bool | read_scalar (std::size_t index, float &value) noexcept override |
| Latest value of a scalar channel. | |
| std::size_t | read_meter (std::size_t index, std::span< float > rms, std::span< float > peak) noexcept override |
| Latest frame of a meter channel into rms and peak. | |
| std::size_t | read_vector (std::size_t index, std::span< float > samples) noexcept override |
| Latest block of a vector channel into samples. | |
| std::size_t | read_events (std::size_t index, std::span< VisualEvent > events) noexcept override |
| Occurrences of the latest published block of an events channel. | |
| std::uint32_t | publish_count (std::size_t index) const noexcept override |
| Monotonic publish count of channel index. | |
| std::optional< std::size_t > | find (std::string_view name, VisualChannelShape shape) const noexcept |
| Index of the channel called name with shape shape, or nullopt. | |
Reads a ValueChannelSet through the VisualPort contract.
The port resolves every declared channel once, at construction. That is valid because a set's channels are fixed before audio runs: an index the port hands out stays valid for the life of the set. Channel indices and order match ValueChannelSet::infos().
Lifetime: the set must outlive the port. A null set gives a port with no channels, which is what a processor that declares none exposes.
Threading: the same one-reader-thread contract as the sources behind it. Every read through one port, and every other read of the same set, happens on one thread, normally the editor's frame tick. Reads are lock-free and allocation-free; vector and event reads copy one frame on the stack.
|
explicit |
|
explicit |
The port over processor.value_channels(), or an empty port when the processor declares no channels.
|
delete |
|
overridevirtualnoexcept |
Description of channel index (< channel_count()).
Implements pulp::format::VisualPort.
|
overridevirtualnoexcept |
Implements pulp::format::VisualPort.
|
inlinenoexceptinherited |
Index of the channel called name with shape shape, or nullopt.
|
delete |
|
overridevirtualnoexcept |
Monotonic publish count of channel index.
A reader compares it across ticks to tell "the writer stopped" from "the value held steady".
Implements pulp::format::VisualPort.
|
overridevirtualnoexcept |
Occurrences of the latest published block of an events channel.
Returns the number written, or 0 if index is not an events channel.
Implements pulp::format::VisualPort.
|
overridevirtualnoexcept |
Latest frame of a meter channel into rms and peak.
Returns the number of audio channels the frame carries (possibly more than the spans hold, which are filled up to their size), or 0 if index is not a meter channel.
Implements pulp::format::VisualPort.
|
overridevirtualnoexcept |
Latest value of a scalar channel.
False if index is not a scalar channel or nothing has been published yet.
Implements pulp::format::VisualPort.
|
overridevirtualnoexcept |
Latest block of a vector channel into samples.
Returns the number of samples written, or 0 if index is not a vector channel.
Implements pulp::format::VisualPort.