|
Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
A meter processor for a single GUI element. More...
#include <src/gui/qquick/meter_processor.h>


Public Types | |
| enum class | MeterAlgorithm : std::uint8_t { METER_ALGORITHM_AUTO , METER_ALGORITHM_DIGITAL_PEAK , METER_ALGORITHM_TRUE_PEAK , METER_ALGORITHM_RMS , METER_ALGORITHM_K } |
| 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) |
| dsp::AudioEngine * | audioEngine () const |
| void | setAudioEngine (dsp::AudioEngine *engine) |
| 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::RingBufferReader > | ring_buffer_reader_ |
| std::unique_ptr< zrythm::dsp::TruePeakDsp > | true_peak_processor_ |
| True peak processor. | |
| std::unique_ptr< zrythm::dsp::TruePeakDsp > | true_peak_max_processor_ |
| float | true_peak_ = 0.f |
| Current true peak. | |
| float | true_peak_max_ = 0.f |
| std::unique_ptr< zrythm::dsp::KMeterDsp > | kmeter_processor_ |
| K RMS processor, if K meter. | |
| std::unique_ptr< zrythm::dsp::PeakDsp > | peak_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 |
| zrythm::dsp::AudioEngine * | audioEngine |
| float | currentAmplitude |
| float | peakAmplitude |
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 35 of file meter_processor.h.
| using zrythm::gui::qquick::MeterProcessor::MeterPortPtrVariant = to_pointer_variant<MeterPortVariant> |
Definition at line 61 of file meter_processor.h.
| using zrythm::gui::qquick::MeterProcessor::MeterPortVariant = std::variant<dsp::MidiPort, dsp::AudioPort> |
Definition at line 60 of file meter_processor.h.
|
strong |
| Enumerator | |
|---|---|
| METER_ALGORITHM_AUTO | Use default algorithm for the port. |
| METER_ALGORITHM_TRUE_PEAK |
|
Definition at line 47 of file meter_processor.h.
|
inline |
Definition at line 75 of file meter_processor.h.
|
inline |
Definition at line 72 of file meter_processor.h.
|
inline |
Definition at line 78 of file meter_processor.h.
|
inline |
Definition at line 84 of file meter_processor.h.
|
inline |
Definition at line 69 of file meter_processor.h.
|
inline |
Definition at line 76 of file meter_processor.h.
| MeterAlgorithm zrythm::gui::qquick::MeterProcessor::algorithm_ = MeterAlgorithm::METER_ALGORITHM_AUTO |
| std::unique_ptr<zrythm::dsp::KMeterDsp> zrythm::gui::qquick::MeterProcessor::kmeter_processor_ |
K RMS processor, if K meter.
Definition at line 120 of file meter_processor.h.
| float zrythm::gui::qquick::MeterProcessor::last_amp_ = 0.f |
Last meter value (in amplitude), used to show a falloff and avoid sudden dips.
Definition at line 136 of file meter_processor.h.
| SteadyTimePoint zrythm::gui::qquick::MeterProcessor::last_draw_time_ |
Time the last val was taken at (last draw time).
Definition at line 139 of file meter_processor.h.
| qint64 zrythm::gui::qquick::MeterProcessor::last_midi_trigger_time_ = 0 |
Definition at line 141 of file meter_processor.h.
| std::unique_ptr<zrythm::dsp::PeakDsp> zrythm::gui::qquick::MeterProcessor::peak_processor_ |
Definition at line 122 of file meter_processor.h.
| QPointer<QObject> zrythm::gui::qquick::MeterProcessor::port_obj_ |
Port associated with this meter.
Definition at line 105 of file meter_processor.h.
| float zrythm::gui::qquick::MeterProcessor::prev_max_ = 0.f |
Previous max, used when holding the max value.
Definition at line 132 of file meter_processor.h.
| std::optional<dsp::RingBufferOwningPortMixin::RingBufferReader> zrythm::gui::qquick::MeterProcessor::ring_buffer_reader_ |
Definition at line 109 of file meter_processor.h.
| float zrythm::gui::qquick::MeterProcessor::true_peak_ = 0.f |
Current true peak.
Definition at line 116 of file meter_processor.h.
| float zrythm::gui::qquick::MeterProcessor::true_peak_max_ = 0.f |
Definition at line 117 of file meter_processor.h.
| std::unique_ptr<zrythm::dsp::TruePeakDsp> zrythm::gui::qquick::MeterProcessor::true_peak_max_processor_ |
Definition at line 113 of file meter_processor.h.
| std::unique_ptr<zrythm::dsp::TruePeakDsp> zrythm::gui::qquick::MeterProcessor::true_peak_processor_ |
True peak processor.
Definition at line 112 of file meter_processor.h.
|
readwrite |
Definition at line 41 of file meter_processor.h.
|
readwrite |
Definition at line 40 of file meter_processor.h.
|
read |
Definition at line 43 of file meter_processor.h.
|
read |
Definition at line 44 of file meter_processor.h.
|
readwrite |
Definition at line 39 of file meter_processor.h.