## IpatchVBank IpatchVBank — Virtual bank object |

## Stability Level

Stable, unless otherwise indicated

## Synopsis

    #define             IPATCH_VBANK_INFO_COUNT
                        IpatchVBank;
    #define             IPATCH_VBANK_PARSER_VERSION
    IpatchVBank *       ipatch_vbank_new                    (void);
    #define             ipatch_vbank_get_insts              (vbank)
    IpatchVBankInst *   ipatch_vbank_find_inst              (IpatchVBank *vbank,
                                                             const char *name,
                                                             int bank,
                                                             int program,
                                                             const IpatchVBankInst *exclude);
    char *              ipatch_vbank_make_unique_name       (IpatchVBank *vbank,
                                                             const char *name,
                                                             const IpatchVBankInst *exclude);

## Object Hierarchy

      GObject
       +----IpatchItem
             +----IpatchContainer
                   +----IpatchBase
                         +----IpatchVBank

## Properties

      "author"                   gchar*                : Read / Write
      "comment"                  gchar*                : Read / Write
      "date"                     gchar*                : Read / Write
      "engine"                   gchar*                : Read / Write
      "name"                     gchar*                : Read / Write
      "parser-version"           gchar*                : Read / Write
      "require-version"          gchar*                : Read / Write

## Description

Virtual banks provide the capability of creating new instrument MIDI maps from components from other files of possibly different types.

## Details

### IPATCH_VBANK_INFO_COUNT

    #define IPATCH_VBANK_INFO_COUNT		7

Count of info strings

### IpatchVBank

    typedef struct _IpatchVBank IpatchVBank;

### IPATCH_VBANK_PARSER_VERSION

    #define IPATCH_VBANK_PARSER_VERSION	"1.0"

Current IVBank parser version.

### ipatch_vbank_new ()

    IpatchVBank *       ipatch_vbank_new                    (void);

Create a new virtual bank base object.

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

### ipatch_vbank_get_insts()

    #define             ipatch_vbank_get_insts(vbank)

### ipatch_vbank_find_inst ()

    IpatchVBankInst *   ipatch_vbank_find_inst              (IpatchVBank *vbank,
                                                             const char *name,
                                                             int bank,
                                                             int program,
                                                             const IpatchVBankInst *exclude);

Find an instrument by name or bank:preset MIDI numbers. If instrument `name` and `bank`:`program` are specified then match for either condition. If an instrument is found its reference count is incremented before it is returned. The caller is responsible for removing the reference with `g_object_unref()` when finished with it.

`vbank` : | VBank to search in
`name` : | Name of instrument to find or `NULL` to match any name
`bank` : | MIDI bank number of instrument to search for or -1 to not search by MIDI bank:program numbers
`program` : | MIDI program number of instrument to search for, only used if `bank` is 0-128
`exclude` : | An instrument to exclude from the search or `NULL`
Returns : | The matching instrument or `NULL` if not found. Remember to unref the item when finished with it.

### ipatch_vbank_make_unique_name ()

    char *              ipatch_vbank_make_unique_name       (IpatchVBank *vbank,
                                                             const char *name,
                                                             const IpatchVBankInst *exclude);

Generates a unique instrument name for `vbank`. The `name` parameter is used as a base and is modified, by appending a number, to make it unique (if necessary). The `exclude` parameter is used to exclude an existing `vbank` instrument from the search.

MT-Note: To ensure that an item is actually unique before being added to a VBank object, `ipatch_container_add_unique()` should be used.

`vbank` : | VBank item
`name` : | An initial name to use or NULL
`exclude` : | An item to exclude from search or NULL
Returns : | A new unique name which should be freed when finished with it.

## Property Details

### The `"author"` property

      "author"                   gchar*                : Read / Write

Author of file.

Default value: NULL

### The `"comment"` property

      "comment"                  gchar*                : Read / Write

Comments.

Default value: NULL

### The `"date"` property

      "date"                     gchar*                : Read / Write

Creation date.

Default value: NULL

### The `"engine"` property

      "engine"                   gchar*                : Read / Write

Synthesis engine.

Default value: NULL

### The `"name"` property

      "name"                     gchar*                : Read / Write

Descriptive name.

Default value: NULL

### The `"parser-version"` property

      "parser-version"           gchar*                : Read / Write

Parser version.

Default value: "1.0"

### The `"require-version"` property

      "require-version"          gchar*                : Read / Write

Required parser version.

Default value: "1.0"