Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
balance_control.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2019-2020, 2023-2024 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
6
7#ifndef __GUI_WIDGETS_BALANCE_CONTROL_H__
8#define __GUI_WIDGETS_BALANCE_CONTROL_H__
9
10#include "common/utils/color.h"
11#include "common/utils/types.h"
12#include "gui/backend/gtk_widgets/gtk_wrapper.h"
13
14class ControlPort;
15
16#define BALANCE_CONTROL_WIDGET_TYPE (balance_control_widget_get_type ())
17G_DECLARE_FINAL_TYPE (
18 BalanceControlWidget,
19 balance_control_widget,
20 Z,
21 BALANCE_CONTROL_WIDGET,
22 GtkWidget)
23
24using BalanceControlWidget = struct _BalanceControlWidget
25{
26 GtkWidget parent_instance;
27 GtkGestureDrag * drag;
28
30 GenericFloatGetter getter;
31
33 GenericFloatSetter setter;
34
36 void * object;
37 double last_x;
38 double last_y;
39 GtkWindow * tooltip_win;
40 GtkLabel * tooltip_label;
41 GdkRGBA start_color;
42 GdkRGBA end_color;
43
45 int hovered;
46
48 int dragged;
49
51 PangoLayout * layout;
52
54 float balance_at_start;
55
56 ControlPort * port;
57
59 GtkPopoverMenu * popover_menu;
60};
61
69BalanceControlWidget *
71 GenericFloatGetter getter,
72 GenericFloatSetter setter,
73 void * object,
74 ControlPort * port,
75 int height);
76
77#endif
BalanceControlWidget * balance_control_widget_new(GenericFloatGetter getter, GenericFloatSetter setter, void *object, ControlPort *port, int height)
Creates a new BalanceControl widget and binds it to the given value.
std::function< float()> GenericFloatGetter
Getter prototype for float values.
Definition types.h:92
std::function< void(float)> GenericFloatSetter
Setter prototype for float values.
Definition types.h:97