Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
tracklist.h
1// SPDX-FileCopyrightText: © 2019-2021, 2023 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#ifndef __GUI_WIDGETS_TRACKLIST_H__
5#define __GUI_WIDGETS_TRACKLIST_H__
6
7#include "common/utils/types.h"
8#include "gui/backend/gtk_widgets/gtk_wrapper.h"
9
10#define USE_WIDE_HANDLE 1
11
12#define TRACKLIST_WIDGET_TYPE (tracklist_widget_get_type ())
13G_DECLARE_FINAL_TYPE (TracklistWidget, tracklist_widget, Z, TRACKLIST_WIDGET, GtkBox)
14
15
20
21#define MW_TRACKLIST MW_TIMELINE_PANEL->tracklist
22
23TYPEDEF_STRUCT_UNDERSCORED (TrackWidget);
24TYPEDEF_STRUCT_UNDERSCORED (DragDestBoxWidget);
25TYPEDEF_STRUCT_UNDERSCORED (ChordTrackWidget);
26class Tracklist;
27TYPEDEF_STRUCT_UNDERSCORED (AddTrackMenuButtonWidget);
28
37typedef struct _TracklistWidget
38{
39 GtkBox parent_instance;
40
42 GtkScrolledWindow * unpinned_scroll;
43
44 gulong unpinned_scroll_vall_changed_handler_id;
45
48 gulong unpinned_scroll_scroll_down_id;
49 double scroll_speed;
50
52 GtkBox * pinned_box;
53
55 GtkBox * unpinned_box;
56
62
66 Tracklist * tracklist;
67
68 AddTrackMenuButtonWidget * channel_add;
69
72 GtkSizeGroup * pinned_size_group;
73 GtkSizeGroup * unpinned_size_group;
74
76 GdkRectangle last_allocation;
77
78 bool setup;
79
80 double hover_y;
82
86void
87tracklist_widget_setup (TracklistWidget * self, Tracklist * tracklist);
88
92void
94
99void
101
105GMenu *
107
113
117void
119 TracklistWidget * self,
120 GtkEventControllerScroll * scroll_controller,
121 double dy);
122
126void
128
132void
134
138void
140
144
145#endif
void tracklist_widget_handle_vertical_zoom_scroll(TracklistWidget *self, GtkEventControllerScroll *scroll_controller, double dy)
Handle ctrl+shift+scroll.
void tracklist_widget_soft_refresh(TracklistWidget *self)
Refreshes each track without recreating it.
void tracklist_widget_set_unpinned_scroll_start_y(TracklistWidget *self, int y)
Updates the scroll adjustment.
GMenu * tracklist_widget_generate_add_track_menu(void)
Generates a menu for adding tracks to the tracklist.
TrackWidget * tracklist_widget_get_hit_track(TracklistWidget *self, double x, double y)
Gets hit TrackWidget and the given coordinates.
void tracklist_widget_tear_down(TracklistWidget *self)
Prepare for finalization.
void tracklist_widget_update_track_visibility(TracklistWidget *self)
Makes sure all the tracks for channels marked as visible are visible.
void tracklist_widget_setup(TracklistWidget *self, Tracklist *tracklist)
Sets up the TracklistWidget.
void tracklist_widget_hard_refresh(TracklistWidget *self)
Deletes all tracks and re-adds them.
struct _TrackWidget { GtkWidget parent_instance; GtkBox *main_box; GtkBox *group_colors_box; GtkGestureDrag * drag; GtkGestureClick *click; GtkGestureClick *right_click; int dragged; int n_press; bool bg_hovered; bool color_area_hovered; bool icon_hovered; int resize; int resizing; TrackWidgetResizeTarget resize_target_type; void *resize_target; Track *track; int ctrl_held_at_start; GtkBox *highlight_top_box; GtkBox *highlight_bot_box; TrackWidgetHighlight highlight_loc; int selected_in_dnd; double start_x; double start_y; double last_offset_y; double last_x; double last_y; CustomButtonWidget *last_hovered_btn; int button_pressed; CustomButtonWidget *clicked_button; AutomationModeWidget *clicked_am; TrackCanvasWidget *canvas; std::vector< std::unique_ptr< CustomButtonWidget > > top_buttons; std::vector< std::unique_ptr< CustomButtonWidget > > bot_buttons; MeterWidget *meter_l; MeterWidget *meter_r; char *tooltip_text; SteadyTimePoint last_midi_out_trigger_time; int redraw; bool was_armed; cairo_t * cached_cr; cairo_surface_t *cached_surface; GtkPopoverMenu *popover_menu; GtkPopover * track_name_popover; FaderButtonsWidget *fader_buttons_for_popover;} TrackWidget
The TrackWidget is split into 3 parts.
Definition track.h:107
DnD destination box used by mixer and tracklist widgets.
The TracklistWidget holds all the Track's in the Project.
Definition tracklist.h:38
GtkBox * pinned_box
Box to hold pinned tracks.
Definition tracklist.h:52
gulong unpinned_scroll_scroll_up_id
For DND autoscroll.
Definition tracklist.h:47
GdkRectangle last_allocation
Cache.
Definition tracklist.h:76
GtkScrolledWindow * unpinned_scroll
The scrolled window for unpinned tracks.
Definition tracklist.h:42
GtkBox * unpinned_box
Box inside unpinned scroll.
Definition tracklist.h:55
Tracklist * tracklist
Internal tracklist.
Definition tracklist.h:66
GtkSizeGroup * pinned_size_group
Size group to set the pinned track box and the pinned timeline to the same height.
Definition tracklist.h:72
DragDestBoxWidget * ddbox
Widget for drag and dropping plugins in to create new tracks.
Definition tracklist.h:61