libinstpatch Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy |
#define IPATCH_DLS_READER_ERROR enum IpatchDLSReaderError; IpatchDLSReader; IpatchDLSReader * ipatch_dls_reader_new (IpatchFileHandle *handle
); IpatchDLS2 * ipatch_dls_reader_load (IpatchDLSReader *reader
,GError **err
); gboolean ipatch_dls_reader_start (IpatchDLSReader *reader
,GError **err
); void ipatch_dls_reader_set_pool_table (IpatchDLSReader *reader
,const guint32 pool_table[]
,guint size
); gboolean ipatch_dls_reader_fixup (IpatchDLSReader *reader
,GError **err
); gboolean ipatch_dls_reader_load_level_0 (IpatchDLSReader *reader
,GError **err
); gboolean ipatch_dls_reader_load_inst_list (IpatchDLSReader *reader
,GError **err
); gboolean ipatch_dls_reader_load_region_list (IpatchDLSReader *reader
,IpatchDLS2Inst *inst
,GError **err
); gboolean ipatch_gig_reader_load_region_list (IpatchDLSReader *reader
,IpatchGigInst *giginst
,GError **err
); gboolean ipatch_dls_reader_load_art_list (IpatchDLSReader *reader
,GSList **conn_list
,GError **err
); gboolean ipatch_dls_reader_load_wave_pool (IpatchDLSReader *reader
,GError **err
); gboolean ipatch_gig_reader_load_sub_regions (IpatchDLSReader *reader
,IpatchGigRegion *region
,GError **err
); gboolean ipatch_gig_reader_load_inst_lart (IpatchDLSReader *reader
,IpatchGigInst *inst
,GError **err
); gboolean ipatch_dls_load_info (IpatchRiff *riff
,IpatchDLS2Info **info
,GError **err
); gboolean ipatch_dls_load_region_header (IpatchRiff *riff
,IpatchDLS2Region *region
,GError **err
); gboolean ipatch_gig_load_region_header (IpatchRiff *riff
,IpatchGigRegion *region
,GError **err
); gboolean ipatch_dls_load_wave_link (IpatchRiff *riff
,IpatchDLS2Region *region
,GError **err
); gboolean ipatch_dls_load_sample_info (IpatchRiff *riff
,IpatchDLS2SampleInfo *info
,GError **err
); gboolean ipatch_dls_load_connection (IpatchRiff *riff
,GSList **conn_list
,GError **err
); gboolean ipatch_dls_load_sample_format (IpatchRiff *riff
,IpatchDLS2Sample *sample
,int *bitwidth
,int *channels
,GError **err
); guint32 * ipatch_dls_load_pool_table (IpatchRiff *riff
,guint *size
,GError **err
); gboolean ipatch_dls_load_dlid (IpatchRiff *riff
,guint8 *dlid
,GError **err
); gboolean ipatch_gig_load_sample_info (IpatchRiff *riff
,IpatchDLS2SampleInfo *info
,GError **err
); gboolean ipatch_gig_load_dimension_info (IpatchRiff *riff
,IpatchGigRegion *region
,GError **err
); gboolean ipatch_gig_load_dimension_names (IpatchRiff *riff
,IpatchGigRegion *region
,GError **err
); gboolean ipatch_gig_load_group_names (IpatchRiff *riff
,GSList **name_list
,GError **err
);
typedef enum { /* this error is returned if a file originally thought to be a plain DLS file turns out to be a GigaSampler file, in which case loading should be restarted in GigaSampler mode */ IPATCH_DLS_READER_ERROR_GIG } IpatchDLSReaderError;
IpatchDLSReader * ipatch_dls_reader_new (IpatchFileHandle *handle
);
Create a new DLS file reader
|
DLS file handle to parse or NULL to set later
|
Returns : |
The new DLS reader |
IpatchDLS2 * ipatch_dls_reader_load (IpatchDLSReader *reader
,GError **err
);
Load a DLS file.
|
DLS reader object |
|
Location to store error info or NULL
|
Returns : |
New DLS object with refcount of 1. |
gboolean ipatch_dls_reader_start (IpatchDLSReader *reader
,GError **err
);
Starts parsing a DLS/Gig file. This function only needs to be
called if using an IpatchDLSReader without ipatch_dls_load()
(custom readers). The file object of the reader
must be set
before calling this function. Loads the first "DLS" RIFF chunk to
verify we are loading a DLS file and sets other internal variables.
void ipatch_dls_reader_set_pool_table (IpatchDLSReader *reader
,const guint32 pool_table[]
,guint size
);
Set the pool table of a DLS/Gig reader. This function is only used when
doing manual DLS loading (not using ipatch_dls_load()
). The pool table is
used to fixup region sample references which are indexes into the pool
table.
|
DLS/Gig reader |
|
An array of unsigned 32 bit integers which are file offsets
to samples in a DLS file, can be NULL if size is 0
|
|
Number of entries in pool_table
|
gboolean ipatch_dls_reader_fixup (IpatchDLSReader *reader
,GError **err
);
Fixup sample pointers in DLS/GigaSampler regions of the DLS object in
reader
. The sample pointers should be sample pool indexes previously
stored by ipatch_dls_load_wave_link()
or ipatch_gig_load_dimension_info()
.
The pool table must also have been previously loaded for this to make
any sense.
gboolean ipatch_dls_reader_load_level_0 (IpatchDLSReader *reader
,GError **err
);
Load the top level DLS chunk of a DLS or GigaSampler file (essentially the entire file except the toplevel chunk itself).
gboolean ipatch_dls_reader_load_inst_list (IpatchDLSReader *reader
,GError **err
);
Loads DLS or GigaSampler instrument list from the current position in
the file assigned to reader
.
gboolean ipatch_dls_reader_load_region_list (IpatchDLSReader *reader
,IpatchDLS2Inst *inst
,GError **err
);
Loads DLS region list into an inst
object from the current
position in the file assigned to reader
.
gboolean ipatch_gig_reader_load_region_list (IpatchDLSReader *reader
,IpatchGigInst *giginst
,GError **err
);
Loads GigaSampler region list into an inst
object from the current
position in the file assigned to reader
.
gboolean ipatch_dls_reader_load_art_list (IpatchDLSReader *reader
,GSList **conn_list
,GError **err
);
Loads DLS or GigaSampler articulator list from the current position in
the file assigned to reader
.
gboolean ipatch_dls_reader_load_wave_pool (IpatchDLSReader *reader
,GError **err
);
Loads DLS or GigaSampler wave pool ("wvpl" chunk) from the current position
in the file assigned to reader
. Populates the reader
wave pool hash with
sample offsets for later fixup.
gboolean ipatch_gig_reader_load_sub_regions (IpatchDLSReader *reader
,IpatchGigRegion *region
,GError **err
);
Loads GigaSampler sub regions ("3prg" chunk) from the current position
in the file assigned to reader
.
gboolean ipatch_gig_reader_load_inst_lart (IpatchDLSReader *reader
,IpatchGigInst *inst
,GError **err
);
Loads a GigaSampler global parameter chunk '3ewg' from an instrument 'lart' list.
gboolean ipatch_dls_load_info (IpatchRiff *riff
,IpatchDLS2Info **info
,GError **err
);
Loads DLS or GigaSampler info from the current position in the file
assigned to riff
.
gboolean ipatch_dls_load_region_header (IpatchRiff *riff
,IpatchDLS2Region *region
,GError **err
);
Loads DLS instrument region header ("rgnh" chunk)
from the current position in the file assigned to riff
. The "rgnh" chunk
header should have already been loaded.
gboolean ipatch_gig_load_region_header (IpatchRiff *riff
,IpatchGigRegion *region
,GError **err
);
Loads GigaSampler instrument region header ("rgnh" chunk)
from the current position in the file assigned to riff
. The "rgnh" chunk
header should have already been loaded.
gboolean ipatch_dls_load_wave_link (IpatchRiff *riff
,IpatchDLS2Region *region
,GError **err
);
Loads DLS wave link chunk ("wlnk" chunk) from the current position in the
file assigned to riff
. The "wlnk" chunk header should have already been
loaded.
NOTE: Sample pool index is stored in region
sample pointer. This index
should be fixed up or cleared before the region is freed otherwise bad
things will happen.
gboolean ipatch_dls_load_sample_info (IpatchRiff *riff
,IpatchDLS2SampleInfo *info
,GError **err
);
Loads DLS or GigaSampler sample info ("wsmp" chunk) from the
current position in the file assigned to riff
. The "wsmp" chunk header
should already have been loaded.
gboolean ipatch_dls_load_connection (IpatchRiff *riff
,GSList **conn_list
,GError **err
);
Load a DLS articulator chunk ("art1" or "art2") containing connection
blocks which are loded into conn_list
. The articulation chunk header
should already have been loaded.
|
RIFF parser |
|
Pointer to a list to populate with loaded IpatchDLS2Conn structures. |
|
Location to store error info or NULL
|
Returns : |
TRUE on success, FALSE otherwise (in which case err may be set).
|
gboolean ipatch_dls_load_sample_format (IpatchRiff *riff
,IpatchDLS2Sample *sample
,int *bitwidth
,int *channels
,GError **err
);
Parses DLS sample format info ("fmt " chunk) from the current
position in the file assigned to the riff
(chunk header should already
be loaded).
|
RIFF parser |
|
DLS sample to load data into |
|
Pointer to an integer to fill with the sample's bit width or
NULL
|
|
Pointer to an integer to fill with the number of channels or
NULL
|
|
Location to store error info or NULL
|
Returns : |
TRUE on success, FALSE on error (in which case err may be set).
|
guint32 * ipatch_dls_load_pool_table (IpatchRiff *riff
,guint *size
,GError **err
);
Load a sample pool table ("ptbl" chunk) of a DLS or GigaSampler
file from the current position in the file assigned to riff
(chunk
header should already be loaded).
|
RIFF parser |
|
Pointer to an unsigned integer to store number of entries in returned pool table array |
|
Location to store error info or NULL
|
Returns : |
A newly allocated array of 32bit integers for each entry
in the pool table, or NULL if empty pool table or on error (in
which case err may be set). Free the table when finished with it.
|
gboolean ipatch_dls_load_dlid (IpatchRiff *riff
,guint8 *dlid
,GError **err
);
Load a DLSID from the current position in a riff object. This is a 16 byte unique ID used for tracking data changes. The "dlid" header should have already been loaded.
gboolean ipatch_gig_load_sample_info (IpatchRiff *riff
,IpatchDLS2SampleInfo *info
,GError **err
);
Load Gig sample info ("smpl" chunk) from current position in file assigned
to riff
(chunk header should already be loaded).
gboolean ipatch_gig_load_dimension_info (IpatchRiff *riff
,IpatchGigRegion *region
,GError **err
);
Load Gigasampler dimension info ("3lnk" chunk), from the current position
in the file assigned to riff
(chunk header should already be loaded).
NOTE: Sample pool table indexes are stored in the sample pointer of
sub regions. These indexes should be fixed up or cleared before the
region
is freed, otherwise bad things will happen.
gboolean ipatch_gig_load_dimension_names (IpatchRiff *riff
,IpatchGigRegion *region
,GError **err
);
Loads Gigasampler dimension names from the current position in the file
assigned to riff
. The "3dnl" chunk header should already have been
loaded.
gboolean ipatch_gig_load_group_names (IpatchRiff *riff
,GSList **name_list
,GError **err
);
Load a '3gri' sample group name chunk into a GSList of strings. The 3gri chunk header should have already been loaded.