Top | ![]() |
![]() |
![]() |
![]() |
IpatchSampleList * | ipatch_sample_list_new () |
void | ipatch_sample_list_free () |
IpatchSampleList * | ipatch_sample_list_duplicate () |
IpatchSampleListItem * | ipatch_sample_list_item_new () |
IpatchSampleListItem * | ipatch_sample_list_item_new_init () |
void | ipatch_sample_list_item_free () |
IpatchSampleListItem * | ipatch_sample_list_item_duplicate () |
void | ipatch_sample_list_append () |
void | ipatch_sample_list_prepend () |
void | ipatch_sample_list_insert_index () |
void | ipatch_sample_list_insert () |
void | ipatch_sample_list_cut () |
gboolean | ipatch_sample_list_render () |
gpointer | ipatch_sample_list_render_alloc () |
Sample lists define audio data from concatenated segments of other audio sources. The lists are always mono (a single channel can be selected from multi-channel sources). Multi-channel audio can be created from combining multiple sample lists of the same length.
IpatchSampleList *
ipatch_sample_list_new (void
);
Creates a new empty (zero item terminated) sample list.
void
ipatch_sample_list_free (IpatchSampleList *list
);
Free a sample list.
IpatchSampleList *
ipatch_sample_list_duplicate (IpatchSampleList *list
);
Duplicate a sample list.
IpatchSampleListItem *
ipatch_sample_list_item_new (void
);
Create a new node for a sample list.
Newly allocated list node which should be freed with
ipatch_sample_list_item_free()
when finished using it.
IpatchSampleListItem * ipatch_sample_list_item_new_init (IpatchSample *sample
,guint ofs
,guint size
,guint channel
);
Create a new sample list item and initialize it with the provided parameters.
sample |
Sample containing audio for the segment |
|
ofs |
Offset in |
|
size |
Size of audio segment in frames |
|
channel |
Channel to use from |
Newly allocated sample list item which should be freed with
ipatch_sample_list_item_free()
when done with it.
void
ipatch_sample_list_item_free (IpatchSampleListItem *item
);
Free a sample list item previously allocated by ipatch_sample_list_item_new()
.
IpatchSampleListItem *
ipatch_sample_list_item_duplicate (IpatchSampleListItem *item
);
Duplicate a sample list item node.
void ipatch_sample_list_append (IpatchSampleList *list
,IpatchSample *sample
,guint ofs
,guint size
,guint channel
);
Append an audio segment to a sample list.
void ipatch_sample_list_prepend (IpatchSampleList *list
,IpatchSample *sample
,guint ofs
,guint size
,guint channel
);
Prepend an audio segment to a sample list.
void ipatch_sample_list_insert_index (IpatchSampleList *list
,guint index
,IpatchSample *sample
,guint ofs
,guint size
,guint channel
);
Insert an audio segment into a sample list before a given list segment
index
.
void ipatch_sample_list_insert (IpatchSampleList *list
,guint pos
,IpatchSample *sample
,guint ofs
,guint size
,guint channel
);
Insert an audio segment into a sample list at a given sample position
in frames (pos
). Existing segments will be split as needed to accomodate
the inserted segment.
void ipatch_sample_list_cut (IpatchSampleList *list
,guint pos
,guint size
);
Cut a segment of audio from a sample list.
gboolean ipatch_sample_list_render (IpatchSampleList *list
,gpointer buf
,guint pos
,guint frames
,int format
,GError **err
);
Copies sample data from a sample list, converting as necessary and storing
to buf
.
[skip]
list |
Sample list |
|
buf |
Buffer to store the rendered audio to (should be |
|
pos |
Position in sample list audio to start from, in frames |
|
frames |
Size of sample data to render in frames |
|
format |
Sample format to render to (must be mono) |
|
err |
Location to store error to or |
gpointer ipatch_sample_list_render_alloc (IpatchSampleList *list
,guint pos
,guint size
,int format
,GError **err
);
Copies sample data from a sample list, converting as necessary and returning an allocated buffer.
[rename-to ipatch_sample_list_render]
list |
Sample list |
|
pos |
Position in sample list audio to start from, in frames |
|
size |
Size of sample data to render in bytes (must be a multiple of frame size) |
|
format |
Sample format to render to (must be mono) |
|
err |
Location to store error to or |
Buffer containing
rendered audio of the requested format
or NULL
on error (in which case err
may be set).
[array length=size][element-type guint8][transfer full]
Since: 1.1.0
struct IpatchSampleList { GList *items; /* list of IpatchSampleListItem structs */ guint total_size; /* total size of audio data in frames */ };
A sample edit list. Allows for non-destructive sample editing by defining new audio samples from one or more audio sample segments.
struct IpatchSampleListItem { IpatchSample *sample; /* Sample for this segment */ guint ofs; /* Offset in sample of segment start */ guint size; /* Size in frames of audio segment */ guint32 channel : 3; /* Channel to use in sample */ guint32 reserved : 29; };
Defines an audio segment in a IpatchSampleList.