Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
timeline_arranger.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2018-2022, 2024 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
9
10#ifndef __GUI_WIDGETS_TIMELINE_ARRANGER_H__
11#define __GUI_WIDGETS_TIMELINE_ARRANGER_H__
12
13#include "gui/backend/gtk_widgets/arranger.h"
14
20
21#define MW_TIMELINE (MW_TIMELINE_PANEL->timeline)
22#define MW_PINNED_TIMELINE (MW_TIMELINE_PANEL->pinned_timeline)
23
25timeline_arranger_widget_get_cursor (ArrangerWidget * self, Tool tool);
26
27void
28timeline_arranger_widget_snap_range_r (ArrangerWidget * self, Position * pos);
29
33TrackLane *
35
39Track *
41
45AutomationTrack *
47
52void
54
66template <FinalRegionSubclass RegionT>
67void
69 ArrangerWidget * self,
70 Track * track,
71 std::conditional_t<
72 LaneOwnedRegionSubclass<RegionT>,
73 TrackLaneImpl<RegionT> *,
74 std::nullptr_t> lane,
75 AutomationTrack * at,
76 const Position * pos);
77
84void
86 ArrangerWidget * self,
87 Track * track,
88 double y,
89 const Position * pos);
90
96void
98 ArrangerWidget * self,
99 Track * track,
100 const Position * pos);
101
107void
109 ArrangerWidget * self,
110 Track * track,
111 const Position * pos);
112
117void
119
125int
127 ArrangerWidget * self,
128 const int vis_track_diff);
129
138int
140 ArrangerWidget * self,
141 const int diff);
142
149void
151
155void
157
163GMenu *
165 ArrangerWidget * self,
166 double x,
167 double y);
168
174void
176 ArrangerWidget * self,
177 double offset_y,
178 bool fade_in);
179
183void
185
186void
187timeline_arranger_on_drag_end (ArrangerWidget * self);
188
189extern template void
192 Track *,
193 TrackLaneImpl<MidiRegion> *,
194 AutomationTrack *,
195 const Position *);
196extern template void
199 Track *,
200 TrackLaneImpl<AudioRegion> *,
201 AutomationTrack *,
202 const Position *);
203extern template void
206 Track *,
207 std::nullptr_t,
208 AutomationTrack *,
209 const Position *);
210extern template void
213 Track *,
214 std::nullptr_t,
215 AutomationTrack *,
216 const Position *);
217
221
222#endif
ArrangerCursor
Definition arranger.h:30
void timeline_arranger_widget_create_region(ArrangerWidget *self, Track *track, std::conditional_t< LaneOwnedRegionSubclass< RegionT >, TrackLaneImpl< RegionT > *, std::nullptr_t > lane, AutomationTrack *at, const Position *pos)
Create a Region at the given Position in the given Track's given TrackLane.
void timeline_arranger_widget_set_select_type(ArrangerWidget *self, double y)
Determines the selection time (objects/range) and sets it.
GMenu * timeline_arranger_widget_gen_context_menu(ArrangerWidget *self, double x, double y)
Generate a context menu at x, y.
TrackLane * timeline_arranger_widget_get_track_lane_at_y(ArrangerWidget *self, double y)
Gets hit TrackLane at y.
void timeline_arranger_widget_create_marker(ArrangerWidget *self, Track *track, const Position *pos)
Create a Marker at the given Position in the given Track.
void timeline_arranger_widget_set_cut_lines_visible(ArrangerWidget *self)
Hides the cut dashed line from hovered regions and redraws them.
AutomationTrack * timeline_arranger_widget_get_at_at_y(ArrangerWidget *self, double y)
Returns the hit AutomationTrack at y.
void timeline_arranger_setup_drag_dest(ArrangerWidget *self)
Sets up the timeline arranger as a drag dest.
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
int timeline_arranger_move_regions_to_new_tracks(ArrangerWidget *self, const int vis_track_diff)
Move the selected Regions to the new Track.
void timeline_arranger_widget_create_chord_or_scale(ArrangerWidget *self, Track *track, double y, const Position *pos)
Wrapper for timeline_arranger_widget_create_chord() or timeline_arranger_widget_create_scale().
void timeline_arranger_widget_scroll_to(ArrangerWidget *self, Position *pos)
Scroll to the given position.
void timeline_arranger_widget_fade_up(ArrangerWidget *self, double offset_y, bool fade_in)
Fade up/down.
void timeline_arranger_widget_create_scale(ArrangerWidget *self, Track *track, const Position *pos)
Create a ScaleObject at the given Position in the given Track.
Track * timeline_arranger_widget_get_track_at_y(ArrangerWidget *self, double y)
Gets the Track at y.
void timeline_arranger_widget_remove_children(ArrangerWidget *self)
To be called when pinning/unpinning.
int timeline_arranger_move_regions_to_new_lanes(ArrangerWidget *self, const int diff)
Move the selected Regions to new Lanes.