## IpatchVBankInst IpatchVBankInst — VBank instrument item |

## Stability Level

Stable, unless otherwise indicated

## Synopsis

                        IpatchVBankInst;
    #define             IPATCH_VBANK_INST_NAME_SIZE
    IpatchVBankInst *   ipatch_vbank_inst_new               (void);
    #define             ipatch_vbank_inst_get_regions       (inst)
    IpatchVBankInst *   ipatch_vbank_inst_first             (IpatchIter *iter);
    IpatchVBankInst *   ipatch_vbank_inst_next              (IpatchIter *iter);
    void                ipatch_vbank_inst_new_region        (IpatchVBankInst *inst,
                                                             IpatchItem *item);
    void                ipatch_vbank_inst_set_midi_locale   (IpatchVBankInst *inst,
                                                             int bank,
                                                             int program);
    void                ipatch_vbank_inst_get_midi_locale   (IpatchVBankInst *inst,
                                                             int *bank,
                                                             int *program);
    int                 ipatch_vbank_inst_compare           (const IpatchVBankInst *p1,
                                                             const IpatchVBankInst *p2);

## Object Hierarchy

      GObject
       +----IpatchItem
             +----IpatchContainer
                   +----IpatchVBankInst

## Properties

      "bank"                     gint                  : Read / Write
      "name"                     gchar*                : Read / Write
      "program"                  gint                  : Read / Write

## Description

VBank instruments are children of IpatchVBank objects and define individual instruments mapped to MIDI bank/program numbers and which reference items in other instrument files.

## Details

### IpatchVBankInst

    typedef struct _IpatchVBankInst IpatchVBankInst;

### IPATCH_VBANK_INST_NAME_SIZE

    #define IPATCH_VBANK_INST_NAME_SIZE	64

Maximum length of a virtual bank instrument name.

### ipatch_vbank_inst_new ()

    IpatchVBankInst *   ipatch_vbank_inst_new               (void);

Create a new virtual bank instrument object.

Returns : | New VBank instrument with a reference count of 1. Caller owns the reference and removing it will destroy the item.

### ipatch_vbank_inst_get_regions()

    #define             ipatch_vbank_inst_get_regions(inst)

### ipatch_vbank_inst_first ()

    IpatchVBankInst *   ipatch_vbank_inst_first             (IpatchIter *iter);

Gets the first item in an instrument iterator. A convenience wrapper for `ipatch_iter_first()`.

`iter` : | Patch item iterator containing IpatchVBankInst items
Returns : | The first instrument in `iter` or `NULL` if empty.

### ipatch_vbank_inst_next ()

    IpatchVBankInst *   ipatch_vbank_inst_next              (IpatchIter *iter);

Gets the next item in an instrument iterator. A convenience wrapper for `ipatch_iter_next()`.

`iter` : | Patch item iterator containing IpatchVBankInst items
Returns : | The next instrument in `iter` or `NULL` if at the end of the list.

### ipatch_vbank_inst_new_region ()

    void                ipatch_vbank_inst_new_region        (IpatchVBankInst *inst,
                                                             IpatchItem *item);

A convenience function for creating a new virtual bank region, adding it to `inst` and setting the region's referenced item to `item`.

`inst` : | VBank instrument
`item` : | Referenced item for new region

### ipatch_vbank_inst_set_midi_locale ()

    void                ipatch_vbank_inst_set_midi_locale   (IpatchVBankInst *inst,
                                                             int bank,
                                                             int program);

Sets the MIDI locale of an instrument (bank and program numbers).

`inst` : | Virtual bank instrument to set MIDI locale of
`bank` : | MIDI bank number to assign to instrument
`program` : | MIDI program number to assign to instrument

### ipatch_vbank_inst_get_midi_locale ()

    void                ipatch_vbank_inst_get_midi_locale   (IpatchVBankInst *inst,
                                                             int *bank,
                                                             int *program);

Gets the MIDI locale of a virtual bank instrument (bank and program numbers).

`inst` : | Virtual bank instrument to get MIDI locale from
`bank` : | Location to store instrument's MIDI bank number or `NULL`
`program` : | Location to store instrument's MIDI program number or `NULL`

### ipatch_vbank_inst_compare ()

    int                 ipatch_vbank_inst_compare           (const IpatchVBankInst *p1,
                                                             const IpatchVBankInst *p2);

Virtual bank instrument comparison function for sorting. Compare two instruments 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 instrument in comparison
`p2` : | Second instrument 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 `"name"` property

      "name"                     gchar*                : Read / Write

Name.

Default value: NULL

### The `"program"` property

      "program"                  gint                  : Read / Write

MIDI program number.

Allowed values: [0,127]

Default value: 0

## See Also

#IpatchVBank