| Advanced Gtk+ Sequencer Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#include <ags/object/ags_playable.h> #define AGS_PLAYABLE_ERROR typedef AgsPlayable; enum AgsPlayableError; struct AgsPlayableInterface;void ags_playable_close (AgsPlayable *playable);GQuark ags_playable_error_quark ();void ags_playable_flush (AgsPlayable *playable);void ags_playable_info (AgsPlayable *playable,,guint *channels,guint *frames,guint *loop_start,guint *loop_end);GError **errorgboolean ags_playable_iter_next (AgsPlayable *playable);void ags_playable_iter_start (AgsPlayable *playable);guint ags_playable_level_count (AgsPlayable *playable);void ags_playable_level_select (AgsPlayable *playable,,guint nth_level,gchar *sublevel_name);GError **errorvoid ags_playable_level_up (AgsPlayable *playable,,guint levels);GError **errorguint ags_playable_nth_level (AgsPlayable *playable);gboolean ags_playable_open (AgsPlayable *playable,); signedgchar *nameshort * ags_playable_read (AgsPlayable *playable,,guint channel);GError **errorGList * ags_playable_read_audio_signal (AgsPlayable *playable,AgsDevout *devout,,guint start_channel);guint channelsgboolean ags_playable_rw_open (AgsPlayable *playable,,gchar *name,gboolean create,guint samplerate,guint channels,guint frames);guint formatvoid ags_playable_seek (AgsPlayable *playable,,guint frames);gint whencegchar * ags_playable_selected_level (AgsPlayable *playable);gchar ** ags_playable_sublevel_names (AgsPlayable *playable);void ags_playable_write (AgsPlayable *playable,signed,short *buffer);guint buffer_length
typedef enum {
AGS_PLAYABLE_ERROR_NO_SUCH_LEVEL,
AGS_PLAYABLE_ERROR_NO_SAMPLE,
} AgsPlayableError;
struct AgsPlayableInterface {
GTypeInterface interface;
gboolean (*open)(AgsPlayable *playable, gchar *name);
gboolean (*rw_open)(AgsPlayable *playable, gchar *name,
gboolean create,
guint samplerate, guint channels,
guint frames,
guint format);
/* these functions are especially for soundfonts */
guint (*level_count)(AgsPlayable *playable);
guint (*nth_level)(AgsPlayable *playable);
gchar* (*selected_level)(AgsPlayable *playable);
gchar** (*sublevel_names)(AgsPlayable *playable);
void (*level_select)(AgsPlayable *playable,
guint nth_level, gchar *sublevel_name,
GError **error);
void (*level_up)(AgsPlayable *playable,
guint levels,
GError **error);
void (*iter_start)(AgsPlayable *playable);
gboolean (*iter_next)(AgsPlayable *playable);
/* read sample data */
void (*info)(AgsPlayable *playable,
guint *channels, guint *frames,
guint *loop_start, guint *loop_end,
GError **error);
signed short* (*read)(AgsPlayable *playable,
guint channel,
GError **error);
/* write sample data */
void (*write)(AgsPlayable *playable,
signed short *buffer, guint buffer_length);
void (*flush)(AgsPlayable *playable);
/* position */
void (*seek)(AgsPlayable *playable,
guint frames, gint whence);
/* close */
void (*close)(AgsPlayable *playable);
};
void ags_playable_close (AgsPlayable *playable);
Close audio file.
|
an AgsPlayable |
void ags_playable_flush (AgsPlayable *playable);
Flush internal audio buffer.
|
an AgsPlayable |
void ags_playable_info (AgsPlayable *playable,,guint *channels,guint *frames,guint *loop_start,guint *loop_end);GError **error
Retrieve information about selected audio data.
|
an AgsPlayable |
|
channels |
|
frames |
|
loop start |
|
loop end |
|
returned error |
gboolean ags_playable_iter_next (AgsPlayable *playable);
Iterating next on current level.
|
an AgsPlayable |
void ags_playable_iter_start (AgsPlayable *playable);
Start iterating current level.
|
an AgsPlayable |
guint ags_playable_level_count (AgsPlayable *playable);
Retrieve the count of levels.
|
the AgsPlayable |
Returns : |
level count |
void ags_playable_level_select (AgsPlayable *playable,,guint nth_level,gchar *sublevel_name);GError **error
Select a level in an monolythic file where nth_level and sublevel_name are equivalent.
If sublevel_name is NULL nth_level will be chosen.
|
an AgsPlayable |
|
of type guint |
|
a gchar pointer |
|
an error that may occure |
void ags_playable_level_up (AgsPlayable *playable,,guint levels);GError **error
Move up in hierarchy.
|
an AgsPlayable |
|
n-levels up |
|
returned error |
guint ags_playable_nth_level (AgsPlayable *playable);
Retrieve the selected level.
|
the AgsPlayable |
Returns : |
nth level |
gboolean ags_playable_open (AgsPlayable *playable,);gchar *name
Opens a file in read-only mode.
|
the AgsPlayable |
|
the filename |
Returns : |
TRUE |
signedshort * ags_playable_read (AgsPlayable *playable,,guint channel);GError **error
Read audio buffer of playable audio data.
|
an AgsPlayable |
|
nth channel |
|
returned error |
Returns : |
audio buffer |
GList * ags_playable_read_audio_signal (AgsPlayable *playable,AgsDevout *devout,,guint start_channel);guint channels
Read the audio signal of AgsPlayable.
|
an AgsPlayable |
|
the AgsDevout defaulting to |
|
read from channel |
|
n-times |
Returns : |
a |
gboolean ags_playable_rw_open (AgsPlayable *playable,,gchar *name,gboolean create,guint samplerate,guint channels,guint frames);guint format
Opens a file in read/write mode.
|
the AgsPlayable |
|
the filename |
|
if TRUE |
|
the samplerate of the file |
|
the count of audio channels |
|
the count of frames |
|
the audio file's format |
Returns : |
TRUE |
void ags_playable_seek (AgsPlayable *playable,,guint frames);gint whence
Seek playable to address.
|
an AgsPlayable |
|
n-frames to seek |
|
SEEK_SET, SEEK_CUR, or SEEK_END |
gchar * ags_playable_selected_level (AgsPlayable *playable);
Retrieve the selected level's name.
|
the AgsPlayable |
Returns : |
nth level name |
gchar ** ags_playable_sublevel_names (AgsPlayable *playable);
Retrieve the all sub-level's name.
|
the AgsPlayable |
Returns : |
sub-level names |
void ags_playable_write (AgsPlayable *playable,signed,short *buffer);guint buffer_length
Write buffer_length of buffer audio data.
|
an AgsPlayable |
|
audio data |
|
frame count |