Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
automation_mode.h
Go to the documentation of this file.
1// clang-format off
2// SPDX-FileCopyrightText: © 2019-2020, 2022 Alexandros Theodotou <alex@zrythm.org>
3// SPDX-License-Identifier: LicenseRef-ZrythmLicense
4// clang-format on
5
12#ifndef __GUI_WIDGETS_AUTOMATION_MODE_H__
13#define __GUI_WIDGETS_AUTOMATION_MODE_H__
14
17
18#include <gtk/gtk.h>
19
20typedef struct AutomationTrack AutomationTrack;
21
28#define AUTOMATION_MODE_HPADDING 3
29#define AUTOMATION_MODE_HSEPARATOR_SIZE 1
30
36{
38 double x;
39 double y;
40
42 int width;
43 int height;
44
46 // int widths[NUM_AUTOMATION_MODES];
47
48 int text_widths[NUM_AUTOMATION_MODES];
49 int text_heights[NUM_AUTOMATION_MODES];
50 int max_text_height;
51
52 int has_hit_mode;
53
55 AutomationMode hit_mode;
56
58 GdkRGBA def_color;
59
62
64 GdkRGBA toggled_colors[NUM_AUTOMATION_MODES];
65
68 GdkRGBA held_colors[NUM_AUTOMATION_MODES];
69
71 double aspect;
72
76
78 CustomButtonWidgetState last_states[NUM_AUTOMATION_MODES];
79
82
84 GdkRGBA last_colors[NUM_AUTOMATION_MODES];
85
87 PangoLayout * layout;
88
91
94
96
102 int height,
103 PangoLayout * layout,
104 AutomationTrack * owner);
105
106void
107automation_mode_widget_init (AutomationModeWidget * self);
108
109void
110automation_mode_widget_draw (
112 GtkSnapshot * snapshot,
113 double x,
114 double y,
115 double x_cursor,
117
118void
119automation_mode_widget_free (AutomationModeWidget * self);
120
125#endif
Automation track.
Custom button to be drawn inside drawing areas.
CustomButtonWidgetState
AutomationModeWidget * automation_mode_widget_new(int height, PangoLayout *layout, AutomationTrack *owner)
Creates a new track widget from the given track.
Custom button group to be drawn inside drawing areas.
double aspect
Aspect ratio for the rounded rectangle.
GdkRGBA held_colors[NUM_AUTOMATION_MODES]
Held color (used after clicking and before releasing).
GdkRGBA toggled_colors[NUM_AUTOMATION_MODES]
Toggled color.
GdkRGBA hovered_color
Hovered color.
GdkRGBA def_color
Default color.
AutomationTrack * owner
Owner.
int transition_frames
Frames left for a transition in color.
double corner_radius
Corner curvature radius for the rounded rectangle.
double x
X/y relative to parent drawing area.
CustomButtonWidgetState current_states[NUM_AUTOMATION_MODES]
Used during drawing.
int width
Total width/height.
PangoLayout * layout
Cache layout for drawing text.
GdkRGBA last_colors[NUM_AUTOMATION_MODES]
Used during transitions.
int text_widths[NUM_AUTOMATION_MODES]
Width of each button, including padding.
AutomationMode hit_mode
Currently hit mode.
CustomButtonWidgetState last_states[NUM_AUTOMATION_MODES]
Used to update caches if state changed.