Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
balance_control.h
Go to the documentation of this file.
1// clang-format off
2// SPDX-FileCopyrightText: © 2019-2020, 2023 Alexandros Theodotou <alex@zrythm.org>
3// SPDX-License-Identifier: LicenseRef-ZrythmLicense
4// clang-format on
5
9#ifndef __GUI_WIDGETS_BALANCE_CONTROL_H__
10#define __GUI_WIDGETS_BALANCE_CONTROL_H__
11
12#include "utils/types.h"
13
14#include <gtk/gtk.h>
15
16#define BALANCE_CONTROL_WIDGET_TYPE (balance_control_widget_get_type ())
18 BalanceControlWidget,
19 balance_control_widget,
20 Z,
21 BALANCE_CONTROL_WIDGET,
22 GtkWidget)
23
24typedef 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 Port * port;
57
59 GtkPopoverMenu * popover_menu;
60} BalanceControlWidget;
61
69BalanceControlWidget *
71 GenericFloatGetter getter,
72 GenericFloatSetter setter,
73 void * object,
74 Port * port,
75 int height);
76
77#endif
float(* GenericFloatGetter)(void *object)
Getter prototype for float values.
Definition types.h:73
void(* GenericFloatSetter)(void *object, float val)
Setter prototype for float values.
Definition types.h:78
BalanceControlWidget * balance_control_widget_new(GenericFloatGetter getter, GenericFloatSetter setter, void *object, Port *port, int height)
Creates a new BalanceControl widget and binds it to the given value.
G_DECLARE_FINAL_TYPE(BalanceControlWidget, balance_control_widget, Z, BALANCE_CONTROL_WIDGET, GtkWidget) typedef struct _BalanceControlWidget
Must ONLY be created via port_new()
Definition port.h:139
Custom types.