![]() |
![]() |
![]() |
libInstPatch Reference Manual | ![]() |
---|---|---|---|---|
IpatchSF2Zone; IpatchSF2ZoneClass; #define IPATCH_SF2_ZONE_GEN_AMT (zone, genid) #define IPATCH_SF2_ZONE_GEN_TEST_FLAG (zone, genid) #define IPATCH_SF2_ZONE_SET_FLAG (zone, genid) #define IPATCH_SF2_ZONE_CLEAR_FLAG (zone, genid) #define ipatch_sf2_zone_add_mod (zone, mod) IpatchSF2Zone* ipatch_sf2_zone_first (IpatchIter *iter); IpatchSF2Zone* ipatch_sf2_zone_next (IpatchIter *iter); void ipatch_sf2_zone_set_item (IpatchSF2Zone *zone, IpatchItem *item); IpatchItem* ipatch_sf2_zone_ref_item (IpatchSF2Zone *zone); IpatchItem* ipatch_sf2_zone_peek_item (IpatchSF2Zone *zone); gboolean ipatch_sf2_zone_get_gen (IpatchSF2Zone *zone, int genid, IpatchSF2GenAmount *out_amt); void ipatch_sf2_zone_set_gen (IpatchSF2Zone *zone, int genid, IpatchSF2GenAmount *amt); void ipatch_sf2_zone_unset_gen (IpatchSF2Zone *zone, int genid); guint ipatch_sf2_zone_gen_count (IpatchSF2Zone *zone); const char* ipatch_sf2_zone_genid_get_prop_name (guint genid); GParamSpec* ipatch_sf2_zone_genid_get_pspec (guint genid, gboolean ispreset); void ipatch_sf2_zone_copy_gen_array (IpatchSF2Zone *zone, IpatchSF2GenArray *array); void ipatch_sf2_zone_fill_gen_array (IpatchSF2Zone *zone, IpatchSF2GenArray *array); GSList* ipatch_sf2_zone_get_mods (IpatchSF2Zone *zone); void ipatch_sf2_zone_insert_mod (IpatchSF2Zone *zone, const IpatchSF2Mod *mod, int pos); void ipatch_sf2_zone_remove_mod (IpatchSF2Zone *zone, const IpatchSF2Mod *modvals); void ipatch_sf2_zone_set_mod (IpatchSF2Zone *zone, const IpatchSF2Mod *oldvals, const IpatchSF2Mod *newvals); guint ipatch_sf2_zone_mod_count (IpatchSF2Zone *zone); gboolean ipatch_sf2_zone_in_range (IpatchSF2Zone *zone, int note, int velocity); void ipatch_sf2_zone_class_install_gen_properties (GObjectClass *klass, gboolean ispreset); gboolean ipatch_sf2_zone_set_gen_property (IpatchSF2Zone *zone, guint property_id, const GValue *value, gboolean is_preset); gboolean ipatch_sf2_zone_get_gen_property (IpatchSF2Zone *zone, guint property_id, GValue *value, gboolean is_preset);
The SoundFont zone object defines a base class for preset zones (IpatchSF2PZone) and instrument zones (IpatchSF2IZone). A zone contains a list of generators (IpatchSF2Gen), modulators (IpatchSF2Mod) and a referenced item for the zone. Zones of type IpatchSF2PZone reference IpatchSF2Inst objects and IpatchSF2IZone type zones reference IpatchSF2Sample objects.
IpatchSF2Zone* ipatch_sf2_zone_first (IpatchIter *iter);
Gets the first item in a zone iterator. A convenience
wrapper for ipatch_iter_first()
.
iter : |
Patch item iterator containing IpatchSF2Zone items |
Returns : | The first zone in iter or NULL if empty.
|
IpatchSF2Zone* ipatch_sf2_zone_next (IpatchIter *iter);
Gets the next item in a zone iterator. A convenience wrapper
for ipatch_iter_next()
.
iter : |
Patch item iterator containing IpatchSF2Zone items |
Returns : | The next zone in iter or NULL if at the end of
the list.
|
void ipatch_sf2_zone_set_item (IpatchSF2Zone *zone, IpatchItem *item);
Sets the referenced item of a zone (a IpatchSF2Inst for preset zones, IpatchSF2Sample for instrument zones). The type specific item set routines for each zone type may be preferred, as this one doesn't do strict type checking. Note that once a zone has its item set it cannot revert to a global zone (because of multi-thread issues).
zone : |
Zone to set zone item of |
item : |
New item for zone to use |
IpatchItem* ipatch_sf2_zone_ref_item (IpatchSF2Zone *zone);
Gets the referenced item from a zone (a IpatchSF2Inst for preset zones,
IpatchSF2Sample for instrument zones). The type specific item set routines
for each zone type may be preferred, as this one doesn't do strict type
checking. The returned item's reference count is incremented and the caller
is responsible for unrefing it with g_object_unref()
.
zone : |
Zone to get referenced item of |
Returns : | Zone's referenced item or NULL if global zone. Remember to
unreference the item with g_object_unref() when done with it.
|
IpatchItem* ipatch_sf2_zone_peek_item (IpatchSF2Zone *zone);
Like ipatch_sf2_zone_ref_item()
but does not add a reference to
the returned item. This function should only be used if a reference
of the returned item is ensured or only the pointer value is of
interest.
zone : |
Zone to get referenced item of |
Returns : | Zone's referenced item or NULL if global zone. Remember that
the item has NOT been referenced.
|
gboolean ipatch_sf2_zone_get_gen (IpatchSF2Zone *zone, int genid, IpatchSF2GenAmount *out_amt);
Get a generator value from a zone
zone : |
Zone to get generator value from |
genid : |
Generator ID (IpatchSF2GenType) of value to get |
out_amt : |
Output: Pointer to store generator amount to |
Returns : | TRUE if generator is set in Zone or the generators are
stored as an array and FALSE if not set, in which case the value
stored to output_amt is the default value for the given generator
ID.
|
void ipatch_sf2_zone_set_gen (IpatchSF2Zone *zone, int genid, IpatchSF2GenAmount *amt);
Set a generator value in a zone.
Emits "prop_change_hook" and calls ipatch_item_changed()
.
zone : |
Zone to set generator in |
genid : |
Generator ID (IpatchSF2GenType) of generator to set |
amt : |
Value to set generator to |
void ipatch_sf2_zone_unset_gen (IpatchSF2Zone *zone, int genid);
Unsets a generator in a zone by removing it from the zone's generator list, thereby using its default value.
Emits "prop_change_hook" and calls ipatch_item_changed()
.
zone : |
Zone to unset generator in |
genid : |
Generator ID (IpatchSF2GenType) to unset |
guint ipatch_sf2_zone_gen_count (IpatchSF2Zone *zone);
Get count of "set" generators in a zone.
zone : |
SoundFont Zone |
Returns : | Count of generators. |
const char* ipatch_sf2_zone_genid_get_prop_name (guint genid);
Get the GObject property name for a given generator ID.
genid : |
Generator ID |
Returns : | Property name or NULL if no property name for genid .
The returned string is internal and should not be modified or freed.
|
GParamSpec* ipatch_sf2_zone_genid_get_pspec (guint genid, gboolean ispreset);
Get the parameter specification for a given generator ID.
void ipatch_sf2_zone_copy_gen_array (IpatchSF2Zone *zone, IpatchSF2GenArray *array);
Copies a zone's generators to a caller supplied generator array.
zone : |
Zone to get generators from |
array : |
Destination generator array to store to |
void ipatch_sf2_zone_fill_gen_array (IpatchSF2Zone *zone, IpatchSF2GenArray *array);
Copies a zone's "set" generators to a caller supplied generator array.
This function differs from ipatch_sf2_zone_copy_gen_array()
in that it
only copies generators that are set. It can be used to override values
in one array with set values in another.
zone : |
Zone to get generators from |
array : |
Destination generator array to store to |
GSList* ipatch_sf2_zone_get_mods (IpatchSF2Zone *zone);
Gets a list of modulators from a SoundFont zone. List should be freed with
ipatch_sf2_mod_list_free()
(free_mods set to TRUE
) when finished
with it.
zone : |
Zone to get modulators from |
Returns : | New list of modulators (IpatchSF2Mod) in zone or NULL if no
modulators. Remember to free it when finished.
|
void ipatch_sf2_zone_insert_mod (IpatchSF2Zone *zone, const IpatchSF2Mod *mod, int pos);
Inserts a modulator into a zones modulator list. Does not check for
duplicates! The modulator is not used directly, a new one is created and
the values in mod
are copied to it.
Emits changed signal on zone.
zone : |
Zone to insert into |
mod : |
Modulator values to insert (a new modulator is created and the values are copied to it) |
pos : |
Index position in zone's modulator list to insert (0 = first, < 0 = last) |
void ipatch_sf2_zone_remove_mod (IpatchSF2Zone *zone, const IpatchSF2Mod *modvals);
Remove a modulator from a zone. The modulator values in modvals
are used to search the modulator list in zone
. The first modulator
that matches all fields in modvals
is removed.
Emits changed signal on zone.
zone : |
Zone to remove modulator from |
modvals : |
Values of modulator to remove |
void ipatch_sf2_zone_set_mod (IpatchSF2Zone *zone, const IpatchSF2Mod *oldvals, const IpatchSF2Mod *newvals);
Sets the values of an existing modulator in a SoundFont zone. The zone
is searched for a modulator that matches the values in oldvals
. If a
modulator is found its values are set to those in newvals
. If it is not
found, nothing is done.
zone : |
Zone to set modulator of |
oldvals : |
Current values of modulator to set |
newvals : |
New modulator values |
guint ipatch_sf2_zone_mod_count (IpatchSF2Zone *zone);
Count number of modulators in a zone
zone : |
Zone to count modulators in |
Returns : | Count of modulators |
gboolean ipatch_sf2_zone_in_range (IpatchSF2Zone *zone, int note, int velocity);
Check if a key and velocity falls in a zone's ranges
void ipatch_sf2_zone_class_install_gen_properties (GObjectClass *klass, gboolean ispreset);
Installs generator properties for a class. Used internally by IpatchSF2Zone derived types.
gboolean ipatch_sf2_zone_set_gen_property (IpatchSF2Zone *zone, guint property_id, const GValue *value, gboolean is_preset);
Used internally by IpatchSF2Zone sub classes to set generator properties.
gboolean ipatch_sf2_zone_get_gen_property (IpatchSF2Zone *zone, guint property_id, GValue *value, gboolean is_preset);
Used internally by IpatchSF2Zone sub classes to get generator properties.