Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
value_channel_visual_port.hpp
Go to the documentation of this file.
1#pragma once
2
11
13
14#include <cstddef>
15#include <cstdint>
16#include <span>
17#include <vector>
18
19namespace pulp::dataplane {
20class EventSource;
21class MeterSource;
22class ScalarSource;
23class ValueChannelSet;
24class VectorSource;
25} // namespace pulp::dataplane
26
27namespace pulp::format {
28
29class Processor;
30
45class ValueChannelVisualPort final : public VisualPort {
46 public:
48
51 explicit ValueChannelVisualPort(Processor& processor);
52
55
56 std::size_t channel_count() const noexcept override;
57 VisualChannelInfo channel(std::size_t index) const noexcept override;
58 bool read_scalar(std::size_t index, float& value) noexcept override;
59 std::size_t read_meter(std::size_t index, std::span<float> rms,
60 std::span<float> peak) noexcept override;
61 std::size_t read_vector(std::size_t index, std::span<float> samples) noexcept override;
62 std::size_t read_events(std::size_t index, std::span<VisualEvent> events) noexcept override;
63 std::uint32_t publish_count(std::size_t index) const noexcept override;
64
65 private:
66 struct Channel {
72 };
73
74 const Channel* at(std::size_t index) const noexcept;
75
76 std::vector<Channel> channels_;
77};
78
79} // namespace pulp::format
Lock-free event channel: the writer publishes the occurrences from one audio block and the view reads...
Definition value_source.hpp:179
Lock-free meter channel: the host publishes a MeterFrame from the audio/host thread; the view reads t...
Definition value_source.hpp:80
Lock-free scalar channel: a single paint-safe cached number (a readout value, a modulation ring's bas...
Definition value_source.hpp:201
A processor's declared channels.
Definition value_channel_set.hpp:61
Lock-free vector channel: the writer publishes a block of samples, the view reads the latest block pa...
Definition value_source.hpp:154
Definition processor.hpp:174
std::size_t channel_count() const noexcept override
bool read_scalar(std::size_t index, float &value) noexcept override
Latest value of a scalar channel.
ValueChannelVisualPort(const ValueChannelVisualPort &)=delete
std::size_t read_vector(std::size_t index, std::span< float > samples) noexcept override
Latest block of a vector channel into samples.
ValueChannelVisualPort(Processor &processor)
The port over processor.value_channels(), or an empty port when the processor declares no channels.
VisualChannelInfo channel(std::size_t index) const noexcept override
Description of channel index (< channel_count()).
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::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.
ValueChannelVisualPort & operator=(const ValueChannelVisualPort &)=delete
std::uint32_t publish_count(std::size_t index) const noexcept override
Monotonic publish count of channel index.
ValueChannelVisualPort(const dataplane::ValueChannelSet *channels)
Read access to the values and meters a processor publishes for its UI.
Definition editor_host.hpp:265
The editor-host contract: how a host (a format adapter, the standalone app, a test) opens,...
Definition audio_bridge.hpp:9
Definition child_process_manager.hpp:18
What the product grants a device: the quota table indexed by capability tier and live thermal state.
Definition aax_editor.hpp:31
@ meter
per-channel RMS and peak levels
Definition editor_host.hpp:236
@ vector
a block of samples for a scope-style display
Definition editor_host.hpp:237
@ scalar
one number per publish (gain reduction, an envelope level)
Definition editor_host.hpp:235
STL namespace.
What a visual channel is. The strings stay valid for the life of the port.
Definition editor_host.hpp:242
One occurrence on an events channel.
Definition editor_host.hpp:251