Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
MeterProcessor Class Reference

A meter processor for a single GUI element. More...

#include <src/gui/backend/meter.h>

Inheritance diagram for MeterProcessor:
Collaboration diagram for MeterProcessor:

Public Types

using MeterPortVariant = std::variant<dsp::MidiPort, dsp::AudioPort>
using MeterPortPtrVariant = to_pointer_variant<MeterPortVariant>

Public Member Functions

 MeterProcessor (QObject *parent=nullptr)
QVariant port () const
void setPort (QVariant port_var)
int channel () const
void setChannel (int channel)
float currentAmplitude () const
Q_SIGNAL void currentAmplitudeChanged (float value)
float peakAmplitude () const
Q_SIGNAL void peakAmplitudeChanged (float value)
Q_INVOKABLE float toDBFS (float amp) const
Q_INVOKABLE float toFader (float amp) const

Data Fields

QPointer< QObject > port_obj_
 Port associated with this meter.
std::optional< dsp::RingBufferOwningPortMixin::RingBufferReaderring_buffer_reader_
std::unique_ptr< zrythm::dsp::TruePeakDsptrue_peak_processor_
 True peak processor.
std::unique_ptr< zrythm::dsp::TruePeakDsptrue_peak_max_processor_
float true_peak_ = 0.f
 Current true peak.
float true_peak_max_ = 0.f
std::unique_ptr< zrythm::dsp::KMeterDspkmeter_processor_
 K RMS processor, if K meter.
std::unique_ptr< zrythm::dsp::PeakDsppeak_processor_
MeterAlgorithm algorithm_ = MeterAlgorithm::METER_ALGORITHM_AUTO
 Algorithm to use.
float prev_max_ = 0.f
 Previous max, used when holding the max value.
float last_amp_ = 0.f
 Last meter value (in amplitude), used to show a falloff and avoid sudden dips.
SteadyTimePoint last_draw_time_
 Time the last val was taken at (last draw time).
qint64 last_midi_trigger_time_ = 0

Properties

QML_ELEMENT QVariant port
int channel
float currentAmplitude
float peakAmplitude

Detailed Description

A meter processor for a single GUI element.

This class is responsible for processing the meter values for a single GUI element, such as a volume meter. It supports various meter algorithms, including digital peak, true peak, RMS, and K-meter.

The meter processor is associated with a port, which can be either an AudioPort or a MidiPort. The meter values are updated based on the data from the associated port.

The meter processor emits the valuesChanged signal whenever the meter values are updated, allowing the GUI to update the display accordingly.

Definition at line 50 of file meter.h.


The documentation for this class was generated from the following file: