1 /*
2  * Copyright (C) 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  * Channel sends.
24  */
25 
26 #ifndef __GUI_WIDGETS_CHANNEL_SENDS_EXPANDER_H__
27 #define __GUI_WIDGETS_CHANNEL_SENDS_EXPANDER_H__
28 
29 #include "gui/widgets/expander_box.h"
30 
31 #include <gtk/gtk.h>
32 
33 #define CHANNEL_SENDS_EXPANDER_WIDGET_TYPE \
34   (channel_sends_expander_widget_get_type ())
35 G_DECLARE_FINAL_TYPE (
36   ChannelSendsExpanderWidget,
37   channel_sends_expander_widget,
38   Z, CHANNEL_SENDS_EXPANDER_WIDGET,
39   ExpanderBoxWidget);
40 
41 typedef struct Track Track;
42 typedef struct _ChannelSendWidget ChannelSendWidget;
43 
44 /**
45  * @addtogroup widgets
46  *
47  * @{
48  */
49 
50 typedef enum ChannelSendsExpanderPosition
51 {
52   CSE_POSITION_CHANNEL,
53   CSE_POSITION_INSPECTOR,
54 } ChannelSendsExpanderPosition;
55 
56 /**
57  * A TwoColExpanderBoxWidget for showing the ports
58  * in the InspectorWidget.
59  */
60 typedef struct _ChannelSendsExpanderWidget
61 {
62   ExpanderBoxWidget parent_instance;
63 
64   ChannelSendsExpanderPosition position;
65 
66   /** Scrolled window for the vbox inside. */
67   GtkScrolledWindow * scroll;
68   GtkViewport *     viewport;
69 
70   /** VBox containing each slot. */
71   GtkBox *          box;
72 
73   /** 1 box for each item. */
74   GtkBox *          strip_boxes[STRIP_SIZE];
75 
76   /** Send slots. */
77   ChannelSendWidget * slots[STRIP_SIZE];
78 
79   /** Owner track. */
80   Track *           track;
81 } ChannelSendsExpanderWidget;
82 
83 /**
84  * Refreshes each field.
85  */
86 void
87 channel_sends_expander_widget_refresh (
88   ChannelSendsExpanderWidget * self);
89 
90 /**
91  * Sets up the ChannelSendsExpanderWidget.
92  */
93 void
94 channel_sends_expander_widget_setup (
95   ChannelSendsExpanderWidget * self,
96   ChannelSendsExpanderPosition position,
97   Track *                      track);
98 
99 /**
100  * @}
101  */
102 
103 #endif
104