## IpatchDLS2Info IpatchDLS2Info — DLS version 2 info functions and structure |

## Stability Level

Stable, unless otherwise indicated

## Synopsis

    typedef             IpatchDLS2Info;
                        IpatchDLS2InfoBag;
    enum                IpatchDLS2InfoType;
    char *              ipatch_dls2_info_get                (IpatchDLS2Info *info,
                                                             guint32 fourcc);
    const char *        ipatch_dls2_info_peek               (IpatchDLS2Info *info,
                                                             guint32 fourcc);
    void                ipatch_dls2_info_set                (IpatchDLS2Info **info,
                                                             guint32 fourcc,
                                                             const char *value);
    void                ipatch_dls2_info_free               (IpatchDLS2Info *info);
    IpatchDLS2Info *    ipatch_dls2_info_duplicate          (IpatchDLS2Info *info);
    gboolean            ipatch_dls2_info_is_defined         (guint32 fourcc);
    void                ipatch_dls2_info_install_class_properties
                                                            (GObjectClass *obj_class);
    gboolean            ipatch_dls2_info_set_property       (IpatchDLS2Info **info_list,
                                                             guint property_id,
                                                             const GValue *value);
    gboolean            ipatch_dls2_info_get_property       (IpatchDLS2Info *info_list,
                                                             guint property_id,
                                                             GValue *value);
    void                ipatch_dls2_info_notify             (IpatchItem *item,
                                                             guint32 fourcc,
                                                             const GValue *new_value,
                                                             const GValue *old_value);
    IpatchDLS2InfoBag * ipatch_dls2_info_bag_new            (void);
    void                ipatch_dls2_info_bag_free           (IpatchDLS2InfoBag *bag);

## Description

Structure and functions used for storing DLS informational properties at many levels of the format.

## Details

### IpatchDLS2Info

    typedef GSList IpatchDLS2Info;

### IpatchDLS2InfoBag

    typedef struct {
      guint32 fourcc;		/* FOURCC int ID */
      char *value;			/* info string value */
    } IpatchDLS2InfoBag;

### enum IpatchDLS2InfoType

    typedef enum
    {
      IPATCH_DLS2_ARCHIVE_LOCATION = IPATCH_DLS_FOURCC_IARL,
      IPATCH_DLS2_ARTIST           = IPATCH_DLS_FOURCC_IART,
      IPATCH_DLS2_COMMISSIONED     = IPATCH_DLS_FOURCC_ICMS,
      IPATCH_DLS2_COMMENT          = IPATCH_DLS_FOURCC_ICMT,
      IPATCH_DLS2_COPYRIGHT        = IPATCH_DLS_FOURCC_ICOP,
      IPATCH_DLS2_DATE             = IPATCH_DLS_FOURCC_ICRD,
      IPATCH_DLS2_ENGINEER         = IPATCH_DLS_FOURCC_IENG,
      IPATCH_DLS2_GENRE            = IPATCH_DLS_FOURCC_IGNR,
      IPATCH_DLS2_KEYWORDS         = IPATCH_DLS_FOURCC_IKEY,
      IPATCH_DLS2_MEDIUM           = IPATCH_DLS_FOURCC_IMED,
      IPATCH_DLS2_NAME             = IPATCH_DLS_FOURCC_INAM,
      IPATCH_DLS2_PRODUCT          = IPATCH_DLS_FOURCC_IPRD,
      IPATCH_DLS2_SUBJECT          = IPATCH_DLS_FOURCC_ISBJ,
      IPATCH_DLS2_SOFTWARE         = IPATCH_DLS_FOURCC_ISFT,
      IPATCH_DLS2_SOURCE           = IPATCH_DLS_FOURCC_ISRC,
      IPATCH_DLS2_SOURCE_FORM      = IPATCH_DLS_FOURCC_ISRF,
      IPATCH_DLS2_TECHNICIAN       = IPATCH_DLS_FOURCC_ITCH
    } IpatchDLS2InfoType;

### ipatch_dls2_info_get ()

    char *              ipatch_dls2_info_get                (IpatchDLS2Info *info,
                                                             guint32 fourcc);

Gets the value of the info specified by the `fourcc` ID from an `info` list.

`info` : | DLS2 info list
`fourcc` : | FOURCC info ID
Returns : | Newly allocated info string value or `NULL` if the specified info is not set. Should be freed when no longer needed.

### ipatch_dls2_info_peek ()

    const char *        ipatch_dls2_info_peek               (IpatchDLS2Info *info,
                                                             guint32 fourcc);

Gets the value of the info specified by the `fourcc` ID from an `info` list. Like ipatch_dls2_info_get but returns the string value without duplicating it.

`info` : | DLS2 info list
`fourcc` : | FOURCC info ID
Returns : | Info string value or `NULL` if the specified info is not set. Value is internal and should not be modified or freed.

### ipatch_dls2_info_set ()

    void                ipatch_dls2_info_set                (IpatchDLS2Info **info,
                                                             guint32 fourcc,
                                                             const char *value);

Sets the info specified by the `fourcc` ID in an `info` list to a string `value`.

`info` : | DLS2 info list
`fourcc` : | FOURCC info ID
`value` : | String value to set info to or `NULL` to unset

### ipatch_dls2_info_free ()

    void                ipatch_dls2_info_free               (IpatchDLS2Info *info);

Free a DLS info list.

`info` : | DLS2 info list

### ipatch_dls2_info_duplicate ()

    IpatchDLS2Info *    ipatch_dls2_info_duplicate          (IpatchDLS2Info *info);

Duplicate a DLS2 info list.

`info` : | DLS2 info list to duplicate
Returns : | Newly created info list or `NULL` if `info` was NULL. Free it with `ipatch_dls2_info_free()` when finished with it.

### ipatch_dls2_info_is_defined ()

    gboolean            ipatch_dls2_info_is_defined         (guint32 fourcc);

Checks if a FOURCC INFO id is a defined INFO id.

`fourcc` : | FOURCC INFO id to check if defined
Returns : | `TRUE` if `fourcc` INFO id is defined, `FALSE` otherwise

### ipatch_dls2_info_install_class_properties ()

    void                ipatch_dls2_info_install_class_properties
                                                            (GObjectClass *obj_class);

Installs INFO properties for the supplied `obj_class`. Used for class construction of objects implementing IpatchDLS2InfoType properties.

`obj_class` : | GObjectClass to install INFO properties on

### ipatch_dls2_info_set_property ()

    gboolean            ipatch_dls2_info_set_property       (IpatchDLS2Info **info_list,
                                                             guint property_id,
                                                             const GValue *value);

A function used by object set_property methods that implement a IpatchDLS2Info list to set an INFO property.

`info_list` : | Pointer to a list of IpatchDLS2Info structures
`property_id` : | FOURCC INFO property id to set value of
`value` : | A string GValue to set INFO value to
Returns : | `TRUE` if `property_id` is a valid INFO id, `FALSE` otherwise

### ipatch_dls2_info_get_property ()

    gboolean            ipatch_dls2_info_get_property       (IpatchDLS2Info *info_list,
                                                             guint property_id,
                                                             GValue *value);

A function used by object set_property methods that implement a IpatchDLS2Info list to get an INFO property.

`info_list` : | A list of IpatchDLS2Info structures
`property_id` : | FOURCC INFO property id to get value of
`value` : | A string GValue to store the value of the info to
Returns : | `TRUE` if `property_id` is a valid INFO id, `FALSE` otherwise

### ipatch_dls2_info_notify ()

    void                ipatch_dls2_info_notify             (IpatchItem *item,
                                                             guint32 fourcc,
                                                             const GValue *new_value,
                                                             const GValue *old_value);

Notify a changed INFO property on `item` for the given fourcc ID. A convenience function to objects that implement a IpatchDLS2Info list.

`item` : | Item with INFO properties to notify property change on
`fourcc` : | FOURCC property ID of info that has changed
`new_value` : | New value assigned to the property
`old_value` : | Old value of property

### ipatch_dls2_info_bag_new ()

    IpatchDLS2InfoBag * ipatch_dls2_info_bag_new            (void);

Create a new DLS info bag structure.

Returns : | Newly allocated info bag.

### ipatch_dls2_info_bag_free ()

    void                ipatch_dls2_info_bag_free           (IpatchDLS2InfoBag *bag);

Free a DLS info bag allocated with `ipatch_dls2_info_bag_new()`.

`bag` : | Info bag structure to free