Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
meter.h
Go to the documentation of this file.
1// clang-format off
2// SPDX-FileCopyrightText: © 2019-2021, 2024 Alexandros Theodotou <alex@zrythm.org>
3// SPDX-License-Identifier: LicenseRef-ZrythmLicense
4// clang-format on
5
9#ifndef __GUI_WIDGETS_METER_H__
10#define __GUI_WIDGETS_METER_H__
11
12#include "utils/general.h"
13
14#include "gtk_wrapper.h"
15
16#define METER_WIDGET_TYPE (meter_widget_get_type ())
17G_DECLARE_FINAL_TYPE (MeterWidget, meter_widget, Z, METER_WIDGET, GtkWidget)
18
19typedef struct Meter Meter;
20
21typedef struct _MeterWidget
22{
23 GtkWidget parent_instance;
24
27
29 int hover;
30
31 GdkRGBA start_color;
32 GdkRGBA end_color;
33
34 float meter_val;
35 float meter_peak;
36
40 float last_meter_peak;
41
43 guint source_id;
44 GSource * timeout_source;
46
53void
54meter_widget_setup (MeterWidget * self, Port * port, bool small);
55
62meter_widget_new (Port * port, int width);
63
64#endif
General utils.
void meter_widget_setup(MeterWidget *self, Port *port, bool small)
Sets up an existing meter and binds it to the given port.
MeterWidget * meter_widget_new(Port *port, int width)
Creates a new MeterWidget and binds it to the given port.
int hover
Hovered or not.
Definition meter.h:29
guint source_id
ID of the source function.
Definition meter.h:43
float last_meter_val
Caches of last drawn values so that meters are redrawn only when there are changes.
Definition meter.h:39
Meter * meter
Associated meter.
Definition meter.h:26
A Meter used by a single GUI element.
Definition meter.h:46
Must ONLY be created via port_new()
Definition port.h:136