1 /*
2  * Copyright (C) 2019-2020 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  * Inspector section for tracks.
24  */
25 
26 #ifndef __GUI_WIDGETS_INSPECTOR_TRACK_H__
27 #define __GUI_WIDGETS_INSPECTOR_TRACK_H__
28 
29 #include <gtk/gtk.h>
30 
31 #define INSPECTOR_TRACK_WIDGET_TYPE \
32   (inspector_track_widget_get_type ())
33 G_DECLARE_FINAL_TYPE (
34   InspectorTrackWidget,
35   inspector_track_widget,
36   Z, INSPECTOR_TRACK_WIDGET,
37   GtkBox)
38 
39 typedef struct TracklistSelections
40   TracklistSelections;
41 typedef struct _TrackPropertiesExpanderWidget
42   TrackPropertiesExpanderWidget;
43 typedef struct _PortsExpanderWidget
44   PortsExpanderWidget;
45 typedef struct _TrackInputExpanderWidget
46   TrackInputExpanderWidget;
47 typedef struct _PluginStripExpanderWidget
48   PluginStripExpanderWidget;
49 typedef struct _FaderControlsExpanderWidget
50   FaderControlsExpanderWidget;
51 typedef struct _TextExpanderWidget
52   TextExpanderWidget;
53 typedef struct _ColorAreaWidget ColorAreaWidget;
54 typedef struct _ChannelSendsExpanderWidget
55   ChannelSendsExpanderWidget;
56 
57 /**
58  * @addtogroup widgets
59  *
60  * @{
61  */
62 
63 #define MW_TRACK_INSPECTOR \
64   MW_LEFT_DOCK_EDGE->track_inspector
65 
66 /**
67  * Inspector section for tracks.
68  */
69 typedef struct _InspectorTrackWidget
70 {
71   GtkBox             parent_instance;
72   TrackPropertiesExpanderWidget * track_info;
73 
74   TrackInputExpanderWidget * inputs;
75 
76   ChannelSendsExpanderWidget * sends;
77 
78   PortsExpanderWidget * outputs;
79 
80   /** Pan, fader, etc. */
81   PortsExpanderWidget * controls;
82 
83   PluginStripExpanderWidget * inserts;
84 
85   PluginStripExpanderWidget * midi_fx;
86 
87   FaderControlsExpanderWidget * fader;
88   TextExpanderWidget * comment;
89 
90   ColorAreaWidget *     color;
91 } InspectorTrackWidget;
92 
93 /**
94  * Shows the inspector page for the given tracklist
95  * selection.
96  *
97  * @param set_notebook_page Whether to set the
98  *   current left panel tab to the track page.
99  */
100 NONNULL
101 void
102 inspector_track_widget_show_tracks (
103   InspectorTrackWidget * self,
104   TracklistSelections *  tls,
105   bool                   set_notebook_page);
106 
107 /**
108  * Sets up the inspector track widget for the first
109  * time.
110  */
111 void
112 inspector_track_widget_setup (
113   InspectorTrackWidget * self,
114   TracklistSelections *  tls);
115 
116 InspectorTrackWidget *
117 inspector_track_widget_new (void);
118 
119 /**
120  * Prepare for finalization.
121  */
122 void
123 inspector_track_widget_tear_down (
124   InspectorTrackWidget * self);
125 
126 /**
127  * @}
128  */
129 
130 #endif
131