1 /* 2 * Copyright (C) 2019 Alexandros Theodotou <alex at zrythm dot org> 3 * 4 * This file is part of Zrythm 5 * 6 * Zrythm is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU Affero General Public License as published by 8 * the Free Software Foundation, either version 3 of the License, or 9 * (at your option) any later version. 10 * 11 * Zrythm is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU Affero General Public License for more details. 15 * 16 * You should have received a copy of the GNU Affero General Public License 17 * along with Zrythm. If not, see <https://www.gnu.org/licenses/>. 18 */ 19 20 /** 21 * \file 22 * 23 * The ruler tracklist contains special tracks that 24 * are shown above the normal tracklist (Chord 25 * tracks, Marker tracks, etc.). 26 */ 27 28 #ifndef __GUI_WIDGETS_PINNED_TRACKLIST_H__ 29 #define __GUI_WIDGETS_PINNED_TRACKLIST_H__ 30 31 #include "audio/region.h" 32 #include "gui/widgets/region.h" 33 #include "utils/ui.h" 34 35 #include <gtk/gtk.h> 36 37 #define PINNED_TRACKLIST_WIDGET_TYPE \ 38 (pinned_tracklist_widget_get_type ()) 39 G_DECLARE_FINAL_TYPE ( 40 PinnedTracklistWidget, 41 pinned_tracklist_widget, 42 Z, PINNED_TRACKLIST_WIDGET, 43 GtkBox); 44 45 /** 46 * @addtogroup widgets 47 * 48 * @{ 49 */ 50 51 #define MW_PINNED_TRACKLIST \ 52 MW_TIMELINE_PANEL->pinned_tracklist 53 54 typedef struct Tracklist Tracklist; 55 typedef struct _TrackWidget TrackWidget; 56 57 /** 58 * The PinnedTracklistWidget contains special tracks 59 * (chord, marker, etc.) as thin boxes above the 60 * normal tracklist. 61 * 62 * The contents of each track will be shown in the 63 * PinnedTracklistArrangerWidget. 64 */ 65 typedef struct _PinnedTracklistWidget 66 { 67 GtkBox parent_instance; 68 69 /** The backend. */ 70 Tracklist * tracklist; 71 72 } PinnedTracklistWidget; 73 74 /** 75 * Gets TrackWidget hit at the given coordinates. 76 */ 77 TrackWidget * 78 pinned_tracklist_widget_get_hit_track ( 79 PinnedTracklistWidget * self, 80 double x, 81 double y); 82 83 /** 84 * Removes and readds the tracks. 85 */ 86 void 87 pinned_tracklist_widget_hard_refresh ( 88 PinnedTracklistWidget * self); 89 90 /** 91 * Sets up the PinnedTracklistWidget. 92 */ 93 void 94 pinned_tracklist_widget_setup ( 95 PinnedTracklistWidget * self, 96 Tracklist * tracklist); 97 98 /** 99 * @} 100 */ 101 102 #endif 103