/usr/include/libinstpatch-1.0/libinstpatch/IpatchSF2Mod.h is in libinstpatch-dev 1.0.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | /*
* libInstPatch
* Copyright (C) 1999-2010 Joshua "Element" Green <jgreen@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Moderal Public License
* as published by the Free Software Foundation; version 2.1
* of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Moderal Public License for more details.
*
* You should have received a copy of the GNU Moderal Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA or on the web at http://www.gnu.org.
*/
/**
* SECTION: IpatchSF2Mod
* @short_description: SoundFont modulators
* @see_also:
* @stability: Stable
*
* SoundFont modulators are used to define real time MIDI effect controls.
*/
#ifndef __IPATCH_SF2_MOD_H__
#define __IPATCH_SF2_MOD_H__
#include <glib.h>
#include <glib-object.h>
#include <libinstpatch/IpatchItem.h>
/* forward type declarations */
typedef struct _IpatchSF2Mod IpatchSF2Mod;
typedef GSList IpatchSF2ModList;
/* IpatchSF2Mod has a glib boxed type */
#define IPATCH_TYPE_SF2_MOD (ipatch_sf2_mod_get_type ())
#define IPATCH_TYPE_SF2_MOD_LIST (ipatch_sf2_mod_list_get_type ())
/* modulator structure */
struct _IpatchSF2Mod
{
guint16 src; /* source modulator (MIDI controller, etc) */
guint16 dest; /* destination generator */
gint16 amount; /* degree of modulation */
guint16 amtsrc; /* second source controls amount of first */
guint16 trans; /* transform function applied to source */
};
/* Compare two modulators to see if they are identical and
can be combined (all fields except amount must be identical).
Returns TRUE if identical, FALSE otherwise */
#define IPATCH_SF2_MOD_ARE_IDENTICAL(a, b) \
((a)->src == (b)->src && (a)->dest == (b)->dest \
&& (a)->amtsrc == (b)->amtsrc && (a)->trans == (b)->trans)
/* like IPATCH_SF2_MOD_ARE_IDENTICAL but also checks if amounts are
identical */
#define IPATCH_SF2_MOD_ARE_IDENTICAL_AMOUNT(a, b) \
((a)->src == (b)->src && (a)->dest == (b)->dest \
&& (a)->amtsrc == (b)->amtsrc && (a)->trans == (b)->trans \
&& (a)->amount == (b)->amount)
/* modulator flags */
typedef enum
{
IPATCH_SF2_MOD_MASK_CONTROL = 0x007F,
IPATCH_SF2_MOD_MASK_CC = 0x0080,
IPATCH_SF2_MOD_MASK_DIRECTION = 0x0100,
IPATCH_SF2_MOD_MASK_POLARITY = 0x0200,
IPATCH_SF2_MOD_MASK_TYPE = 0xFC00
} IpatchSF2ModFieldMasks;
typedef enum
{
IPATCH_SF2_MOD_SHIFT_CONTROL = 0,
IPATCH_SF2_MOD_SHIFT_CC = 7,
IPATCH_SF2_MOD_SHIFT_DIRECTION = 8,
IPATCH_SF2_MOD_SHIFT_POLARITY = 9,
IPATCH_SF2_MOD_SHIFT_TYPE = 10
} IpatchSF2ModFieldShifts;
typedef enum
{
IPATCH_SF2_MOD_CONTROL_NONE = 0,
IPATCH_SF2_MOD_CONTROL_NOTE_ON_VELOCITY = 2,
IPATCH_SF2_MOD_CONTROL_NOTE_NUMBER = 3,
IPATCH_SF2_MOD_CONTROL_POLY_PRESSURE = 10,
IPATCH_SF2_MOD_CONTROL_CHAN_PRESSURE = 13,
IPATCH_SF2_MOD_CONTROL_PITCH_WHEEL = 14,
IPATCH_SF2_MOD_CONTROL_BEND_RANGE = 16
} IpatchSF2ModControl;
typedef enum
{
IPATCH_SF2_MOD_CC_GENERAL = (0 << IPATCH_SF2_MOD_SHIFT_CC),
IPATCH_SF2_MOD_CC_MIDI = (1 << IPATCH_SF2_MOD_SHIFT_CC)
} IpatchSF2ModControlPalette;
typedef enum
{
IPATCH_SF2_MOD_DIRECTION_POSITIVE = (0 << IPATCH_SF2_MOD_SHIFT_DIRECTION),
IPATCH_SF2_MOD_DIRECTION_NEGATIVE = (1 << IPATCH_SF2_MOD_SHIFT_DIRECTION)
} IpatchSF2ModDirection;
typedef enum
{
IPATCH_SF2_MOD_POLARITY_UNIPOLAR = (0 << IPATCH_SF2_MOD_SHIFT_POLARITY),
IPATCH_SF2_MOD_POLARITY_BIPOLAR = (1 << IPATCH_SF2_MOD_SHIFT_POLARITY)
} IpatchSF2ModPolarity;
typedef enum
{
IPATCH_SF2_MOD_TYPE_LINEAR = (0 << IPATCH_SF2_MOD_SHIFT_TYPE),
IPATCH_SF2_MOD_TYPE_CONCAVE = (1 << IPATCH_SF2_MOD_SHIFT_TYPE),
IPATCH_SF2_MOD_TYPE_CONVEX = (2 << IPATCH_SF2_MOD_SHIFT_TYPE),
IPATCH_SF2_MOD_TYPE_SWITCH = (3 << IPATCH_SF2_MOD_SHIFT_TYPE)
} IpatchSF2ModType;
typedef enum
{
IPATCH_SF2_MOD_TRANSFORM_LINEAR = 0
} IpatchSF2ModTransform;
/* flags for ipatch_sf2_mod_class_set_mods() */
typedef enum
{
IPATCH_SF2_MOD_NO_DUPLICATE = 1 << 0, /* don't duplicate mod list (owned!) */
IPATCH_SF2_MOD_NO_NOTIFY = 1 << 1 /* don't do item property notify */
} IpatchSF2ModFlags;
GType ipatch_sf2_mod_get_type (void);
GType ipatch_sf2_mod_list_get_type (void);
IpatchSF2Mod *ipatch_sf2_mod_new (void);
void ipatch_sf2_mod_free (IpatchSF2Mod *mod);
IpatchSF2Mod *ipatch_sf2_mod_duplicate (const IpatchSF2Mod *mod);
GSList *ipatch_sf2_mod_list_duplicate (const GSList *list);
GSList *ipatch_sf2_mod_list_override (const GSList *alist, const GSList *blist,
gboolean copy);
void ipatch_sf2_mod_list_boxed_free (GSList *list);
GSList *ipatch_sf2_mod_list_insert (GSList *mods, const IpatchSF2Mod *modvals,
int pos);
GSList *ipatch_sf2_mod_list_remove (GSList *mods, const IpatchSF2Mod *modvals,
gboolean *changed);
gboolean ipatch_sf2_mod_list_change (GSList *mods, const IpatchSF2Mod *oldvals,
const IpatchSF2Mod *newvals);
GSList *ipatch_sf2_mod_list_offset (const GSList *alist, const GSList *blist);
void ipatch_sf2_mod_list_free (GSList *list, gboolean free_mods);
G_CONST_RETURN GSList *ipatch_sf2_mod_list_get_default (void);
#endif
|