Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
automation_point.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2018-2022 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __AUDIO_AUTOMATION_POINT_H__
11#define __AUDIO_AUTOMATION_POINT_H__
12
13#include "dsp/curve.h"
14#include "dsp/position.h"
17#include "utils/types.h"
18
19typedef struct Port Port;
20typedef struct AutomationTrack AutomationTrack;
21typedef struct _AutomationPointWidget AutomationPointWidget;
22
29#define AP_WIDGET_POINT_SIZE 6
30
31#define automation_point_is_selected(r) \
32 arranger_object_is_selected ((ArrangerObject *) r)
33
38{
39 float normalized_val;
40 CurveOptions curve_opts;
41 GdkRectangle draw_rect;
43
82
89 const float value,
90 const float normalized_val,
91 const Position * pos);
92
100void
102 AutomationPoint * self,
103 float real_val,
104 bool is_normalized,
105 bool pub_events);
106
107const char *
108automation_point_get_fvalue_as_string (AutomationPoint * self);
109
110void
111automation_point_set_fvalue_with_action (
112 AutomationPoint * self,
113 const char * fval_str);
114
120void
122 AutomationPoint * _ap,
123 ZRegion * region,
124 int index);
125
137HOT double
139 AutomationPoint * self,
140 ZRegion * region,
141 double x);
142
146void
148 AutomationPoint * ap,
149 const curviness_t curviness);
150
155Port *
157
164
165PURE int
166automation_point_is_equal (AutomationPoint * a, AutomationPoint * b);
167
172NONNULL bool
174
179#endif // __AUDIO_AUTOMATION_POINT_H__
Macros for arranger object backends.
Curves.
AutomationPoint * automation_point_new_float(const float value, const float normalized_val, const Position *pos)
Creates an AutomationPoint in the given AutomationTrack at the given Position.
NONNULL bool automation_point_curves_up(AutomationPoint *self)
Returns if the curve of the AutomationPoint curves upwards as you move right on the x axis.
void automation_point_set_fvalue(AutomationPoint *self, float real_val, bool is_normalized, bool pub_events)
Sets the value from given real or normalized value and notifies interested parties.
void automation_point_set_region_and_index(AutomationPoint *_ap, ZRegion *region, int index)
Sets the ZRegion and the index in the region that the AutomationPoint belongs to, in all its counterp...
HOT double automation_point_get_normalized_value_in_curve(AutomationPoint *self, ZRegion *region, double x)
The function to return a point on the curve.
Port * automation_point_get_port(const AutomationPoint *const self)
Convenience function to return the control port that this AutomationPoint is for.
void automation_point_set_curviness(AutomationPoint *ap, const curviness_t curviness)
Sets the curviness of the AutomationPoint.
AutomationTrack * automation_point_get_automation_track(const AutomationPoint *const self)
Convenience function to return the AutomationTrack that this AutomationPoint is in.
Position struct and API.
Region identifier.
Base struct for arranger objects.
An automation point inside an AutomationTrack.
float fvalue
Float value (real).
GskRenderNode * cairo_node_tl
Cached cairo node to reuse when drawing in the timeline.
AutomationPointDrawSettings last_settings
Last settings used for drawing in editor.
int index
Index in the region.
float normalized_val
Normalized value (0 to 1) used as a cache.
AutomationPointDrawSettings last_settings_tl
Last settings used for drawing in timeline.
char * tmp_str
Temporary string used with StringEntryDialogWidget.
GskRenderNode * cairo_node
Cached cairo node to reuse when drawing in the editor.
ArrangerObject base
Base struct.
Curve options.
Definition curve.h:109
Must ONLY be created via port_new()
Definition port.h:138
A Position is made up of bars.beats.sixteenths.ticks.
Definition position.h:129
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.
Definition region.h:77
Custom types.