Top | ![]() |
![]() |
![]() |
![]() |
char * | ipatch_base_type_get_mime_type () |
void | ipatch_base_set_file () |
IpatchFile * | ipatch_base_get_file () |
void | ipatch_base_set_file_name () |
char * | ipatch_base_get_file_name () |
void | ipatch_base_find_unused_midi_locale () |
IpatchItem * | ipatch_base_find_item_by_midi_locale () |
gboolean | ipatch_base_save () |
gboolean | ipatch_base_save_to_filename () |
gboolean | ipatch_base_save_a_copy () |
gboolean | ipatch_base_close () |
gboolean | ipatch_close_base_list () |
gboolean | changed | Read / Write |
IpatchFile * | file | Read / Write |
char * | file-name | Read / Write |
gboolean | saved | Read / Write |
enum | IpatchBaseFlags |
#define | IPATCH_BASE_UNUSED_FLAG_SHIFT |
#define | IPATCH_BASE_DEFAULT_NAME |
GObject ╰── IpatchItem ╰── IpatchContainer ╰── IpatchBase ├── IpatchDLS2 ├── IpatchSF2 ├── IpatchSLI ╰── IpatchVBank
Defines an abstract object type which is used as the basis of instrument files, such as IpatchSF2, IpatchDLS, etc.
char *
ipatch_base_type_get_mime_type (GType base_type
);
Get the mime type of the file type associated with the given base patch file type.
Mime type or NULL if none assigned for this base type. Free the string when finished with it.
Since: 1.1.0
void ipatch_base_set_file (IpatchBase *base
,IpatchFile *file
);
Sets the file object associated with a patch.
IpatchFile *
ipatch_base_get_file (IpatchBase *base
);
Get the file object associated with a patch base object. Caller owns a reference to the returned file object and it should be unrefed when done with it.
void ipatch_base_set_file_name (IpatchBase *base
,const char *file_name
);
Sets the file name of the file object in a patch base object. File object should have been set before calling this function (otherwise request is silently ignored). A convenience function as one could get the file object and set it directly.
char *
ipatch_base_get_file_name (IpatchBase *base
);
Get the file name of the file object in a base patch item. A convenience function.
void ipatch_base_find_unused_midi_locale (IpatchBase *base
,int *bank
,int *program
,const IpatchItem *exclude
,gboolean percussion
);
Finds an unused MIDI locale (bank:program number pair) in a patch
base object. The way in which MIDI bank and program numbers are
used is implementation dependent. Percussion instruments often
affect the bank parameter (for example SoundFont uses bank 128 for
percussion presets). On input the bank
and program
parameters
set the initial locale to start from (set to 0:0 to find the first
free value). If the percussion
parameter is set it may affect
bank
, if its not set, bank will not be modified (e.g., if bank is
a percussion value it will be used). The exclude parameter can be
set to a child item of base
to exclude from the list of "used"
locales (useful when making an item unique that is already parented
to base
). On return bank
and program
will be set to an unused
MIDI locale based on the input criteria.
IpatchItem * ipatch_base_find_item_by_midi_locale (IpatchBase *base
,int bank
,int program
);
Find a child object in a base patch object which matches the given MIDI
locale (bank
and program
numbers).
gboolean ipatch_base_save (IpatchBase *base
,GError **err
);
Save a patch item to the assigned filename or file object. This function handles saving over an existing file and migrates sample stores as needed.
Since: 1.1.0
gboolean ipatch_base_save_to_filename (IpatchBase *base
,const char *filename
,GError **err
);
Save a patch item to a file. This function handles saving over an existing
file and migrates sample stores as needed. It is an error to try to save
over an open file that is not owned by base
.
base |
Base item to save |
|
filename |
New file name to save to or |
[nullable] |
err |
Location to store error info or |
Since: 1.1.0
gboolean ipatch_base_save_a_copy (IpatchBase *base
,const char *filename
,GError **err
);
Save a patch item to a file name.
base |
Base item to save |
|
filename |
File name to save a copy to |
|
err |
Location to store error info or |
Since: 1.1.0
gboolean ipatch_base_close (IpatchBase *base
,GError **err
);
Close a base instrument object (using ipatch_item_remove()
), migrating sample data as needed.
Since: 1.1.0
gboolean ipatch_close_base_list (IpatchList *list
,GError **err
);
Close a list of base instrument objects (using ipatch_item_remove_recursive()
),
migrating sample data as needed. Using this function instead of ipatch_base_close()
can save on unnecessary sample data migrations, if multiple base objects reference
the same sample data.
list |
List of base objects to close (non base objects are skipped) |
|
err |
Location to store error info or |
Since: 1.1.0
#define IPATCH_BASE_UNUSED_FLAG_SHIFT (IPATCH_ITEM_UNUSED_FLAG_SHIFT + 4)