81c9f76c70c69d4f1c15e5d115f51a1bda8b7d42
[ardour.git] / libs / fluidsynth / src / fluid_mod.h
1 /* FluidSynth - A Software Synthesizer
2  *
3  * Copyright (C) 2003  Peter Hanappe and others.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public License
7  * as published by the Free Software Foundation; either version 2 of
8  * the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the Free
17  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  * 02110-1301, USA
19  */
20
21 #ifndef _FLUID_MOD_H
22 #define _FLUID_MOD_H
23
24 #include "fluidsynth_priv.h"
25 #include "fluid_conv.h"
26
27 void fluid_mod_clone(fluid_mod_t* mod, fluid_mod_t* src);
28 fluid_real_t fluid_mod_get_value(fluid_mod_t* mod, fluid_channel_t* chan, fluid_voice_t* voice);
29 void fluid_dump_modulator(fluid_mod_t * mod);
30
31 #define fluid_mod_has_source(mod,cc,ctrl)  \
32 ( ((((mod)->src1 == ctrl) && (((mod)->flags1 & FLUID_MOD_CC) != 0) && (cc != 0)) \
33    || ((((mod)->src1 == ctrl) && (((mod)->flags1 & FLUID_MOD_CC) == 0) && (cc == 0)))) \
34 || ((((mod)->src2 == ctrl) && (((mod)->flags2 & FLUID_MOD_CC) != 0) && (cc != 0)) \
35     || ((((mod)->src2 == ctrl) && (((mod)->flags2 & FLUID_MOD_CC) == 0) && (cc == 0)))))
36
37 #define fluid_mod_has_dest(mod,gen)  ((mod)->dest == gen)
38
39
40 #endif /* _FLUID_MOD_H */