Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
audio_arranger.h
1// SPDX-FileCopyrightText: © 2020-2022, 2024 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#ifndef __GUI_WIDGETS_AUDIO_ARRANGER_H__
5#define __GUI_WIDGETS_AUDIO_ARRANGER_H__
6
7#include "common/dsp/position.h"
8#include "gui/backend/backend/tool.h"
9#include "gui/backend/gtk_widgets/arranger.h"
10#include "gui/backend/gtk_widgets/gtk_wrapper.h"
11#include "gui/backend/gtk_widgets/main_window.h"
12
18
19#define MW_AUDIO_ARRANGER MW_AUDIO_EDITOR_SPACE->arranger
20
22audio_arranger_widget_get_cursor (ArrangerWidget * self, Tool tool);
23
24void
25audio_arranger_widget_snap_range_r (ArrangerWidget * self, Position * pos);
26
37bool
39 const ArrangerWidget &self,
40 double x,
41 double y,
42 bool fade_in,
43 bool resize);
44
48bool
50 const ArrangerWidget * self,
51 double x,
52 double y);
53
55audio_arranger_widget_get_action_on_drag_begin (ArrangerWidget * self);
56
60void
62 ArrangerWidget * self,
63 double offset_y,
64 bool fade_in);
65
66void
67audio_arranger_widget_update_gain (ArrangerWidget * self, double offset_y);
68
80bool
82 ArrangerWidget * self,
83 Position &pos,
84 bool fade_in,
85 bool dry_run);
86
87void
88audio_arranger_on_drag_end (ArrangerWidget * self);
89
93
94#endif
UiOverlayAction
Various overlay actions to be shared.
Definition ui.h:117
ArrangerCursor
Definition arranger.h:30
bool audio_arranger_widget_snap_fade(ArrangerWidget *self, Position &pos, bool fade_in, bool dry_run)
Updates the fade position during drag update.
struct _ArrangerWidget { GtkWidget parent_instance; ArrangerWidgetType type; GtkGestureDrag * drag; GtkGestureClick * click; GtkGestureClick * right_click; GtkEventControllerMotion *motion_controller; double last_offset_x; double last_offset_y; double offset_x_from_scroll; double offset_y_from_scroll; UiOverlayAction action; double start_x; double start_y; double start_pos_px; bool drag_update_started; std::unique_ptr< Position > earliest_obj_start_pos; Position fade_pos_at_start; std::unique_ptr< ArrangerObject > start_object; std::weak_ptr< ArrangerObject > prj_start_object; std::weak_ptr< ArrangerObject > hovered_object; bool start_object_was_selected; std::unique_ptr< ArrangerSelections > sel_at_start; std::unique_ptr< Region > region_at_start; std::unique_ptr< ArrangerSelections > sel_to_delete; Position start_pos; bool was_paused; Position playhead_pos_at_start; double curr_ticks_diff_from_start; double adj_ticks_diff; double last_adj_ticks_diff; Position curr_pos; Position end_pos; gboolean key_is_pressed; double hover_x; double hover_y; bool hovered; int n_press; std::shared_ptr< SnapGrid > snap_grid; int shift_held; int ctrl_held; int alt_held; gint64 last_frame_time; int visible_track_diff; int lane_diff; int visible_at_diff; int is_pinned; int resizing_range; int resizing_range_start; AutomationTrack *hovered_at; TrackLane * hovered_lane; Track * hovered_track; GdkTexture *symbolic_link_texture; GdkTexture *music_note_16th_texture; GdkTexture *fork_awesome_snowflake_texture; GdkTexture *media_playlist_repeat_texture; int region_icon_texture_size; GskRenderNode *loop_line_node; GskRenderNode *clip_start_line_node; GskRenderNode *cut_line_node; int hovered_note; int start_vel_val; int vel_diff; int hovered_chord_index; float fval_at_start; double dval_at_start; int last_playhead_px; bool redraw; graphene_rect_t last_rect; bool can_link; bool is_highlighted; GdkRectangle highlight_rect; GdkRectangle last_selection_rect; guint drag_start_btn; bool first_draw; double new_hadj_val; Transport::Display ruler_display; PangoLayoutUniquePtr vel_layout; PangoLayoutUniquePtr ap_layout; PangoLayoutUniquePtr audio_layout; PangoLayoutUniquePtr debug_layout; int queued_playhead_px; GtkPopoverMenu *popover_menu; guint unlisten_notes_timeout_id;} ArrangerWidget
A canvas widget for drawing and interacting with arranger objects.
Definition arranger.h:95
bool audio_arranger_widget_is_cursor_in_fade(const ArrangerWidget &self, double x, double y, bool fade_in, bool resize)
Returns whether the cursor is inside a fade area.
void audio_arranger_widget_fade_up(ArrangerWidget *self, double offset_y, bool fade_in)
Handle fade in/out curviness drag.
bool audio_arranger_widget_is_cursor_gain(const ArrangerWidget *self, double x, double y)
Returns whether the cursor touches the gain line.