## IpatchDLSWriter IpatchDLSWriter — DLS instrument file writer |

## Stability Level

Stable, unless otherwise indicated

## Synopsis

                        IpatchDLSWriter;
    IpatchDLSWriter *   ipatch_dls_writer_new               (IpatchFileHandle *handle,
                                                             IpatchDLS2 *dls);
    void                ipatch_dls_writer_set_patch         (IpatchDLSWriter *writer,
                                                             IpatchDLS2 *dls);
    void                ipatch_dls_writer_set_file_handle   (IpatchDLSWriter *writer,
                                                             IpatchFileHandle *handle);
    gboolean            ipatch_dls_writer_save              (IpatchDLSWriter *writer,
                                                             GError **err);

## Object Hierarchy

      GObject
       +----IpatchRiff
             +----IpatchDLSWriter

## Description

Writes a DLS instrument object tree (IpatchDLS) to a DLS file.

## Details

### IpatchDLSWriter

    typedef struct _IpatchDLSWriter IpatchDLSWriter;

### ipatch_dls_writer_new ()

    IpatchDLSWriter *   ipatch_dls_writer_new               (IpatchFileHandle *handle,
                                                             IpatchDLS2 *dls);

Create a new DLS file writer.

`handle` : | DLS file handle to save to or `NULL` to set later, taken over by writer object and will be closed on finalize.
`dls` : | DLS object to save or `NULL` to set later
Returns : | The new DLS writer

### ipatch_dls_writer_set_patch ()

    void                ipatch_dls_writer_set_patch         (IpatchDLSWriter *writer,
                                                             IpatchDLS2 *dls);

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

`writer` : | DLS writer object
`dls` : | DLS patch to save

### ipatch_dls_writer_set_file_handle ()

    void                ipatch_dls_writer_set_file_handle   (IpatchDLSWriter *writer,
                                                             IpatchFileHandle *handle);

Set the DLS file handle of a DLS writer. A convenience function, since `ipatch_riff_set_file_handle()` could also be used.

`writer` : | DLS writer object
`handle` : | DLS file handle

### ipatch_dls_writer_save ()

    gboolean            ipatch_dls_writer_save              (IpatchDLSWriter *writer,
                                                             GError **err);

Write a DLS or GigaSampler object to a file.

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

## See Also

#IpatchDLS