Ags.Soundcard

g Ags.Soundcard Ags.Soundcard GObject.GInterface GObject.GInterface GObject.GInterface->Ags.Soundcard

Implementations:

None

Methods

class

helper_config_get_buffer_size (config)

class

helper_config_get_cache_buffer_size (config)

class

helper_config_get_dsp_channels (config)

class

helper_config_get_format (config)

class

helper_config_get_pcm_channels (config)

class

helper_config_get_samplerate (config)

class

helper_config_get_use_cache (config)

get_bpm ()

get_buffer ()

get_capability ()

get_device ()

get_next_buffer ()

get_presets ()

get_prev_buffer ()

get_start_note_offset ()

get_sub_block_count ()

get_uptime ()

is_available ()

is_playing ()

is_recording ()

is_starting ()

list_cards ()

lock_buffer (buffer)

offset_changed (note_offset)

pcm_info (card_id)

play ()

play_init ()

record ()

record_init ()

set_bpm (bpm)

set_device (card_id)

set_presets (channels, rate, buffer_size, format)

set_start_note_offset (start_note_offset)

stop ()

tic ()

trylock_sub_block (buffer, sub_block)

unlock_buffer (buffer)

unlock_sub_block (buffer, sub_block)

Virtual Methods

do_get_bpm ()

do_get_buffer ()

do_get_capability ()

do_get_device ()

do_get_next_buffer ()

do_get_presets ()

do_get_prev_buffer ()

do_get_start_note_offset ()

do_get_sub_block_count ()

do_get_uptime ()

do_is_available ()

do_is_playing ()

do_is_recording ()

do_is_starting ()

do_list_cards ()

do_lock_buffer (buffer)

do_offset_changed (note_offset)

do_pcm_info (card_id)

do_play ()

do_play_init ()

do_record ()

do_record_init ()

do_set_bpm (bpm)

do_set_device (card_id)

do_set_presets (channels, rate, buffer_size, format)

do_set_start_note_offset (start_note_offset)

do_stop ()

do_tic ()

do_trylock_sub_block (buffer, sub_block)

do_unlock_buffer (buffer)

do_unlock_sub_block (buffer, sub_block)

Properties

None

Signals

Name

Short Description

offset-changed

The ::offset-changed signal notifies about changed position within notation.

stop

The ::stop signal is emitted every stop of the soundcard.

tic

The ::tic signal is emitted every tic of the soundcard.

Fields

None

Class Details

class Ags.Soundcard
Bases:

GObject.GInterface

Structure:

Ags.SoundcardInterface

classmethod helper_config_get_buffer_size(config)
Parameters:

config (Ags.Config) – the Ags.Config

Returns:

the buffer size

Return type:

int

Get buffer size.

Added in version 3.0.0.

classmethod helper_config_get_cache_buffer_size(config)
Parameters:

config (Ags.Config) – the Ags.Config

Returns:

the cache buffer size

Return type:

int

Get cache buffer size.

Added in version 6.10.4.

classmethod helper_config_get_dsp_channels(config)
Parameters:

config (Ags.Config) – the Ags.Config

Returns:

the count of dsp channels

Return type:

int

Get dsp channels count.

Added in version 3.0.0.

classmethod helper_config_get_format(config)
Parameters:

config (Ags.Config) – the Ags.Config

Returns:

the format

Return type:

int

Get format as Ags.SoundcardFormat-enum.

Added in version 3.0.0.

classmethod helper_config_get_pcm_channels(config)
Parameters:

config (Ags.Config) – the Ags.Config

Returns:

the count of pcm channels

Return type:

int

Get pcm channels count.

Added in version 3.0.0.

classmethod helper_config_get_samplerate(config)
Parameters:

config (Ags.Config) – the Ags.Config

Returns:

the samplerate

Return type:

float

Get samplerate.

Added in version 3.0.0.

classmethod helper_config_get_use_cache(config)
Parameters:

config (Ags.Config) – the Ags.Config

Returns:

if use cache True, otherwise False

Return type:

bool

Get use cache.

Added in version 6.10.4.

get_bpm()
Returns:

bpm

Return type:

float

Get current playback bpm.

Added in version 3.0.0.

get_buffer()
Returns:

current playback buffer

Return type:

object or None

Get current playback buffer.

Added in version 3.0.0.

get_capability()
Returns:

the capablities flags

Return type:

Ags.SoundcardCapability

Retrieve Ags.SoundcardCapability-enum information.

Added in version 3.0.0.

get_device()
Returns:

the device’s identifier

Return type:

str

Get device.

Added in version 3.0.0.

get_next_buffer()
Returns:

next playback buffer

Return type:

object or None

Get future playback buffer.

Added in version 3.0.0.

get_presets()
Returns:

channels:

the audio channels

rate:

the samplerate

buffer_size:

the buffer size

format:

the format

Return type:

(channels: int, rate: int, buffer_size: int, format: Ags.SoundcardFormat)

Get presets.

Added in version 3.0.0.

get_prev_buffer()
Returns:

prev playback buffer

Return type:

object or None

Get future playback buffer.

Added in version 3.0.0.

get_start_note_offset()
Returns:

start note offset

Return type:

int

Get current playback start note offset.

Added in version 9.0.0.

get_sub_block_count()
Returns:

the sub block count

Return type:

int

Get sub block count.

Added in version 3.0.0.

get_uptime()
Returns:

playback time as string

Return type:

str

Get playback time as string.

Added in version 3.0.0.

is_available()
Returns:

True if available, else False

Return type:

bool

Get available.

Added in version 3.0.0.

is_playing()
Returns:

True if playing, else False

Return type:

bool

Get playing.

Added in version 3.0.0.

is_recording()
Returns:

True if recording, else False

Return type:

bool

Get recording.

Added in version 3.0.0.

is_starting()
Returns:

True if starting, else False

Return type:

bool

Get starting.

Added in version 3.0.0.

list_cards()
Returns:

card_id:

a list containing card ids

card_name:

a list containing card names

Return type:

(card_id: [str], card_name: [str])

Retrieve card_id and card_name as a list of strings.

Added in version 3.0.0.

lock_buffer(buffer)
Parameters:

buffer (object or None) – the buffer to lock

Lock buffer.

Added in version 3.0.0.

offset_changed(note_offset)
Parameters:

note_offset (int) – the current note offset

Callback when counter expires minor note offset.

Added in version 3.0.0.

pcm_info(card_id)
Parameters:

card_id (str) – the selected soundcard by its string identifier

Raises:

GLib.Error

Returns:

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

Return type:

(channels_min: int, channels_max: int, rate_min: int, rate_max: int, buffer_size_min: int, buffer_size_max: int)

Retrieve detailed information of card_id soundcard.

Added in version 3.0.0.

play()
Raises:

GLib.Error

Plays the current buffer of soundcard.

Added in version 3.0.0.

play_init()
Raises:

GLib.Error

Initializes the soundcard for playback.

Added in version 3.0.0.

record()
Raises:

GLib.Error

Records the current buffer of soundcard.

Added in version 3.0.0.

record_init()
Raises:

GLib.Error

Initializes the soundcard for recordback.

Added in version 3.0.0.

set_bpm(bpm)
Parameters:

bpm (float) – the bpm to set

Set current playback bpm.

Added in version 3.0.0.

set_device(card_id)
Parameters:

card_id (str) – the device to set

Set device.

Added in version 3.0.0.

set_presets(channels, rate, buffer_size, format)
Parameters:
  • channels (int) – the audio channels

  • rate (int) – the samplerate

  • buffer_size (int) – the buffer size

  • format (Ags.SoundcardFormat) – the format

Set presets.

Added in version 3.0.0.

set_start_note_offset(start_note_offset)
Parameters:

start_note_offset (int) – the start note offset to set

Set current playback start note offset.

Added in version 9.0.0.

stop()

Stops the soundcard from playing to it.

Added in version 3.0.0.

tic()

Every call to play may generate a tic.

Added in version 3.0.0.

trylock_sub_block(buffer, sub_block)
Parameters:
  • buffer (object or None) – the buffer to lock

  • sub_block (int) – and its sub block

Returns:

True on success, otherwise False

Return type:

bool

Trylock sub block.

Added in version 3.0.0.

unlock_buffer(buffer)
Parameters:

buffer (object or None) – the buffer to unlock

Unlock buffer.

Added in version 3.0.0.

unlock_sub_block(buffer, sub_block)
Parameters:
  • buffer (object or None) – the buffer to lock

  • sub_block (int) – and its sub block

Unlock sub block.

Added in version 3.0.0.

do_get_bpm() virtual
Returns:

bpm

Return type:

float

Get current playback bpm.

Added in version 3.0.0.

do_get_buffer() virtual
Returns:

current playback buffer

Return type:

object or None

Get current playback buffer.

Added in version 3.0.0.

do_get_capability() virtual
Returns:

the capablities flags

Return type:

Ags.SoundcardCapability

Retrieve Ags.SoundcardCapability-enum information.

Added in version 3.0.0.

do_get_device() virtual
Returns:

the device’s identifier

Return type:

str

Get device.

Added in version 3.0.0.

do_get_next_buffer() virtual
Returns:

next playback buffer

Return type:

object or None

Get future playback buffer.

Added in version 3.0.0.

do_get_presets() virtual
Returns:

channels:

the audio channels

rate:

the samplerate

buffer_size:

the buffer size

format:

the format

Return type:

(channels: int, rate: int, buffer_size: int, format: Ags.SoundcardFormat)

Get presets.

Added in version 3.0.0.

do_get_prev_buffer() virtual
Returns:

prev playback buffer

Return type:

object or None

Get future playback buffer.

Added in version 3.0.0.

do_get_start_note_offset() virtual
Returns:

start note offset

Return type:

int

Get current playback start note offset.

Added in version 9.0.0.

do_get_sub_block_count() virtual
Returns:

the sub block count

Return type:

int

Get sub block count.

Added in version 3.0.0.

do_get_uptime() virtual
Returns:

playback time as string

Return type:

str

Get playback time as string.

Added in version 3.0.0.

do_is_available() virtual
Returns:

True if available, else False

Return type:

bool

Get available.

Added in version 3.0.0.

do_is_playing() virtual
Returns:

True if playing, else False

Return type:

bool

Get playing.

Added in version 3.0.0.

do_is_recording() virtual
Returns:

True if recording, else False

Return type:

bool

Get recording.

Added in version 3.0.0.

do_is_starting() virtual
Returns:

True if starting, else False

Return type:

bool

Get starting.

Added in version 3.0.0.

do_list_cards() virtual
Returns:

card_id:

a list containing card ids

card_name:

a list containing card names

Return type:

(card_id: [str], card_name: [str])

Retrieve card_id and card_name as a list of strings.

Added in version 3.0.0.

do_lock_buffer(buffer) virtual
Parameters:

buffer (object or None) – the buffer to lock

Lock buffer.

Added in version 3.0.0.

do_offset_changed(note_offset) virtual
Parameters:

note_offset (int) – the current note offset

Callback when counter expires minor note offset.

Added in version 3.0.0.

do_pcm_info(card_id) virtual
Parameters:

card_id (str) – the selected soundcard by its string identifier

Returns:

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

Return type:

(channels_min: int, channels_max: int, rate_min: int, rate_max: int, buffer_size_min: int, buffer_size_max: int)

Retrieve detailed information of card_id soundcard.

Added in version 3.0.0.

do_play() virtual

Plays the current buffer of soundcard.

Added in version 3.0.0.

do_play_init() virtual

Initializes the soundcard for playback.

Added in version 3.0.0.

do_record() virtual

Records the current buffer of soundcard.

Added in version 3.0.0.

do_record_init() virtual

Initializes the soundcard for recordback.

Added in version 3.0.0.

do_set_bpm(bpm) virtual
Parameters:

bpm (float) – the bpm to set

Set current playback bpm.

Added in version 3.0.0.

do_set_device(card_id) virtual
Parameters:

card_id (str) – the device to set

Set device.

Added in version 3.0.0.

do_set_presets(channels, rate, buffer_size, format) virtual
Parameters:
  • channels (int) – the audio channels

  • rate (int) – the samplerate

  • buffer_size (int) – the buffer size

  • format (Ags.SoundcardFormat) – the format

Set presets.

Added in version 3.0.0.

do_set_start_note_offset(start_note_offset) virtual
Parameters:

start_note_offset (int) – the start note offset to set

Set current playback start note offset.

Added in version 9.0.0.

do_stop() virtual

Stops the soundcard from playing to it.

Added in version 3.0.0.

do_tic() virtual

Every call to play may generate a tic.

Added in version 3.0.0.

do_trylock_sub_block(buffer, sub_block) virtual
Parameters:
  • buffer (object or None) – the buffer to lock

  • sub_block (int) – and its sub block

Returns:

True on success, otherwise False

Return type:

bool

Trylock sub block.

Added in version 3.0.0.

do_unlock_buffer(buffer) virtual
Parameters:

buffer (object or None) – the buffer to unlock

Unlock buffer.

Added in version 3.0.0.

do_unlock_sub_block(buffer, sub_block) virtual
Parameters:
  • buffer (object or None) – the buffer to lock

  • sub_block (int) – and its sub block

Unlock sub block.

Added in version 3.0.0.

Signal Details

Ags.Soundcard.signals.offset_changed(soundcard, note_offset)
Signal Name:

offset-changed

Flags:

RUN_LAST

Parameters:
  • soundcard (Ags.Soundcard) – The object which received the signal

  • note_offset (int) – new notation offset

The ::offset-changed signal notifies about changed position within notation.

Added in version 3.0.0.

Ags.Soundcard.signals.stop(soundcard)
Signal Name:

stop

Flags:

RUN_LAST

Parameters:

soundcard (Ags.Soundcard) – The object which received the signal

The ::stop signal is emitted every stop of the soundcard. This notifies about a newly played buffer.

Added in version 3.0.0.

Ags.Soundcard.signals.tic(soundcard)
Signal Name:

tic

Flags:

RUN_LAST

Parameters:

soundcard (Ags.Soundcard) – The object which received the signal

The ::tic signal is emitted every tic of the soundcard. This notifies about a newly played buffer.

Added in version 3.0.0.