Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
meter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2020 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __AUDIO_METER_H__
11#define __AUDIO_METER_H__
12
13#include "utils/types.h"
14
15#include "gtk_wrapper.h"
16
17typedef struct TruePeakDsp TruePeakDsp;
18typedef struct KMeterDsp KMeterDsp;
19typedef struct PeakDsp PeakDsp;
20typedef struct Port Port;
21
29{
32
33 METER_ALGORITHM_DIGITAL_PEAK,
34
38 METER_ALGORITHM_RMS,
39 METER_ALGORITHM_K,
40};
41
45typedef struct Meter
46{
49
52 TruePeakDsp * true_peak_max_processor;
53
55 float true_peak;
56 float true_peak_max;
57
60
61 PeakDsp * peak_processor;
62
69
72 float prev_max;
73
76 float last_amp;
77
81
82 gint64 last_midi_trigger_time;
83
84} Meter;
85
86Meter *
87meter_new_for_port (Port * port);
88
95void
96meter_get_value (Meter * self, AudioValueFormat format, float * val, float * max);
97
98void
99meter_free (Meter * self);
100
101#endif
float prev_max
Previous max, used when holding the max value.
Definition meter.h:72
KMeterDsp * kmeter_processor
K RMS processor, if K meter.
Definition meter.h:59
void meter_get_value(Meter *self, AudioValueFormat format, float *val, float *max)
Get the current meter value.
float true_peak
Current true peak.
Definition meter.h:55
Port * port
Port associated with this meter.
Definition meter.h:48
TruePeakDsp * true_peak_processor
True peak processor.
Definition meter.h:51
MeterAlgorithm
Definition meter.h:29
float last_amp
Last meter value (in amplitude), used to show a falloff and avoid sudden dips.
Definition meter.h:76
MeterAlgorithm algorithm
Algorithm to use.
Definition meter.h:68
gint64 last_draw_time
Time the last val was taken at (last draw time).
Definition meter.h:80
@ METER_ALGORITHM_AUTO
Use default algorithm for the port.
AudioValueFormat
Definition types.h:125
A Meter used by a single GUI element.
Definition meter.h:46
Must ONLY be created via port_new()
Definition port.h:136
Custom types.