IpatchDLS2Sample

IpatchDLS2Sample — DLS sample object.

Synopsis




            IpatchDLS2SampleInfo;
            IpatchDLS2Sample;
            IpatchDLS2SampleClass;
#define     IPATCH_DLS2_SAMPLE_INFO_FIRST_PROPERTY_ID
#define     IPATCH_DLS2_SAMPLE_INFO_PROPERTY_COUNT
enum        IpatchDLS2SampleFlags;
#define     IPATCH_DLS2_SAMPLE_LOOP_MASK
#define     IPATCH_DLS2_SAMPLE_FLAGS_MASK
IpatchDLS2Sample* ipatch_dls2_sample_new    (void);
IpatchDLS2Sample* ipatch_dls2_sample_first  (IpatchIter *iter);
IpatchDLS2Sample* ipatch_dls2_sample_next   (IpatchIter *iter);
void        ipatch_dls2_sample_set_data     (IpatchDLS2Sample *sample,
                                             IpatchSampleData *sampledata);
IpatchSampleData* ipatch_dls2_sample_ref_data
                                            (IpatchDLS2Sample *sample);
IpatchSampleData* ipatch_dls2_sample_peek_data
                                            (IpatchDLS2Sample *sample);
void        ipatch_dls2_sample_set_blank    (IpatchDLS2Sample *sample);
guint       ipatch_dls2_sample_get_size     (IpatchDLS2Sample *sample);
IpatchSampleStore* ipatch_dls2_sample_find_store_ref
                                            (IpatchDLS2Sample *sample,
                                             GType store_type,
                                             int format,
                                             int find_flags);
IpatchDLS2SampleInfo* ipatch_dls2_sample_info_new
                                            (void);
void        ipatch_dls2_sample_info_free    (IpatchDLS2SampleInfo *sample_info);
IpatchDLS2SampleInfo* ipatch_dls2_sample_info_duplicate
                                            (IpatchDLS2SampleInfo *sample_info);
void        ipatch_dls2_sample_info_install_class_properties
                                            (GObjectClass *obj_class);
gboolean    ipatch_dls2_sample_info_set_property
                                            (IpatchDLS2SampleInfo **sample_info,
                                             guint property_id,
                                             const GValue *value);
gboolean    ipatch_dls2_sample_info_get_property
                                            (IpatchDLS2SampleInfo *sample_info,
                                             guint property_id,
                                             GValue *value);

Object Hierarchy


  GObject
   +----IpatchItem
         +----IpatchDLS2Sample

Implemented Interfaces

IpatchDLS2Sample implements IpatchSample.

Properties


  "archive-location"     gchararray            : Read / Write
  "artist"               gchararray            : Read / Write
  "comment"              gchararray            : Read / Write
  "commissioned"         gchararray            : Read / Write
  "copyright"            gchararray            : Read / Write
  "date"                 gchararray            : Read / Write
  "engineer"             gchararray            : Read / Write
  "fine-tune"            gint                  : Read / Write
  "flags"                IpatchDLS2SampleFlags  : Read / Write
  "gain"                 gint                  : Read / Write
  "genre"                gchararray            : Read / Write
  "keywords"             gchararray            : Read / Write
  "loop-end"             guint                 : Read / Write
  "loop-start"           guint                 : Read / Write
  "loop-type"            IpatchSampleLoopType  : Read / Write
  "medium"               gchararray            : Read / Write
  "name"                 gchararray            : Read / Write
  "product"              gchararray            : Read / Write
  "root-note"            gint                  : Read / Write
  "sample-data"          IpatchSampleData      : Read / Write
  "sample-rate"          gint                  : Read / Write
  "software"             gchararray            : Read / Write
  "source"               gchararray            : Read / Write
  "source-form"          gchararray            : Read / Write
  "subject"              gchararray            : Read / Write
  "technician"           gchararray            : Read / Write

Description

This object defines a DLS sample including tuning, loop options and the sample data itself.

Details

IpatchDLS2SampleInfo

typedef struct {
  guint8 options; /* IpatchSampleLoopType and IpatchDLS2SampleFlags */
  guint8 root_note;		/* root MIDI note number */
  gint16 fine_tune;		/* fine tuning */
  gint32 gain;			/* gain to apply to sample */

  guint32 loop_start;		/* loop start offset (in samples) */
  guint32 loop_end;		/* loop end offset (in samples) */
} IpatchDLS2SampleInfo;


IpatchDLS2Sample

typedef struct _IpatchDLS2Sample IpatchDLS2Sample;


IpatchDLS2SampleClass

typedef struct {
  IpatchItemClass parent_class;
} IpatchDLS2SampleClass;


IPATCH_DLS2_SAMPLE_INFO_FIRST_PROPERTY_ID

#define IPATCH_DLS2_SAMPLE_INFO_FIRST_PROPERTY_ID   256


IPATCH_DLS2_SAMPLE_INFO_PROPERTY_COUNT

#define IPATCH_DLS2_SAMPLE_INFO_PROPERTY_COUNT      7


enum IpatchDLS2SampleFlags

typedef enum /*< flags >*/
{
  IPATCH_DLS2_SAMPLE_NO_TRUNCATION = 1 << 6,
  IPATCH_DLS2_SAMPLE_NO_COMPRESSION = 1 << 7
} IpatchDLS2SampleFlags;


IPATCH_DLS2_SAMPLE_LOOP_MASK

#define IPATCH_DLS2_SAMPLE_LOOP_MASK   0x03


IPATCH_DLS2_SAMPLE_FLAGS_MASK

#define IPATCH_DLS2_SAMPLE_FLAGS_MASK  0x0C0


ipatch_dls2_sample_new ()

IpatchDLS2Sample* ipatch_dls2_sample_new    (void);

Create a new DLS sample object.

Returns : New DLS sample with a reference count of 1. Caller owns the reference and removing it will destroy the item, unless another reference is added (if its parented for example).

ipatch_dls2_sample_first ()

IpatchDLS2Sample* ipatch_dls2_sample_first  (IpatchIter *iter);

Gets the first item in a sample iterator. A convenience wrapper for ipatch_iter_first().

iter : Patch item iterator containing IpatchDLS2Sample items
Returns : The first sample in iter or NULL if empty.

ipatch_dls2_sample_next ()

IpatchDLS2Sample* ipatch_dls2_sample_next   (IpatchIter *iter);

Gets the next item in a sample iterator. A convenience wrapper for ipatch_iter_next().

iter : Patch item iterator containing IpatchDLS2Sample items
Returns : The next sample in iter or NULL if at the end of the list.

ipatch_dls2_sample_set_data ()

void        ipatch_dls2_sample_set_data     (IpatchDLS2Sample *sample,
                                             IpatchSampleData *sampledata);

Set a sample's sample data object.

sample : Sample to set sample data of
sampledata : Sample data to set sample to

ipatch_dls2_sample_ref_data ()

IpatchSampleData* ipatch_dls2_sample_ref_data
                                            (IpatchDLS2Sample *sample);

Get the IpatchSampleData item of a sample. Sample data item is referenced before returning and caller is responsible for unreferencing it with g_object_unref() when finished with it.

sample : Sample to get sample data from
Returns : Sample data object of sample or NULL if none. Remember to unreference with g_object_unref() when finished with it.

ipatch_dls2_sample_peek_data ()

IpatchSampleData* ipatch_dls2_sample_peek_data
                                            (IpatchDLS2Sample *sample);

Get the IpatchSampleData item of a sample. Like ipatch_dls2_sample_ref_data() but sample data object is not referenced. This function should only be used if a reference of the sample data object is ensured or only the pointer value is of importance.

sample : Sample to get sample data from
Returns : Sample data object of sample or NULL if none. Remember that a reference is NOT added.

ipatch_dls2_sample_set_blank ()

void        ipatch_dls2_sample_set_blank    (IpatchDLS2Sample *sample);

Set the sample data of a sample item to blank data.

sample : Sample to set to blank sample data

ipatch_dls2_sample_get_size ()

guint       ipatch_dls2_sample_get_size     (IpatchDLS2Sample *sample);

Get the size of a sample. Sample should have been assigned a sample data object before calling this function.

sample : Sample to get size of
Returns : Size of sample data (in samples).

ipatch_dls2_sample_find_store_ref ()

IpatchSampleStore* ipatch_dls2_sample_find_store_ref
                                            (IpatchDLS2Sample *sample,
                                             GType store_type,
                                             int format,
                                             int find_flags);

Find a sample store in a DLS sample object by criteria. A convenience function, since a sample's IpatchSampleData object could be retrieved and ipatch_sample_data_find_store_ref() used instead. Returned sample store's reference count has been incremented and should be removed by the caller with g_object_unref() when finished with it.

sample : Sample object to find sample store in
store_type : Sample store type to find (0 as a wildcard).
format : Sample store format to find (0 as a wildcard).
find_flags : Criteria for finding a sample store (IpatchSampleDataFindFlags).
Returns : A sample store matching the criteria or NULL on error or if no match (there might not be any stores in the sample). Remember to unref the sample store with g_object_unref() when finished with it.

ipatch_dls2_sample_info_new ()

IpatchDLS2SampleInfo* ipatch_dls2_sample_info_new
                                            (void);

Allocates a new sample info structure.

Returns : New sample info structure, free it with ipatch_dls2_sample_info_free() when finished.

ipatch_dls2_sample_info_free ()

void        ipatch_dls2_sample_info_free    (IpatchDLS2SampleInfo *sample_info);

Free a sample info structure allocated with ipatch_dls2_sample_info_new().

sample_info : Sample info structure

ipatch_dls2_sample_info_duplicate ()

IpatchDLS2SampleInfo* ipatch_dls2_sample_info_duplicate
                                            (IpatchDLS2SampleInfo *sample_info);

Duplicate a sample info structure.

sample_info : Sample info structure to duplicate
Returns : Newly allocated sample info structure which should be freed with ipatch_dls2_sample_info_free() when done with it.

ipatch_dls2_sample_info_install_class_properties ()

void        ipatch_dls2_sample_info_install_class_properties
                                            (GObjectClass *obj_class);

Installs sample info properties for the given obj_class. Useful for objects that implement IpatchDLS2SampleInfo properties.

obj_class : GObjectClass to install properties for

ipatch_dls2_sample_info_set_property ()

gboolean    ipatch_dls2_sample_info_set_property
                                            (IpatchDLS2SampleInfo **sample_info,
                                             guint property_id,
                                             const GValue *value);

A function used by set_property methods that implement IpatchDLS2SampleInfo properties.

sample_info : Pointer to pointer to sample info
property_id : Property ID
value : Value for property
Returns : TRUE if property_id was handled, FALSE otherwise

ipatch_dls2_sample_info_get_property ()

gboolean    ipatch_dls2_sample_info_get_property
                                            (IpatchDLS2SampleInfo *sample_info,
                                             guint property_id,
                                             GValue *value);

A function used by get_property methods that implement IpatchDLS2SampleInfo properties.

sample_info : Pointer to sample info
property_id : Property ID
value : Value to set
Returns : TRUE if property_id was handled, FALSE otherwise

Properties

The "archive-location" property

  "archive-location"     gchararray            : Read / Write

Location of archived material.

Default value: NULL


The "artist" property

  "artist"               gchararray            : Read / Write

Artist of the original subject material.

Default value: NULL


The "comment" property

  "comment"              gchararray            : Read / Write

A comment.

Default value: NULL


The "commissioned" property

  "commissioned"         gchararray            : Read / Write

Person or organization who commissioned the material.

Default value: NULL


The "copyright" property

  "copyright"            gchararray            : Read / Write

Copyright information.

Default value: NULL


The "date" property

  "date"                 gchararray            : Read / Write

Creation date in YYYY-MM-DD format.

Default value: NULL


The "engineer" property

  "engineer"             gchararray            : Read / Write

Name of the engineer who worked on material (if multiple engineers separate with semicolon and a blank).

Default value: NULL


The "fine-tune" property

  "fine-tune"            gint                  : Read / Write

Fine tune amount in DLS relative pitch.

Allowed values: [-99,99]

Default value: 0


The "flags" property

  "flags"                IpatchDLS2SampleFlags  : Read / Write

Some flags for ensuring bit width is not truncated and sample is not compressed by the synthesis engine.


The "gain" property

  "gain"                 gint                  : Read / Write

Gain in DLS relative gain.

Default value: 0


The "genre" property

  "genre"                gchararray            : Read / Write

Describes the genre of the original work such as electro industrial, gothic, instrumental surf, psycho-billy, EBM, rock, etc.

Default value: NULL


The "keywords" property

  "keywords"             gchararray            : Read / Write

Keywords that refere to the material. Multiple keywords separated by a semicolon and a blank (example: FX; barnyard; animal).

Default value: NULL


The "loop-end" property

  "loop-end"             guint                 : Read / Write

Loop end offset in samples.

Default value: 0


The "loop-start" property

  "loop-start"           guint                 : Read / Write

Loop start offset in samples.

Default value: 0


The "loop-type" property

  "loop-type"            IpatchSampleLoopType  : Read / Write

Loop method type.

Default value: IPATCH_SAMPLE_LOOP_NONE


The "medium" property

  "medium"               gchararray            : Read / Write

Describes the original medium of the material, such as, CD, MP3, etc.

Default value: NULL


The "name" property

  "name"                 gchararray            : Read / Write

Stores the title of the material.

Default value: "untitled"


The "product" property

  "product"              gchararray            : Read / Write

The name of the product the material is intended for.

Default value: NULL


The "root-note" property

  "root-note"            gint                  : Read / Write

Root MIDI note.

Allowed values: [0,127]

Default value: 60


The "sample-data" property

  "sample-data"          IpatchSampleData      : Read / Write

Sample data.


The "sample-rate" property

  "sample-rate"          gint                  : Read / Write

Sampling rate in Hertz.

Allowed values: [8000,192000]

Default value: 44100


The "software" property

  "software"             gchararray            : Read / Write

Identifies the software used to create the material.

Default value: NULL


The "source" property

  "source"               gchararray            : Read / Write

Identifies the name of the person or organization who supplied the original material.

Default value: NULL


The "source-form" property

  "source-form"          gchararray            : Read / Write

The original form of the material that was digitally sampled. Not necessarily the same as "medium".

Default value: NULL


The "subject" property

  "subject"              gchararray            : Read / Write

Defines the subject of the material such as "Music to milk by".

Default value: NULL


The "technician" property

  "technician"           gchararray            : Read / Write

The technician who sampled the material.

Default value: NULL

See Also

IpatchSampleData