Advanced Gtk+ Sequencer Reference Manual | ||||
---|---|---|---|---|
Top | Description |
#include <ags/audio/ags_devout.h> #define AGS_DEVOUT_DEFAULT_BPM #define AGS_DEVOUT_DEFAULT_BUFFER_SIZE #define AGS_DEVOUT_DEFAULT_DELAY #define AGS_DEVOUT_DEFAULT_FORMAT #define AGS_DEVOUT_DEFAULT_JIFFIE #define AGS_DEVOUT_DEFAULT_PERIOD #define AGS_DEVOUT_DEFAULT_SAMPLERATE #define AGS_DEVOUT_DEFAULT_SCALE #define AGS_DEVOUT_DEFAULT_TACT #define AGS_DEVOUT_DEFAULT_TACTRATE #define AGS_DEVOUT_DEFAULT_TACT_JIFFIE #define AGS_DEVOUT_ERROR #define AGS_DEVOUT_PLAY (ptr) #define AGS_DEVOUT_PLAY_DOMAIN (ptr) struct AgsDevout; struct AgsDevoutClass; enum AgsDevoutError; enum AgsDevoutFlags; struct AgsDevoutPlay; struct AgsDevoutPlayDomain; enum AgsDevoutPlayFlags; enum AgsDevoutResolutionMode;GQuark ags_devout_error_quark ();void ags_devout_list_cards (,
GList **card_id); AgsDevout * ags_devout_new (
GList **card_name);
GObject *ags_mainvoid ags_devout_note_offset_changed (AgsDevout *devout
,);
guint note_offsetvoid ags_devout_pcm_info (,
char *card_id,
guint *channels_min,
guint *channels_max,
guint *rate_min,
guint *rate_max,
guint *buffer_size_min,
guint *buffer_size_max); AgsDevoutPlay * ags_devout_play_alloc (); AgsDevoutPlayDomain * ags_devout_play_domain_alloc ();
GError **errorvoid ags_devout_play_domain_free (AgsDevoutPlayDomain *devout_play_domain
); AgsDevoutPlay * ags_devout_play_find_source (,
GList *devout_play);
GObject *sourcevoid ags_devout_play_free (AgsDevoutPlay *devout_play
);void ags_devout_tic (AgsDevout *devout
);
#define AGS_DEVOUT_DEFAULT_DELAY (AGS_DEVOUT_DEFAULT_JIFFIE * (60.0 / AGS_DEVOUT_DEFAULT_BPM))
#define AGS_DEVOUT_DEFAULT_JIFFIE ((double) AGS_DEVOUT_DEFAULT_SAMPLERATE / (double) AGS_DEVOUT_DEFAULT_BUFFER_SIZE)
#define AGS_DEVOUT_DEFAULT_TACTRATE (1.0 / AGS_DEVOUT_DEFAULT_TACT_JIFFIE)
#define AGS_DEVOUT_DEFAULT_TACT_JIFFIE (60.0 / AGS_DEVOUT_DEFAULT_BPM * AGS_DEVOUT_DEFAULT_TACT)
struct AgsDevout { GObject object; guint flags; guint dsp_channels; guint pcm_channels; guint bits; guint buffer_size; guint frequency; // sample_rate signed short** buffer; double bpm; // beats per minute gdouble *delay; // count of tics within buffer size guint *attack; // where currently tic resides in the stream's offset, measured in 1/64 of bpm gdouble delay_counter; // next time attack changeing when delay_counter == delay guint tic_counter; // in the range of default period union{ struct _AgsOss{ int device_fd; char *device; }oss; struct _AgsAlsa{ char *device; int rc; snd_pcm_t *handle; snd_async_handler_t *ahandler; snd_pcm_hw_params_t *params; }alsa; }out; GObject *ags_main; GList *audio; };
struct AgsDevoutClass { GObjectClass object; void (*play_init)(AgsDevout *devout, GError **error); void (*play)(AgsDevout *devout, GError **error); void (*stop)(AgsDevout *devout); void (*tic)(AgsDevout *devout); void (*note_offset_changed)(AgsDevout *devout, guint note_offset); };
typedef enum { AGS_DEVOUT_BUFFER0 = 1, AGS_DEVOUT_BUFFER1 = 1 << 1, AGS_DEVOUT_BUFFER2 = 1 << 2, AGS_DEVOUT_BUFFER3 = 1 << 3, AGS_DEVOUT_ATTACK_FIRST = 1 << 4, AGS_DEVOUT_PLAY = 1 << 5, AGS_DEVOUT_LIBAO = 1 << 6, AGS_DEVOUT_OSS = 1 << 7, AGS_DEVOUT_ALSA = 1 << 8, AGS_DEVOUT_SHUTDOWN = 1 << 9, AGS_DEVOUT_START_PLAY = 1 << 10, AGS_DEVOUT_NONBLOCKING = 1 << 11, AGS_DEVOUT_TIMING_SET_0 = 1 << 12, AGS_DEVOUT_TIMING_SET_1 = 1 << 13, } AgsDevoutFlags;
struct AgsDevoutPlay { guint flags; AgsIteratorThread **iterator_thread; GObject *source; guint audio_channel; AgsRecallID **recall_id; };
A
the internal state | |
AgsIteratorThread ** |
Super-threaded related AgsThread. Index 0 playback, 1 sequencer and 2 notation. |
either AgsChannel or AgsRecall | |
destination audio channel | |
AgsRecallID ** |
array pointing to appropriate AgsRecallID. Index 0 playback, 1 sequencer and 2 notation. |
struct AgsDevoutPlayDomain { GObject *domain; gboolean playback; gboolean sequencer; gboolean notation; GList *devout_play; };
A
typedef enum { AGS_DEVOUT_PLAY_DONE = 1, AGS_DEVOUT_PLAY_REMOVE = 1 << 1, AGS_DEVOUT_PLAY_CHANNEL = 1 << 2, AGS_DEVOUT_PLAY_PAD = 1 << 3, AGS_DEVOUT_PLAY_AUDIO = 1 << 4, AGS_DEVOUT_PLAY_PLAYBACK = 1 << 5, AGS_DEVOUT_PLAY_SEQUENCER = 1 << 6, AGS_DEVOUT_PLAY_NOTATION = 1 << 7, AGS_DEVOUT_PLAY_SUPER_THREADED = 1 << 8, } AgsDevoutPlayFlags;
typedef enum { AGS_DEVOUT_RESOLUTION_8_BIT = 8, AGS_DEVOUT_RESOLUTION_16_BIT = 16, AGS_DEVOUT_RESOLUTION_24_BIT = 24, AGS_DEVOUT_RESOLUTION_32_BIT = 32, AGS_DEVOUT_RESOLUTION_64_BIT = 64, } AgsDevoutResolutionMode;
void ags_devout_list_cards (,
GList **card_id);
GList **card_name
List available soundcards.
|
alsa identifier |
|
card name |
Since 0.4
AgsDevout * ags_devout_new (GObject *ags_main
);
Creates an AgsDevout, refering to ags_main
.
Since 0.3
void ags_devout_note_offset_changed (AgsDevout *devout
,);
guint note_offset
void ags_devout_pcm_info (,
char *card_id,
guint *channels_min,
guint *channels_max,
guint *rate_min,
guint *rate_max,
guint *buffer_size_min,
guint *buffer_size_max);
GError **error
List soundcard settings.
|
alsa identifier |
|
minimum channels supported |
|
maximum channels supported |
|
minimum samplerate supported |
|
maximum samplerate supported |
|
minimum buffer size supported
buffer_size_max maximum buffer size supported |
|
on success NULL |
Since 0.4
AgsDevoutPlay * ags_devout_play_alloc ();
Allocs an AgsDevoutPlay.
Returns : |
the devout play |
Since 0.4
AgsDevoutPlayDomain * ags_devout_play_domain_alloc ();
Allocs an AgsDevoutPlayDomain.
Returns : |
the devout play domain |
Since 0.4
void ags_devout_play_domain_free (AgsDevoutPlayDomain *devout_play_domain
);
Frees an AgsDevoutPlayDomain.
|
the devout play domain |
Since 0.4
AgsDevoutPlay * ags_devout_play_find_source (,
GList *devout_play);
GObject *source
Find source
|
a |
Returns : |
the matching devout play |
Since 0.4
void ags_devout_play_free (AgsDevoutPlay *devout_play
);
Frees an AgsDevoutPlay.
|
the devout play |
Since 0.4