Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
arranger_object.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2019-2024 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __GUI_WIDGETS_ARRANGER_OBJECT_H__
11#define __GUI_WIDGETS_ARRANGER_OBJECT_H__
12
14#include "utils/ui.h"
15
16#include <gtk/gtk.h>
17
24#define ARRANGER_OBJECT_FADE_POINT_WIDTH 12
25#define ARRANGER_OBJECT_FADE_POINT_HALFWIDTH 6
26
43bool
45 ArrangerObject * self,
46 bool in,
47 const int x,
48 int y,
49 bool only_handle,
50 bool only_outer,
51 bool check_lane);
52
53#define arranger_object_is_fade_in(self, x, y, only_handle, only_outer) \
54 arranger_object_is_fade (self, true, x, y, only_handle, only_outer, true) \
55 || arranger_object_is_fade ( \
56 self, true, x, y, only_handle, only_outer, false)
57
58#define arranger_object_is_fade_out(self, x, y, only_handle, only_outer) \
59 arranger_object_is_fade (self, false, x, y, only_handle, only_outer, true) \
60 || arranger_object_is_fade ( \
61 self, false, x, y, only_handle, only_outer, false)
62
69NONNULL PURE bool
71
78NONNULL bool
80
88bool
89arranger_object_is_resize_up (ArrangerObject * self, const int x, const int y);
90
96bool
98 ArrangerObject * self,
99 const int y,
100 bool ctrl_pressed);
101
109NONNULL bool
110arranger_object_is_rename (ArrangerObject * self, const int x, const int y);
111
119bool
121
125int
127 ArrangerObject * self,
128 ZRegion * region,
129 GdkRectangle * full_rect);
130
131void
132arranger_object_set_full_rectangle (
133 ArrangerObject * self,
134 ArrangerWidget * arranger);
135
148int
150 ArrangerObject * self,
151 GdkRectangle * parent_rect,
152 GdkRectangle * full_rect,
153 GdkRectangle * draw_rect);
154
162void
164 ArrangerObject * self,
165 ArrangerWidget * arranger,
166 GtkSnapshot * snapshot,
167 GdkRectangle * rect);
168
178NONNULL_ARGS (1)
180 ArrangerObject * self,
181 ArrangerWidget * arranger);
182
188bool
190
196bool
198 ArrangerObject * self,
199 ArrangerWidget * arranger);
200
205#endif
Macros for arranger object backends.
WARN_UNUSED_RESULT NONNULL_ARGS(1, 2) bool arranger_object_unsplit(ArrangerObject *r1
Undoes what arranger_object_split() did.
bool arranger_object_is_resize_loop(ArrangerObject *self, const int y, bool ctrl_pressed)
Returns if the current position is for resizing loop.
bool arranger_object_should_show_cut_lines(ArrangerObject *self, bool alt_pressed)
Returns if arranger_object widgets should show cut lines.
int arranger_object_get_full_rect_x_for_region_child(ArrangerObject *self, ZRegion *region, GdkRectangle *full_rect)
Gets the full rectangle for a linked object.
void arranger_object_draw(ArrangerObject *self, ArrangerWidget *arranger, GtkSnapshot *snapshot, GdkRectangle *rect)
Draws the given object.
NONNULL bool arranger_object_is_rename(ArrangerObject *self, const int x, const int y)
Returns if the current position is for renaming the object.
bool arranger_object_is_resize_up(ArrangerObject *self, const int x, const int y)
Returns if the current position is for resizing up (eg, Velocity).
NONNULL bool arranger_object_is_resize_r(ArrangerObject *self, const int x)
Returns if the current position is for resizing R.
bool arranger_object_is_hovered_or_start_object(ArrangerObject *self, ArrangerWidget *arranger)
Whether hovered or the start object of the current action in the arranger.
bool arranger_object_is_fade(ArrangerObject *self, bool in, const int x, int y, bool only_handle, bool only_outer, bool check_lane)
Returns if the current position is for moving the fade in/out mark (timeline only).
OPTIMIZE_O3 bool arranger_object_should_orig_be_visible(ArrangerObject *self, ArrangerWidget *arranger)
Returns if the cached object should be visible, ie, while copy- moving (ctrl+drag) we want to show bo...
int arranger_object_get_draw_rectangle(ArrangerObject *self, GdkRectangle *parent_rect, GdkRectangle *full_rect, GdkRectangle *draw_rect)
Gets the draw rectangle based on the given full rectangle of the arranger object.
NONNULL PURE bool arranger_object_is_resize_l(ArrangerObject *self, const int x)
Returns if the current position is for resizing L.
bool arranger_object_is_hovered(ArrangerObject *self, ArrangerWidget *arranger)
Whether the object is currently hovered.
Base struct for arranger objects.
The arranger widget is a canvas that draws all the arranger objects it contains.
Definition arranger.h:108
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.
Definition region.h:77
User Interface utils.