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_wrapper.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
47 int text_widths[static_cast<int> (AutomationMode::NUM_AUTOMATION_MODES)];
48 int text_heights[static_cast<int> (AutomationMode::NUM_AUTOMATION_MODES)];
49 int max_text_height;
50
51 int has_hit_mode;
52
54 AutomationMode hit_mode;
55
57 GdkRGBA def_color;
58
61
63 GdkRGBA toggled_colors[static_cast<int> (AutomationMode::NUM_AUTOMATION_MODES)];
64
67 GdkRGBA held_colors[static_cast<int> (AutomationMode::NUM_AUTOMATION_MODES)];
68
70 double aspect;
71
75
78 last_states[static_cast<int> (AutomationMode::NUM_AUTOMATION_MODES)];
79
82 current_states[static_cast<int> (AutomationMode::NUM_AUTOMATION_MODES)];
83
85 GdkRGBA last_colors[static_cast<int> (AutomationMode::NUM_AUTOMATION_MODES)];
86
88 PangoLayout * layout;
89
92
95
97
103 int height,
104 PangoLayout * layout,
105 AutomationTrack * owner);
106
107void
108automation_mode_widget_init (AutomationModeWidget * self);
109
110void
111automation_mode_widget_draw (
113 GtkSnapshot * snapshot,
114 double x,
115 double y,
116 double x_cursor,
118
119void
120automation_mode_widget_free (AutomationModeWidget * self);
121
126#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 hovered_color
Hovered color.
GdkRGBA last_colors[static_cast< int >(AutomationMode::NUM_AUTOMATION_MODES)]
Used during transitions.
CustomButtonWidgetState last_states[static_cast< int >(AutomationMode::NUM_AUTOMATION_MODES)]
Used to update caches if state changed.
GdkRGBA def_color
Default color.
AutomationTrack * owner
Owner.
GdkRGBA held_colors[static_cast< int >(AutomationMode::NUM_AUTOMATION_MODES)]
Held color (used after clicking and before releasing).
int transition_frames
Frames left for a transition in color.
double corner_radius
Corner curvature radius for the rounded rectangle.
CustomButtonWidgetState current_states[static_cast< int >(AutomationMode::NUM_AUTOMATION_MODES)]
Used during drawing.
GdkRGBA toggled_colors[static_cast< int >(AutomationMode::NUM_AUTOMATION_MODES)]
Toggled color.
int text_widths[static_cast< int >(AutomationMode::NUM_AUTOMATION_MODES)]
Width of each button, including padding.
double x
X/y relative to parent drawing area.
int width
Total width/height.
PangoLayout * layout
Cache layout for drawing text.
AutomationMode hit_mode
Currently hit mode.