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  * Object to hold information for the Modulator track.
24  */
25 
26 #ifndef __AUDIO_MODULATOR_TRACK_H__
27 #define __AUDIO_MODULATOR_TRACK_H__
28 
29 #include <stdint.h>
30 
31 #include "audio/track.h"
32 #include "utils/types.h"
33 
34 /**
35  * @addtogroup audio
36  *
37  * @{
38  */
39 
40 #define P_MODULATOR_TRACK (TRACKLIST->modulator_track)
41 
42 /**
43  * Inserts and connects a Modulator to the Track.
44  *
45  * @param replace_mode Whether to perform the
46  *   operation in replace mode (replace current
47  *   modulator if true, not touching other
48  *   modulators, or push other modulators forward
49  *   if false).
50  */
51 void
52 modulator_track_insert_modulator (
53   Track *  self,
54   int      slot,
55   Plugin * modulator,
56   bool     replace_mode,
57   bool     confirm,
58   bool     gen_automatables,
59   bool     recalc_graph,
60   bool     pub_events);
61 
62 /**
63  * Removes a plugin at pos from the track.
64  *
65  * @param replacing Whether replacing the modulator.
66  *   If this is false, modulators after this slot
67  *   will be pushed back.
68  * @param deleting_modulator
69  * @param deleting_track If true, the automation
70  *   tracks associated with the plugin are not
71  *   deleted at this time.
72  * @param recalc_graph Recalculate mixer graph.
73  */
74 void
75 modulator_track_remove_modulator (
76   Track * self,
77   int     slot,
78   bool    replacing,
79   bool    deleting_modulator,
80   bool    deleting_track,
81   bool    recalc_graph);
82 
83 /**
84  * Creates the default modulator track.
85  */
86 Track *
87 modulator_track_default (
88   int   track_pos);
89 
90 /**
91  * Inits the modulator track.
92  */
93 void
94 modulator_track_init (
95   Track * track);
96 
97 /**
98  * @}
99  */
100 
101 #endif
102