## IpatchSampleStoreRam

IpatchSampleStoreRam — Sample store object for audio data in RAM

## Stability Level

Stable, unless otherwise indicated

## Synopsis

                        IpatchSampleStoreRam;
    enum                IpatchSampleStoreRamFlags;
    #define             IPATCH_SAMPLE_STORE_RAM_UNUSED_FLAG_SHIFT
    IpatchSample *      ipatch_sample_store_ram_new         (gpointer location,
                                                             gboolean free_data);
    IpatchSample *      ipatch_sample_store_ram_get_blank   (void);

## Object Hierarchy

      GObject
       +----IpatchItem
             +----IpatchSampleStore
                   +----IpatchSampleStoreRam

## Implemented Interfaces

IpatchSampleStoreRam implements IpatchSample.

## Properties

      "free-data"                gboolean              : Read / Write
      "location"                 gpointer              : Read / Write

## Description

## Details

### IpatchSampleStoreRam

    typedef struct _IpatchSampleStoreRam IpatchSampleStoreRam;

### enum IpatchSampleStoreRamFlags

    typedef enum
    {
      IPATCH_SAMPLE_STORE_RAM_ALLOCATED = 1 << IPATCH_SAMPLE_STORE_UNUSED_FLAG_SHIFT
    } IpatchSampleStoreRamFlags;

Flags crammed into IpatchItem flags field.

`IPATCH_SAMPLE_STORE_RAM_ALLOCATED` | Indicates if sample data was allocated and therefore should be freed when finalized.

### IPATCH_SAMPLE_STORE_RAM_UNUSED_FLAG_SHIFT

    #define             IPATCH_SAMPLE_STORE_RAM_UNUSED_FLAG_SHIFT

### ipatch_sample_store_ram_new ()

    IpatchSample *      ipatch_sample_store_ram_new         (gpointer location,
                                                             gboolean free_data);

Creates a new RAM sample store.

`location` : | Location of existing sample data or `NULL` if the sample buffer should be allocated (in which case the sample must be written to first).
`free_data` : | `TRUE` if sample data at `location` should be freed when object is destroyed
Returns : | New RAM sample store, cast as a IpatchSample for convenience.

### ipatch_sample_store_ram_get_blank ()

    IpatchSample *      ipatch_sample_store_ram_get_blank   (void);

Get blank mono RAM sample object. Return's a sample object with 48 stereo 16 bit samples of silent audio. Only creates it on the first call, subsequent calls return the same sample object. Therefore it should not be modified.

Returns : | The blank sample object. Remember to unref it when not using it anymore with `g_object_unref()`.

## Property Details

### The `"free-data"` property

      "free-data"                gboolean              : Read / Write

Free data when object destroyed.

Default value: FALSE

### The `"location"` property

      "location"                 gpointer              : Read / Write

Sample data pointer.