AgsSoundcard

AgsSoundcard — unique access to soundcards

Functions

Signals

Types and Values

Object Hierarchy

    GInterface
    ╰── AgsSoundcard

Known Implementations

AgsSoundcard is implemented by AgsDevout and AgsJackDevout.

Includes

#include <ags/object/ags_soundcard.h>

Description

The AgsSoundcard interface gives you a unique access to audio devices.

Functions

ags_soundcard_set_application_context ()

void
ags_soundcard_set_application_context (AgsSoundcard *soundcard,
                                       AgsApplicationContext *application_context);

Set application context.

Parameters

soundcard

an AgsSoundcard

 

application_context

the application context to set

 

Since: 0.4.3


ags_soundcard_get_application_context ()

AgsApplicationContext *
ags_soundcard_get_application_context (AgsSoundcard *soundcard);

Get application context.

Parameters

soundcard

an AgsSoundcard

 

Since: 0.4.3


ags_soundcard_set_application_mutex ()

void
ags_soundcard_set_application_mutex (AgsSoundcard *soundcard,
                                     pthread_mutex_t *application_mutex);

Set application mutex.

Parameters

soundcard

an AgsSoundcard

 

application_mutex

the application mutex to set

 

Since: 0.7.0


ags_soundcard_get_application_mutex ()

pthread_mutex_t *
ags_soundcard_get_application_mutex (AgsSoundcard *soundcard);

Get application mutex.

Parameters

soundcard

an AgsSoundcard

 

Returns

AgsApplicationMutex

Since: 0.7.0


ags_soundcard_set_device ()

void
ags_soundcard_set_device (AgsSoundcard *soundcard,
                          gchar *device_id);

Set device.

Parameters

soundcard

an AgsSoundcard

 

device_id

the device to set

 

Since: 0.4.3


ags_soundcard_get_device ()

gchar *
ags_soundcard_get_device (AgsSoundcard *soundcard);

Get device.

Parameters

soundcard

an AgsSoundcard

 

Returns

the device's identifier

Since: 0.4.3


ags_soundcard_set_presets ()

void
ags_soundcard_set_presets (AgsSoundcard *soundcard,
                           guint channels,
                           guint rate,
                           guint buffer_size,
                           guint format);

Set presets.

Parameters

soundcard

an AgsSoundcard

 

channels

the audio channels

 

rate

the samplerate

 

buffer_size

the buffer size

 

format

the format

 

Since: 0.4.2


ags_soundcard_get_presets ()

void
ags_soundcard_get_presets (AgsSoundcard *soundcard,
                           guint *channels,
                           guint *rate,
                           guint *buffer_size,
                           guint *format);

Get presets.

Parameters

soundcard

an AgsSoundcard

 

channels

the audio channels

 

rate

the samplerate

 

buffer_size

the buffer size

 

format

the format

 

Since: 0.4.2


ags_soundcard_list_cards ()

void
ags_soundcard_list_cards (AgsSoundcard *soundcard,
                          GList **card_id,
                          GList **card_name);

Retrieve card_id and card_name as a list of strings.

Parameters

soundcard

an AgsSoundcard

 

card_id

a list containing card ids

 

card_name

a list containing card names

 

Since: 0.4.2


ags_soundcard_pcm_info ()

void
ags_soundcard_pcm_info (AgsSoundcard *soundcard,
                        gchar *card_id,
                        guint *channels_min,
                        guint *channels_max,
                        guint *rate_min,
                        guint *rate_max,
                        guint *buffer_size_min,
                        guint *buffer_size_max,
                        GError **error);

Retrieve detailed information of card_id soundcard.

Parameters

soundcard

an AgsSoundcard

 

card_id

the selected soundcard by its string identifier

 

channels_min

min channels supported

 

channels_max

max channels supported

 

rate_min

min samplerate supported

 

rate_max

max samplerate supported

 

buffer_size_min

min buffer size supported by soundcard

 

buffer_size_max

max buffer size supported by soundcard

 

error

an error that may occure

 

Since: 0.4.2


ags_soundcard_is_starting ()

gboolean
ags_soundcard_is_starting (AgsSoundcard *soundcard);

Get starting.

Parameters

soundcard

an AgsSoundcard

 

Returns

TRUE if starting, else FALSE

Since: 0.4.3


ags_soundcard_is_playing ()

gboolean
ags_soundcard_is_playing (AgsSoundcard *soundcard);

Get playing.

Parameters

soundcard

an AgsSoundcard

 

Returns

TRUE if playing, else FALSE

Since: 0.4.3


ags_soundcard_is_recording ()

gboolean
ags_soundcard_is_recording (AgsSoundcard *soundcard);

Get recording.

Parameters

soundcard

an AgsSoundcard

 

Returns

TRUE if recording, else FALSE

Since: 0.7.0


ags_soundcard_play_init ()

void
ags_soundcard_play_init (AgsSoundcard *soundcard,
                         GError **error);


ags_soundcard_play ()

void
ags_soundcard_play (AgsSoundcard *soundcard,
                    GError **error);

Plays the current buffer of soundcard.

Parameters

soundcard

an AgsSoundcard

 

error

an error that may occure

 

Since: 0.4.2


ags_soundcard_record_init ()

void
ags_soundcard_record_init (AgsSoundcard *soundcard,
                           GError **error);


ags_soundcard_record ()

void
ags_soundcard_record (AgsSoundcard *soundcard,
                      GError **error);

Records the current buffer of soundcard.

Parameters

soundcard

an AgsSoundcard

 

error

an error that may occure

 

Since: 0.7.0


ags_soundcard_stop ()

void
ags_soundcard_stop (AgsSoundcard *soundcard);

Stops the soundcard from playing to it.

Parameters

soundcard

an AgsSoundcard

 

Since: 0.4.2


ags_soundcard_tic ()

void
ags_soundcard_tic (AgsSoundcard *soundcard);

Every call to play may generate a tic.

Parameters

soundcard

an AgsSoundcard

 

Since: 0.4.2


ags_soundcard_offset_changed ()

void
ags_soundcard_offset_changed (AgsSoundcard *soundcard,
                              guint note_offset);

Callback when counter expires minor note offset.

Parameters

soundcard

an AgsSoundcard

 

note_offset

the current note offset

 

Since: 0.4.2


ags_soundcard_get_buffer ()

void *
ags_soundcard_get_buffer (AgsSoundcard *soundcard);

Get current playback buffer.

Parameters

soundcard

an AgsSoundcard

 

Returns

current playback buffer

Since: 0.4.2


ags_soundcard_get_next_buffer ()

void *
ags_soundcard_get_next_buffer (AgsSoundcard *soundcard);

Get future playback buffer.

Parameters

soundcard

an AgsSoundcard

 

Returns

next playback buffer

Since: 0.4.2


ags_soundcard_set_bpm ()

void
ags_soundcard_set_bpm (AgsSoundcard *soundcard,
                       gdouble bpm);

Set current playback bpm.

Parameters

soundcard

an AgsSoundcard

 

bpm

the bpm to set

 

Since: 0.4.3


ags_soundcard_get_bpm ()

gdouble
ags_soundcard_get_bpm (AgsSoundcard *soundcard);

Get current playback bpm.

Parameters

soundcard

an AgsSoundcard

 

Returns

bpm

Since: 0.4.3


ags_soundcard_set_delay_factor ()

void
ags_soundcard_set_delay_factor (AgsSoundcard *soundcard,
                                gdouble delay_factor);

Set current playback delay factor.

Parameters

soundcard

an AgsSoundcard

 

delay_factor

the delay factor to set

 

Since: 0.7.0


ags_soundcard_get_delay_factor ()

gdouble
ags_soundcard_get_delay_factor (AgsSoundcard *soundcard);

Get current playback delay factor.

Parameters

soundcard

an AgsSoundcard

 

Returns

delay factor

Since: 0.7.0


ags_soundcard_get_delay ()

gdouble
ags_soundcard_get_delay (AgsSoundcard *soundcard);

Get current playback delay.

Parameters

soundcard

an AgsSoundcard

 

Returns

delay

Since: 0.4.2


ags_soundcard_get_attack ()

guint
ags_soundcard_get_attack (AgsSoundcard *soundcard);

Get current playback attack.

Parameters

soundcard

an AgsSoundcard

 

Returns

attack

Since: 0.4.2


ags_soundcard_get_delay_counter ()

guint
ags_soundcard_get_delay_counter (AgsSoundcard *soundcard);

Get current playback note offset.

Parameters

soundcard

an AgsSoundcard

 

Returns

offset

Since: 0.7.6


ags_soundcard_set_note_offset ()

void
ags_soundcard_set_note_offset (AgsSoundcard *soundcard,
                               guint note_offset);

Set current playback note offset.

Parameters

soundcard

an AgsSoundcard

 

note_offset

the note offset to set

 

Since: 0.4.2


ags_soundcard_get_note_offset ()

guint
ags_soundcard_get_note_offset (AgsSoundcard *soundcard);

Get current playback note offset.

Parameters

soundcard

an AgsSoundcard

 

Returns

offset

Since: 0.4.2


ags_soundcard_set_loop ()

void
ags_soundcard_set_loop (AgsSoundcard *soundcard,
                        guint loop_left,
                        guint loop_right,
                        gboolean loop);

Since: 0.7.35


ags_soundcard_get_loop ()

void
ags_soundcard_get_loop (AgsSoundcard *soundcard,
                        guint *loop_left,
                        guint *loop_right,
                        gboolean *do_loop);

Since: 0.7.35


ags_soundcard_get_loop_offset ()

guint
ags_soundcard_get_loop_offset (AgsSoundcard *soundcard);

Get current playback loop offset.

Parameters

soundcard

an AgsSoundcard

 

Returns

offset

Since: 0.7.35


ags_soundcard_set_audio ()

void
ags_soundcard_set_audio (AgsSoundcard *soundcard,
                         GList *audio);

Set audio.

Parameters

soundcard

an AgsSoundcard

 

audio

the audio to set

 

Since: 0.4.3


ags_soundcard_get_audio ()

GList *
ags_soundcard_get_audio (AgsSoundcard *soundcard);

Get audio.

Parameters

soundcard

an AgsSoundcard

 

Returns

a GList container AgsAudio

Since: 0.4.3

Types and Values

AGS_SOUNDCARD_DEFAULT_DSP_CHANNELS

#define AGS_SOUNDCARD_DEFAULT_DSP_CHANNELS (2)


AGS_SOUNDCARD_DEFAULT_PCM_CHANNELS

#define AGS_SOUNDCARD_DEFAULT_PCM_CHANNELS (2)


AGS_SOUNDCARD_DEFAULT_SAMPLERATE

#define AGS_SOUNDCARD_DEFAULT_SAMPLERATE (44100.0)


AGS_SOUNDCARD_DEFAULT_FORMAT

#define AGS_SOUNDCARD_DEFAULT_FORMAT (AGS_SOUNDCARD_SIGNED_16_BIT)


AGS_SOUNDCARD_DEFAULT_BUFFER_SIZE

#define AGS_SOUNDCARD_DEFAULT_BUFFER_SIZE (944)


AGS_SOUNDCARD_DEFAULT_DEVICE

#define AGS_SOUNDCARD_DEFAULT_DEVICE "hw:0,0\0"


AGS_SOUNDCARD_DEFAULT_BPM

#define AGS_SOUNDCARD_DEFAULT_BPM (120.0)


AGS_SOUNDCARD_DEFAULT_DELAY_FACTOR

#define AGS_SOUNDCARD_DEFAULT_DELAY_FACTOR (1.0 / 4.0)


AGS_SOUNDCARD_DEFAULT_JIFFIE

#define AGS_SOUNDCARD_DEFAULT_JIFFIE ((double) AGS_SOUNDCARD_DEFAULT_SAMPLERATE / (double) AGS_SOUNDCARD_DEFAULT_BUFFER_SIZE)


AGS_SOUNDCARD_DEFAULT_TACT

#define AGS_SOUNDCARD_DEFAULT_TACT (1.0 / 1.0)


AGS_SOUNDCARD_DEFAULT_TACT_JIFFIE

#define AGS_SOUNDCARD_DEFAULT_TACT_JIFFIE (60.0 / AGS_SOUNDCARD_DEFAULT_BPM * AGS_SOUNDCARD_DEFAULT_TACT)


AGS_SOUNDCARD_DEFAULT_TACTRATE

#define AGS_SOUNDCARD_DEFAULT_TACTRATE (1.0 / AGS_SOUNDCARD_DEFAULT_TACT_JIFFIE)


AGS_SOUNDCARD_DEFAULT_SCALE

#define AGS_SOUNDCARD_DEFAULT_SCALE (1.0)


AGS_SOUNDCARD_DEFAULT_DELAY

#define AGS_SOUNDCARD_DEFAULT_DELAY (AGS_SOUNDCARD_DEFAULT_JIFFIE * (60.0 / AGS_SOUNDCARD_DEFAULT_BPM))


AGS_SOUNDCARD_DEFAULT_PERIOD

#define AGS_SOUNDCARD_DEFAULT_PERIOD (64.0)


AGS_SOUNDCARD_DEFAULT_LOOP_LEFT

#define AGS_SOUNDCARD_DEFAULT_LOOP_LEFT (0)


AGS_SOUNDCARD_DEFAULT_LOOP_RIGHT

#define AGS_SOUNDCARD_DEFAULT_LOOP_RIGHT (64)


AGS_SOUNDCARD_DEFAULT_OVERCLOCK

#define AGS_SOUNDCARD_DEFAULT_OVERCLOCK (0.0)


enum AgsSoundcardFormat

Members

AGS_SOUNDCARD_SIGNED_8_BIT

   

AGS_SOUNDCARD_SIGNED_16_BIT

   

AGS_SOUNDCARD_SIGNED_24_BIT

   

AGS_SOUNDCARD_SIGNED_32_BIT

   

AGS_SOUNDCARD_SIGNED_64_BIT

   

Signal Details

The “offset-changed” signal

void
user_function (AgsSoundcard *soundcard,
               guint         note_offset,
               gpointer      user_data)

Flags: Run Last


The “tic” signal

void
user_function (AgsSoundcard *soundcard,
               gpointer      user_data)

Flags: Run Last