IpatchSF2Preset

IpatchSF2Preset — SoundFont preset object

Synopsis




                    IpatchSF2Preset;
                    IpatchSF2PresetClass;
IpatchSF2Preset*    ipatch_sf2_preset_new               (void);
#define             ipatch_sf2_preset_get_zones         (preset)
IpatchSF2Preset*    ipatch_sf2_preset_first             (IpatchIter *iter);
IpatchSF2Preset*    ipatch_sf2_preset_next              (IpatchIter *iter);
void                ipatch_sf2_preset_new_zone          (IpatchSF2Preset *preset,
                                                         IpatchSF2Inst *inst);
gboolean            ipatch_sf2_preset_has_global_zone   (IpatchSF2Preset *preset);
void                ipatch_sf2_preset_set_name          (IpatchSF2Preset *preset,
                                                         const char *name);
char*               ipatch_sf2_preset_get_name          (IpatchSF2Preset *preset);
void                ipatch_sf2_preset_set_midi_locale   (IpatchSF2Preset *preset,
                                                         int bank,
                                                         int program);
void                ipatch_sf2_preset_get_midi_locale   (IpatchSF2Preset *preset,
                                                         int *bank,
                                                         int *program);
int                 ipatch_sf2_preset_compare           (const IpatchSF2Preset *p1,
                                                         const IpatchSF2Preset *p2);

Object Hierarchy


  GObject
   +----IpatchItem
         +----IpatchContainer
               +----IpatchSF2Preset

Properties


  "bank"                     gint                  : Read / Write
  "genre"                    guint                 : Read / Write
  "library"                  guint                 : Read / Write
  "morphology"               guint                 : Read / Write
  "name"                     gchararray            : Read / Write
  "percussion"               gboolean              : Read / Write
  "program"                  gint                  : Read / Write

Description

The SoundFont preset object is a container for IpatchSF2PZone objects. The amounts of generators (IpatchSF2Gen) in each zone offset the generators of the instruments (IpatchSF2Inst) they contain.

Details

IpatchSF2Preset

typedef struct _IpatchSF2Preset IpatchSF2Preset;


IpatchSF2PresetClass

typedef struct {
  IpatchContainerClass parent_class;
} IpatchSF2PresetClass;


ipatch_sf2_preset_new ()

IpatchSF2Preset*    ipatch_sf2_preset_new               (void);

Create a new SoundFont preset object.

Returns : New SoundFont preset with a reference count of 1. Caller owns the reference and removing it will destroy the item, unless another reference is added (if its parented for example).

ipatch_sf2_preset_get_zones()

#define             ipatch_sf2_preset_get_zones(preset)

preset :

ipatch_sf2_preset_first ()

IpatchSF2Preset*    ipatch_sf2_preset_first             (IpatchIter *iter);

Gets the first item in a preset iterator. A convenience wrapper for ipatch_iter_first().

iter : Patch item iterator containing IpatchSF2Preset items
Returns : The first preset in iter or NULL if empty.

ipatch_sf2_preset_next ()

IpatchSF2Preset*    ipatch_sf2_preset_next              (IpatchIter *iter);

Gets the next item in a preset iterator. A convenience wrapper for ipatch_iter_next().

iter : Patch item iterator containing IpatchSF2Preset items
Returns : The next preset in iter or NULL if at the end of the list.

ipatch_sf2_preset_new_zone ()

void                ipatch_sf2_preset_new_zone          (IpatchSF2Preset *preset,
                                                         IpatchSF2Inst *inst);

A convenience function for quickly creating a new preset zone, adding it to preset and setting the zone's referenced instrument to inst.

preset : SoundFont preset
inst : Referenced instrument for new zone or NULL to create a global zone

ipatch_sf2_preset_has_global_zone ()

gboolean            ipatch_sf2_preset_has_global_zone   (IpatchSF2Preset *preset);

Check if a preset has a global zone (zone without a referenced instrument).

preset : SoundFont preset
Returns : TRUE if preset has a global zone, FALSE otherwise

ipatch_sf2_preset_set_name ()

void                ipatch_sf2_preset_set_name          (IpatchSF2Preset *preset,
                                                         const char *name);

Sets the name of a SoundFont preset.

preset : Preset to set name of
name : Value to set name to

ipatch_sf2_preset_get_name ()

char*               ipatch_sf2_preset_get_name          (IpatchSF2Preset *preset);

Gets the name of a SoundFont preset.

preset : Preset to get name of
Returns : Name of preset or NULL if not set. String value should be freed when finished with it.

ipatch_sf2_preset_set_midi_locale ()

void                ipatch_sf2_preset_set_midi_locale   (IpatchSF2Preset *preset,
                                                         int bank,
                                                         int program);

Sets the MIDI locale of a preset (bank and program numbers).

preset : Preset to set MIDI locale of
bank : MIDI bank number to assign to preset
program : MIDI program number to assign to preset

ipatch_sf2_preset_get_midi_locale ()

void                ipatch_sf2_preset_get_midi_locale   (IpatchSF2Preset *preset,
                                                         int *bank,
                                                         int *program);

Gets the MIDI locale of a SoundFont preset (bank and program numbers).

preset : Preset to get MIDI locale from
bank : Location to store preset's MIDI bank number or NULL
program : Location to store preset's MIDI program number or NULL

ipatch_sf2_preset_compare ()

int                 ipatch_sf2_preset_compare           (const IpatchSF2Preset *p1,
                                                         const IpatchSF2Preset *p2);

Preset comparison function for sorting. Compare two presets by their MIDI bank:program numbers. Note that this function is compatible with GCompareFunc and can therefore be used with g_list_sort, etc.

p1 : First preset in comparison
p2 : Second preset in comparison
Returns : Comparison result that is less than, equal to, or greater than zero if p1 is found, respectively, to be less than, to match, or be greater than p2.

Property Details

The "bank" property

  "bank"                     gint                  : Read / Write

MIDI bank number

Allowed values: [0,128]

Default value: 0


The "genre" property

  "genre"                    guint                 : Read / Write

Genre (unused)

Default value: 0


The "library" property

  "library"                  guint                 : Read / Write

Library (unused)

Default value: 0


The "morphology" property

  "morphology"               guint                 : Read / Write

Morphology (unused)

Default value: 0


The "name" property

  "name"                     gchararray            : Read / Write

Name of preset

Default value: NULL


The "percussion" property

  "percussion"               gboolean              : Read / Write

Percussion preset?.

Default value: FALSE


The "program" property

  "program"                  gint                  : Read / Write

MIDI program number.

Allowed values: [0,127]

Default value: 0

See Also

IpatchSF2Inst, IpatchSF2PZone