IpatchDLS2

IpatchDLS2 — DLS version 2 instrument file object

Stability Level

Stable, unless otherwise indicated

Functions

Properties

char * archive-location Read / Write
char * artist Read / Write
char * comment Read / Write
char * commissioned Read / Write
char * copyright Read / Write
char * date Read / Write
char * engineer Read / Write
char * genre Read / Write
char * keywords Read / Write
char * medium Read / Write
char * name Read / Write
char * product Read / Write
char * software Read / Write
char * source Read / Write
char * source-form Read / Write
char * subject Read / Write
char * technician Read / Write
char * version Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── IpatchItem
        ╰── IpatchContainer
            ╰── IpatchBase
                ╰── IpatchDLS2
                    ╰── IpatchGig

Description

Object type for DLS version 2 format instruments.

Functions

ipatch_dls2_new ()

IpatchDLS2 *
ipatch_dls2_new (void);

Create a new DLS base object.

Returns

New DLS base object with a reference count of 1. Caller owns the reference and removing it will destroy the item.


ipatch_dls2_get_insts()

#define             ipatch_dls2_get_insts(dls)

ipatch_dls2_get_samples()

#define             ipatch_dls2_get_samples(dls)

ipatch_dls2_set_file ()

void
ipatch_dls2_set_file (IpatchDLS2 *dls,
                      IpatchDLSFile *file);

Sets the file object of a DLS object. DLS files are kept open for sample data that references the file. This function sets a DLS object's authoritive file. A convenience function, as ipatch_base_set_file() does the same thing (albeit without more specific type casting).

Parameters

dls

DLS to set file object of

 

file

File object to use with the DLS object

 

ipatch_dls2_get_file ()

IpatchDLSFile *
ipatch_dls2_get_file (IpatchDLS2 *dls);

Gets the file object of a DLS. The returned DLS file object's reference count has been incremented. The caller owns the reference and is responsible for removing it with g_object_unref. A convenience function as ipatch_base_get_file() does the same thing (albeit without more specific type casting).

Parameters

dls

DLS object to get file object of

 

Returns

The DLS file object or NULL if dls is not open. Remember to unref the file object with g_object_unref() when done with it.

[transfer full]


ipatch_dls2_get_info ()

char *
ipatch_dls2_get_info (IpatchDLS2 *dls,
                      guint32 fourcc);

Get a DLS info string by FOURCC integer ID (integer representation of a 4 character RIFF chunk ID, see IpatchRiff).

Parameters

dls

DLS to get info from

 

fourcc

FOURCC integer id of INFO to get

 

Returns

New allocated info string value or NULL if no info with the given fourcc ID. String should be freed when finished with it.


ipatch_dls2_set_info ()

void
ipatch_dls2_set_info (IpatchDLS2 *dls,
                      guint32 fourcc,
                      const char *val);

Sets an INFO value in a DLS object.

Emits changed signal on DLS object.

Parameters

dls

DLS to set info of

 

fourcc

FOURCC integer ID of INFO to set

 

val

Value to set info to or NULL to unset (clear) info.

[nullable]

ipatch_dls2_make_unique_name ()

char *
ipatch_dls2_make_unique_name (IpatchDLS2 *dls,
                              GType child_type,
                              const char *name,
                              const IpatchItem *exclude);

Generates a unique name for the given child_type in dls . 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 dls child item from the search.

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

Parameters

dls

DLS object

 

child_type

A child type of dls to search for a unique name in

 

name

An initial name to use or NULL.

[nullable]

exclude

An item to exclude from search or NULL.

[nullable]

Returns

A new unique name which should be freed when finished with it.


ipatch_dls2_find_inst ()

IpatchDLS2Inst *
ipatch_dls2_find_inst (IpatchDLS2 *dls,
                       const char *name,
                       int bank,
                       int program,
                       const IpatchDLS2Inst *exclude);

Find a instrument by name or bank:program MIDI numbers. If instrument name and bank :program are specified then match for either condition. If a 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.

Parameters

dls

DLS object to search in

 

name

Name of instrument to find or NULL to match any name.

[nullable]

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

A instrument to exclude from the search or NULL.

[nullable]

Returns

The matching instrument or NULL if not found. Remember to unref the item when finished with it.

[transfer full]


ipatch_dls2_find_sample ()

IpatchDLS2Sample *
ipatch_dls2_find_sample (IpatchDLS2 *dls,
                         const char *name,
                         const IpatchDLS2Sample *exclude);

Find a sample by name in a SoundFont. If a sample 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.

Parameters

dls

DLS object to search in

 

name

Name of sample to find

 

exclude

A sample to exclude from the search or NULL.

[nullable]

Returns

The matching sample or NULL if not found. Remember to unref the item when finished with it.

[transfer full]


ipatch_dls2_get_region_references ()

IpatchList *
ipatch_dls2_get_region_references (IpatchDLS2Sample *sample);

Get list of regions referencing an IpatchDLS2Sample.

Parameters

sample

Sample to locate referencing regions of.

 

Returns

New item list containing IpatchDLS2Region objects that refer to sample . The returned list has a reference count of 1 which the caller owns, unreference it when done.

[transfer full]

Types and Values

enum IpatchDLS2Flags

Members

IPATCH_DLS2_VERSION_SET

Set if the ms_version/ls_version values are valid.

 

IPATCH_DLS2_UNUSED_FLAG_SHIFT

#define IPATCH_DLS2_UNUSED_FLAG_SHIFT (IPATCH_BASE_UNUSED_FLAG_SHIFT + 4)

Property Details

The “archive-location” property

  “archive-location”         char *

Location where subject is archived.

Owner: IpatchDLS2

Flags: Read / Write

Default value: NULL


The “artist” property

  “artist”                   char *

Original artist.

Owner: IpatchDLS2

Flags: Read / Write

Default value: NULL


The “comment” property

  “comment”                  char *

Comments.

Owner: IpatchDLS2

Flags: Read / Write

Default value: NULL


The “commissioned” property

  “commissioned”             char *

Who commissioned the material.

Owner: IpatchDLS2

Flags: Read / Write

Default value: NULL


The “copyright” property

  “copyright”                char *

Copyright.

Owner: IpatchDLS2

Flags: Read / Write

Default value: NULL


The “date” property

  “date”                     char *

Creation date (YYYY-MM-DD).

Owner: IpatchDLS2

Flags: Read / Write

Default value: NULL


The “engineer” property

  “engineer”                 char *

Engineers separated by "; ".

Owner: IpatchDLS2

Flags: Read / Write

Default value: NULL


The “genre” property

  “genre”                    char *

Genre.

Owner: IpatchDLS2

Flags: Read / Write

Default value: NULL


The “keywords” property

  “keywords”                 char *

Keywords (separated by "; ").

Owner: IpatchDLS2

Flags: Read / Write

Default value: NULL


The “medium” property

  “medium”                   char *

Original medium of the material (record, CD, etc).

Owner: IpatchDLS2

Flags: Read / Write

Default value: NULL


The “name” property

  “name”                     char *

Name.

Owner: IpatchDLS2

Flags: Read / Write

Default value: "untitled"


The “product” property

  “product”                  char *

Product intended for.

Owner: IpatchDLS2

Flags: Read / Write

Default value: NULL


The “software” property

  “software”                 char *

Editor software used.

Owner: IpatchDLS2

Flags: Read / Write

Default value: NULL


The “source” property

  “source”                   char *

Source of the original material.

Owner: IpatchDLS2

Flags: Read / Write

Default value: NULL


The “source-form” property

  “source-form”              char *

Original source that was digitized.

Owner: IpatchDLS2

Flags: Read / Write

Default value: NULL


The “subject” property

  “subject”                  char *

Subject of the material.

Owner: IpatchDLS2

Flags: Read / Write

Default value: NULL


The “technician” property

  “technician”               char *

Technician who sampled the material.

Owner: IpatchDLS2

Flags: Read / Write

Default value: NULL


The “version” property

  “version”                  char *

File version "n.n.n.n".

Owner: IpatchDLS2

Flags: Read / Write

Default value: NULL