IpatchSF2Writer

IpatchSF2Writer — SoundFont save object.

Synopsis




            IpatchSF2Writer;
            IpatchSF2WriterClass;
IpatchSF2Writer* ipatch_sf2_writer_new      (IpatchSF2File *file,
                                             IpatchSF2 *sfont);
void        ipatch_sf2_writer_set_patch     (IpatchSF2Writer *writer,
                                             IpatchSF2 *sfont);
void        ipatch_sf2_writer_set_file      (IpatchSF2Writer *writer,
                                             IpatchSF2File *file);
gboolean    ipatch_sf2_writer_save          (IpatchSF2Writer *writer,
                                             GError **err);
void        ipatch_sf2_write_phdr           (IpatchFileBuf *filebuf,
                                             const IpatchSF2Phdr *phdr);
void        ipatch_sf2_write_ihdr           (IpatchFileBuf *filebuf,
                                             const IpatchSF2Ihdr *ihdr);
void        ipatch_sf2_write_shdr           (IpatchFileBuf *filebuf,
                                             const IpatchSF2Shdr *shdr);
void        ipatch_sf2_write_bag            (IpatchFileBuf *filebuf,
                                             const IpatchSF2Bag *bag);
void        ipatch_sf2_write_mod            (IpatchFileBuf *filebuf,
                                             const IpatchSF2Mod *mod);
void        ipatch_sf2_write_gen            (IpatchFileBuf *filebuf,
                                             int genid,
                                             const IpatchSF2GenAmount *amount);

Object Hierarchy


  GObject
   +----IpatchRiffParser
         +----IpatchSF2Writer

Properties


  "migrate-samples"      gboolean              : Read / Write

Description

An object for saving an IpatchSF2 object to a SoundFont file.

Details

IpatchSF2Writer

typedef struct _IpatchSF2Writer IpatchSF2Writer;


IpatchSF2WriterClass

typedef struct {
  IpatchRiffParserClass parent_class;
} IpatchSF2WriterClass;


ipatch_sf2_writer_new ()

IpatchSF2Writer* ipatch_sf2_writer_new      (IpatchSF2File *file,
                                             IpatchSF2 *sfont);

Create a new SoundFont 2 file writer.

file : SoundFont file object to save to or NULL to set later
sfont : SoundFont object to save or NULL to set later
Returns : The new SoundFont writer

ipatch_sf2_writer_set_patch ()

void        ipatch_sf2_writer_set_patch     (IpatchSF2Writer *writer,
                                             IpatchSF2 *sfont);

Set the SoundFont patch object to save with a SoundFont writer.

writer : SoundFont writer object
sfont : SoundFont patch to save

ipatch_sf2_writer_set_file ()

void        ipatch_sf2_writer_set_file      (IpatchSF2Writer *writer,
                                             IpatchSF2File *file);

Set the SoundFont file object of a SoundFont writer. A convenience function, since ipatch_riff_set_file could also be used, albeit without stricter type casting.

writer : SoundFont writer object
file : SoundFont file object

ipatch_sf2_writer_save ()

gboolean    ipatch_sf2_writer_save          (IpatchSF2Writer *writer,
                                             GError **err);

Write a SoundFont object to a file.

writer : SoundFont writer object
err : Location to store error info or NULL
Returns : TRUE on success, FALSE on error

ipatch_sf2_write_phdr ()

void        ipatch_sf2_write_phdr           (IpatchFileBuf *filebuf,
                                             const IpatchSF2Phdr *phdr);

Writes a preset header into filebuf from a phdr structure. The filebuf size should be at least IPATCH_SFONT_PHDR_SIZE.

filebuf : File buffer to store data to
phdr : Preset header structure to store

ipatch_sf2_write_ihdr ()

void        ipatch_sf2_write_ihdr           (IpatchFileBuf *filebuf,
                                             const IpatchSF2Ihdr *ihdr);

Writes an instrument header into filebuf from a ihdr structure. The filebuf size should be at least IPATCH_SFONT_INST_SIZE.

filebuf : File buffer to store data to
ihdr : Instrument header structure to store

ipatch_sf2_write_shdr ()

void        ipatch_sf2_write_shdr           (IpatchFileBuf *filebuf,
                                             const IpatchSF2Shdr *shdr);

Writes a sample header into filebuf from a shdr structure. The filebuf size should be at least IPATCH_SFONT_SHDR_SIZE.

filebuf : File buffer to store data to
shdr : Sample header structure to store

ipatch_sf2_write_bag ()

void        ipatch_sf2_write_bag            (IpatchFileBuf *filebuf,
                                             const IpatchSF2Bag *bag);

Writes a preset or instrument bag into filebuf from a bag structure. The filebuf size should be at least IPATCH_SFONT_BAG_SIZE.

filebuf : File buffer to store data to
bag : Bag structure to store

ipatch_sf2_write_mod ()

void        ipatch_sf2_write_mod            (IpatchFileBuf *filebuf,
                                             const IpatchSF2Mod *mod);

Writes a modulator into filebuf from a mod structure. The filebuf size should be at least IPATCH_SFONT_MOD_SIZE.

filebuf : File buffer to store data to
mod : Modulator structure to store

ipatch_sf2_write_gen ()

void        ipatch_sf2_write_gen            (IpatchFileBuf *filebuf,
                                             int genid,
                                             const IpatchSF2GenAmount *amount);

Writes a generator into filebuf from a genid and amount structure. The filebuf size should be at least IPATCH_SFONT_GEN_SIZE.

filebuf : File buffer to store data to
genid : ID of generator to store
amount : Generator amount to store

Properties

The "migrate-samples" property

  "migrate-samples"      gboolean              : Read / Write

Migrate samples to new file.

Default value: FALSE