35class MeterProcessor :
public QObject
40 Q_PROPERTY (
int channel READ channel WRITE setChannel)
45 float currentAmplitude READ currentAmplitude NOTIFY currentAmplitudeChanged)
46 Q_PROPERTY (
float peakAmplitude READ peakAmplitude NOTIFY peakAmplitudeChanged)
54 METER_ALGORITHM_DIGITAL_PEAK,
71 int channel ()
const {
return channel_; }
72 void setChannel (
int channel);
75 void setAudioEngine (dsp::AudioEngine * engine) { audio_engine_ = engine; }
77 float currentAmplitude ()
const
79 return current_amp_.load (std::memory_order_relaxed);
81 Q_SIGNAL
void currentAmplitudeChanged (
float value);
83 float peakAmplitude ()
const
85 return peak_amp_.load (std::memory_order_relaxed);
87 Q_SIGNAL
void peakAmplitudeChanged (
float value);
89 Q_INVOKABLE
float toDBFS (
float amp)
const;
90 Q_INVOKABLE
float toFader (
float amp)
const;
104 QPointer<dsp::Port>
port_;
107 std::optional<dsp::RingBufferOwningPortMixin::RingBufferReader>
112 std::unique_ptr<zrythm::dsp::TruePeakDsp> true_peak_max_processor_;
116 float true_peak_max_ = 0.f;
121 std::unique_ptr<zrythm::dsp::PeakDsp> peak_processor_;
140 qint64 last_midi_trigger_time_ = 0;
143 std::vector<float> tmp_buf_;
145 std::atomic<float> current_amp_ = 0.f;
146 std::atomic<float> peak_amp_ = 0.f;
151 QPointer<dsp::AudioEngine> audio_engine_;
155 boost::container::static_vector<dsp::MidiEvent, 256> tmp_events_;