AgsAudio

AgsAudio — A container of channels organizing them as input or output

Functions

void ags_audio_set_soundcard ()
void ags_audio_set_flags ()
void ags_audio_unset_flags ()
void ags_audio_check_connection ()
void ags_audio_set_audio_channels ()
void ags_audio_set_pads ()
void ags_audio_set_samplerate ()
void ags_audio_set_buffer_size ()
void ags_audio_set_format ()
void ags_audio_set_sequence_length ()
void ags_audio_add_audio_connection ()
void ags_audio_remove_audio_connection ()
void ags_audio_add_preset ()
void ags_audio_remove_preset ()
void ags_audio_add_notation ()
void ags_audio_remove_notation ()
void ags_audio_add_automation ()
void ags_audio_remove_automation ()
void ags_audio_add_recall_id ()
void ags_audio_remove_recall_id ()
void ags_audio_add_recycling_context ()
void ags_audio_remove_recycling_context ()
void ags_audio_add_recall_container ()
void ags_audio_remove_recall_container ()
void ags_audio_add_recall ()
void ags_audio_remove_recall ()
void ags_audio_recall_change_state ()
AgsRecallID * ags_audio_init_run ()
void ags_audio_duplicate_recall ()
void ags_audio_init_recall ()
void ags_audio_resolve_recall ()
gboolean ags_audio_is_playing ()
void ags_audio_play ()
void ags_audio_tact ()
void ags_audio_done ()
void ags_audio_cancel ()
void ags_audio_remove ()
GList * ags_audio_find_port ()
void ags_audio_open_files ()
void ags_audio_recursive_set_property ()
GList * ags_audio_recursive_play_init ()
AgsAudio * ags_audio_new ()
#define AGS_AUDIO()
#define AGS_AUDIO_CLASS()
#define AGS_AUDIO_GET_CLASS()
#define AGS_IS_AUDIO()
GType ags_audio_get_type ()

Properties

guint audio-channels Read / Write
GObject * audio-connection Read / Write
guint audio-end-mapping Read / Write
guint audio-start-mapping Read / Write
gpointer automation Read / Write
guint buffer-size Read / Write
guint format Read / Write
AgsInput * input Read
guint input-lines Read
guint input-pads Read / Write
guint midi-channel Read / Write
guint midi-end-mapping Read / Write
GObject * midi-file Read / Write
guint midi-start-mapping Read / Write
gpointer notation Read / Write
AgsOutput * output Read
guint output-lines Read
guint output-pads Read / Write
gpointer play Read / Write
AgsPlaybackDomain * playback-domain Read / Write
GObject * preset Read / Write
gpointer recall Read / Write
gpointer recall-container Read / Write
gpointer recall-id Read / Write
gpointer recycling-context Read / Write
guint samplerate Read / Write
guint sequence-length Read / Write
GObject * sequencer Read / Write
GObject * soundcard Read / Write

Signals

Types and Values

enum AgsAudioFlags
#define AGS_TYPE_AUDIO
struct AgsAudio
struct AgsAudioClass

Object Hierarchy

    GObject
    ╰── AgsAudio

Implemented Interfaces

AgsAudio implements AgsConnectable.

Includes

#include <ags/audio/ags_audio.h>

Description

AgsAudio organizes AgsChannel objects either as input or output and is responsible of their alignment. The class can contain AgsRecall objects in order to perform computation on all channels or in audio context. Therefor exists AgsRecyclingContext acting as tree context.

At least one AgsRecallID is assigned to it and has one more if AGS_AUDIO_OUTPUT_HAS_RECYCLING is set as flag.

If AGS_AUDIO_HAS_NOTATION is set as flag one AgsNotation is allocated per audio channel.

Functions

ags_audio_set_soundcard ()

void
ags_audio_set_soundcard (AgsAudio *audio,
                         GObject *soundcard);

Sets a soundcard object on audio.

Parameters

audio

the AgsAudio

 

soundcard

an AgsSoundcard

 

Since: 1.0.0


ags_audio_set_flags ()

void
ags_audio_set_flags (AgsAudio *audio,
                     guint flags);

Enable a feature of AgsAudio.

Parameters

audio

an AgsAudio

 

flags

see enum AgsAudioFlags

 

Since: 1.0.0


ags_audio_unset_flags ()

void
ags_audio_unset_flags (AgsAudio *audio,
                       guint flags);

Disable a feature of AgsAudio.

Parameters

audio

an AgsAudio

 

flags

see enum AgsAudioFlags

 

Since: 1.0.0


ags_audio_check_connection ()

void
ags_audio_check_connection (AgsAudio *audio);

ags_audio_set_audio_channels ()

void
ags_audio_set_audio_channels (AgsAudio *audio,
                              guint audio_channels);

Resize audio channels AgsInput will be allocated first.

Parameters

audio

the AgsAudio

 

audio_channels

new audio channels

 

Since: 1.0.0


ags_audio_set_pads ()

void
ags_audio_set_pads (AgsAudio *audio,
                    GType type,
                    guint pads);

Sets pad count for the apropriate type

Parameters

audio

the AgsAudio

 

type

AGS_TYPE_INPUT or AGS_TYPE_OUTPUT

 

pads

new pad count

 

Since: 1.0.0


ags_audio_set_samplerate ()

void
ags_audio_set_samplerate (AgsAudio *audio,
                          guint samplerate);

Sets buffer length.

Parameters

audio

the AgsAudio

 

samplerate

the samplerate

 

Since: 1.0.0


ags_audio_set_buffer_size ()

void
ags_audio_set_buffer_size (AgsAudio *audio,
                           guint buffer_size);

Sets buffer length.

Parameters

audio

the AgsAudio

 

buffer_size

the buffer_size

 

Since: 1.0.0


ags_audio_set_format ()

void
ags_audio_set_format (AgsAudio *audio,
                      guint format);

Sets buffer length.

Parameters

audio

the AgsAudio

 

format

the format

 

Since: 1.0.0


ags_audio_set_sequence_length ()

void
ags_audio_set_sequence_length (AgsAudio *audio,
                               guint sequence_length);

Sets sequence length.

Parameters

audio

the AgsAudio

 

sequence_length

the sequence length

 

Since: 1.0.0


ags_audio_add_audio_connection ()

void
ags_audio_add_audio_connection (AgsAudio *audio,
                                GObject *audio_connection);

Adds an audio connection.

Parameters

audio

the AgsAudio

 

audio_connection

an AgsAudioConnection

 

Since: 1.0.0


ags_audio_remove_audio_connection ()

void
ags_audio_remove_audio_connection (AgsAudio *audio,
                                   GObject *audio_connection);

Removes an audio connection.

Parameters

audio

the AgsAudio

 

audio_connection

an AgsAudioConnection

 

Since: 1.0.0


ags_audio_add_preset ()

void
ags_audio_add_preset (AgsAudio *audio,
                      GObject *preset);

Adds an preset.

Parameters

audio

the AgsAudio

 

preset

an AgsPreset

 

Since: 1.0.0


ags_audio_remove_preset ()

void
ags_audio_remove_preset (AgsAudio *audio,
                         GObject *preset);

Removes an preset.

Parameters

audio

the AgsAudio

 

preset

an AgsPreset

 

Since: 1.0.0


ags_audio_add_notation ()

void
ags_audio_add_notation (AgsAudio *audio,
                        GObject *notation);

Adds a recall id.

Parameters

audio

the AgsAudio

 

notation

the AgsRecallID

 

Since: 1.0.0


ags_audio_remove_notation ()

void
ags_audio_remove_notation (AgsAudio *audio,
                           GObject *notation);

Removes a recall id.

Parameters

audio

the AgsAudio

 

notation

the AgsRecallID

 

Since: 1.0.0


ags_audio_add_automation ()

void
ags_audio_add_automation (AgsAudio *audio,
                          GObject *automation);

Adds a recall id.

Parameters

audio

the AgsAudio

 

automation

the AgsRecallID

 

Since: 1.0.0


ags_audio_remove_automation ()

void
ags_audio_remove_automation (AgsAudio *audio,
                             GObject *automation);

Removes a recall id.

Parameters

audio

the AgsAudio

 

automation

the AgsRecallID

 

Since: 1.0.0


ags_audio_add_recall_id ()

void
ags_audio_add_recall_id (AgsAudio *audio,
                         GObject *recall_id);

Adds a recall id.

Parameters

audio

the AgsAudio

 

recall_id

the AgsRecallID

 

Since: 1.0.0


ags_audio_remove_recall_id ()

void
ags_audio_remove_recall_id (AgsAudio *audio,
                            GObject *recall_id);

Removes a recall id.

Parameters

audio

the AgsAudio

 

recall_id

the AgsRecallID

 

Since: 1.0.0


ags_audio_add_recycling_context ()

void
ags_audio_add_recycling_context (AgsAudio *audio,
                                 GObject *recycling_context);

Adds a recycling container.

Parameters

audio

the AgsAudio

 

recycling_context

the AgsRecyclingContext

 

Since: 1.0.0


ags_audio_remove_recycling_context ()

void
ags_audio_remove_recycling_context (AgsAudio *audio,
                                    GObject *recycling_context);

Removes a recycling container.

Parameters

audio

the AgsAudio

 

recycling_context

the AgsRecyclingContext

 

Since: 1.0.0


ags_audio_add_recall_container ()

void
ags_audio_add_recall_container (AgsAudio *audio,
                                GObject *recall_container);

Adds a recall container.

Parameters

audio

the AgsAudio

 

recall_container

the AgsRecallContainer

 

Since: 1.0.0


ags_audio_remove_recall_container ()

void
ags_audio_remove_recall_container (AgsAudio *audio,
                                   GObject *recall_container);

Removes a recall container.

Parameters

audio

the AgsAudio

 

recall_container

the AgsRecallContainer

 

Since: 1.0.0


ags_audio_add_recall ()

void
ags_audio_add_recall (AgsAudio *audio,
                      GObject *recall,
                      gboolean play);

Adds a recall.

Parameters

audio

the AgsAudio

 

recall

the AgsRecall

 

play

TRUE if simple playback.

 

Since: 1.0.0


ags_audio_remove_recall ()

void
ags_audio_remove_recall (AgsAudio *audio,
                         GObject *recall,
                         gboolean play);

Removes a recall.

Parameters

audio

the AgsAudio

 

recall

the AgsRecall

 

play

TRUE if simple playback.

 

Since: 1.0.0


ags_audio_recall_change_state ()

void
ags_audio_recall_change_state (AgsAudio *audio,
                               gboolean enable);

ags_audio_init_run ()

AgsRecallID *
ags_audio_init_run (AgsAudio *audio);

Is emitted as audio is initialized.

Parameters

audio

the AgsAudio

 

Returns

the current AgsRecallID

Since: 1.0.0


ags_audio_duplicate_recall ()

void
ags_audio_duplicate_recall (AgsAudio *audio,
                            AgsRecallID *recall_id);

Duplicate all AgsRecall templates of this AgsAudio.

Parameters

audio

the AgsAudio

 

recall_id

an AgsRecallID

 

Since: 1.0.0


ags_audio_init_recall ()

void
ags_audio_init_recall (AgsAudio *audio,
                       gint stage,
                       AgsRecallID *recall_id);

Initializes the recalls of audio

Parameters

audio

the AgsAudio

 

stage

stage benning at 0 up to 2, or just -1

 

recall_id

the AgsRecallID to use or NULL

 

Since: 1.0.0


ags_audio_resolve_recall ()

void
ags_audio_resolve_recall (AgsAudio *audio,
                          AgsRecallID *recall_id);

Performs resolving of recalls.

Parameters

audio

the AgsAudio

 

recall_id

the AgsRecallID to use

 

Since: 1.0.0


ags_audio_is_playing ()

gboolean
ags_audio_is_playing (AgsAudio *audio);

Determine if AgsAudio is playing.

Parameters

audio

the AgsAudio

 

Returns

TRUE if it's playing otherwise FALSE

Since: 1.0.0


ags_audio_play ()

void
ags_audio_play (AgsAudio *audio,
                AgsRecallID *recall_id,
                gint stage);

Performs on single play call of appropriate stage.

Parameters

audio

the AgsAudio

 

recall_id

the AgsRecallID to apply to

 

stage

valid range is from 0 up to 2

 

Since: 1.0.0


ags_audio_tact ()

void
ags_audio_tact (AgsAudio *audio,
                AgsRecallID *recall_id);

Is emitted as audio is played.

Parameters

audio

the AgsAudio

 

recall_id

the current AgsRecallID

 

Since: 1.0.0


ags_audio_done ()

void
ags_audio_done (AgsAudio *audio,
                AgsRecallID *recall_id);

Is emitted as playing audio is done.

Parameters

audio

the AgsAudio

 

recall_id

the current AgsRecallID

 

Since: 1.0.0


ags_audio_cancel ()

void
ags_audio_cancel (AgsAudio *audio,
                  AgsRecallID *recall_id);

Cancel processing audio data.

Parameters

audio

the AgsAudio

 

recall_id

the AgsRecallID to apply to

 

Since: 1.0.0


ags_audio_remove ()

void
ags_audio_remove (AgsAudio *audio,
                  AgsRecallID *recall_id);

Remove processing audio data.

Parameters

audio

the AgsAudio

 

recall_id

the AgsRecallID to apply to

 

Since: 1.0.0


ags_audio_find_port ()

GList *
ags_audio_find_port (AgsAudio *audio);

Retrieve all ports of AgsAudio.

Parameters

audio

the AgsAudio

 

Returns

a new GList containing AgsPort

Since: 1.0.0


ags_audio_open_files ()

void
ags_audio_open_files (AgsAudio *audio,
                      GSList *filenames,
                      gboolean overwrite_channels,
                      gboolean create_channels);

Open some files.

Parameters

audio

the AgsAudio

 

filenames

the files to open

 

overwrite_channels

if existing channels should be assigned

 

create_channels

if new channels should be created as not fitting if combined with overwrite_channels

 

Since: 1.0.0


ags_audio_recursive_set_property ()

void
ags_audio_recursive_set_property (AgsAudio *audio,
                                  GParameter *parameter,
                                  gint n_params);

Recursive set property for AgsAudio.

Parameters

audio

the AgsAudio

 

parameter

the GParameter array containing properties

 

n_params

the length of parameter array

 

Since: 1.0.0


ags_audio_recursive_play_init ()

GList *
ags_audio_recursive_play_init (AgsAudio *audio,
                               gboolean playback,
                               gboolean sequencer,
                               gboolean notation);

Initializes AgsAudio in order to do playback, sequencer or notation.

Parameters

audio

the AgsAudio object

 

playback

if doing playback

 

sequencer

if doing sequencer

 

notation

if doing notation

 

Returns

a list containing all AgsRecallID

Since: 1.0.0


ags_audio_new ()

AgsAudio *
ags_audio_new (GObject *soundcard);

Creates an AgsAudio, with defaults of soundcard .

Parameters

soundcard

an AgsSoundcard

 

Returns

a new AgsAudio

Since: 1.0.0


AGS_AUDIO()

#define AGS_AUDIO(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_AUDIO, AgsAudio))

AGS_AUDIO_CLASS()

#define AGS_AUDIO_CLASS(class)        (G_TYPE_CHECK_CLASS_CAST((class), AGS_TYPE_AUDIO, AgsAudioClass))

AGS_AUDIO_GET_CLASS()

#define AGS_AUDIO_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS((obj), AGS_TYPE_AUDIO, AgsAudioClass))

AGS_IS_AUDIO()

#define AGS_IS_AUDIO(obj)             (G_TYPE_CHECK_INSTANCE_TYPE((obj), AGS_TYPE_AUDIO))

ags_audio_get_type ()

GType
ags_audio_get_type ();

Types and Values

enum AgsAudioFlags

Enum values to control the behavior or indicate internal state of AgsAudio by enable/disable as flags.

Members

AGS_AUDIO_SYNC

input/output is mapped synchronously

 

AGS_AUDIO_ASYNC

input/output is mapped asynchronously

 

AGS_AUDIO_OUTPUT_HAS_RECYCLING

output has recycling

 

AGS_AUDIO_INPUT_HAS_RECYCLING

input has recycling

 

AGS_AUDIO_INPUT_TAKES_FILE

input takes file

 

AGS_AUDIO_INPUT_TAKES_SYNTH

input takes synth

 

AGS_AUDIO_REVERSE_MAPPING

interpret notation reverse

 

AGS_AUDIO_HAS_NOTATION

has notation

 

AGS_AUDIO_NOTATION_DEFAULT

notation default mapped on input channels

 

AGS_AUDIO_PATTERN_MODE

notation only contains fixed size notes

 

AGS_AUDIO_RUNNING

it is running

 

AGS_AUDIO_PLAYING

it is playing

 

AGS_AUDIO_CONNECTED

the audio was connected by AgsConnectable::connect()

 

AGS_AUDIO_CAN_NEXT_ACTIVE

can determine next active input

 

AGS_AUDIO_NO_OUTPUT

no output provided

 

AGS_AUDIO_NO_INPUT

no input provided

 

AGS_AUDIO_SKIP_OUTPUT

skip output as processing audio data

 

AGS_AUDIO_SKIP_INPUT

skip input as processing audio data

 

AGS_TYPE_AUDIO

#define AGS_TYPE_AUDIO                (ags_audio_get_type ())

struct AgsAudio

struct AgsAudio;

struct AgsAudioClass

struct AgsAudioClass {
  GObjectClass object;

  void (*check_connection)(AgsAudio *audio);
  
  void (*set_audio_channels)(AgsAudio *audio,
			     guint audio_channels, guint audio_channels_old);
  void (*set_pads)(AgsAudio *audio,
		   GType type,
		   guint pads, guint pads_old);

  AgsRecallID* (*init_run)(AgsAudio *audio);
  void (*tact)(AgsAudio *audio, AgsRecallID *recall_id);
  void (*done)(AgsAudio *audio, AgsRecallID *recall_id);
};

Property Details

The “audio-channels” property

  “audio-channels”           guint

The audio channels count.

Flags: Read / Write

Allowed values: <= 65535

Default value: 0

Since: 1.0.0


The “audio-connection” property

  “audio-connection”         GObject *

The assigned GList containing AgsAudioConnection information.

Flags: Read / Write

Since: 1.0.0


The “audio-end-mapping” property

  “audio-end-mapping”        guint

The audio end mapping.

Flags: Read / Write

Default value: 0

Since: 1.0.0


The “audio-start-mapping” property

  “audio-start-mapping”      guint

The audio start mapping.

Flags: Read / Write

Default value: 0

Since: 1.0.0


The “automation” property

  “automation”               gpointer

The AgsAutomation it contains.

Flags: Read / Write

Since: 1.0.0


The “buffer-size” property

  “buffer-size”              guint

The buffer size.

Flags: Read / Write

Default value: 0

Since: 1.0.0


The “format” property

  “format”                   guint

The format.

Flags: Read / Write

Default value: 0

Since: 1.0.0


The “input” property

  “input”                    AgsInput *

The AgsInput it contains.

Flags: Read

Since: 1.0.0


The “input-lines” property

  “input-lines”              guint

The input lines count.

Flags: Read

Allowed values: <= 65535

Default value: 0

Since: 1.0.0


The “input-pads” property

  “input-pads”               guint

The input pads count.

Flags: Read / Write

Allowed values: <= 65535

Default value: 0

Since: 1.0.0


The “midi-channel” property

  “midi-channel”             guint

The midi channel.

Flags: Read / Write

Allowed values: <= 16

Default value: 0

Since: 1.0.0


The “midi-end-mapping” property

  “midi-end-mapping”         guint

The midi end mapping.

Flags: Read / Write

Default value: 0

Since: 1.0.0


The “midi-file” property

  “midi-file”                GObject *

The assigned AgsMidiFile acting as default sink.

Flags: Read / Write

Since: 1.0.0


The “midi-start-mapping” property

  “midi-start-mapping”       guint

The midi start mapping.

Flags: Read / Write

Default value: 0

Since: 1.0.0


The “notation” property

  “notation”                 gpointer

The AgsNotation it contains.

Flags: Read / Write

Since: 1.0.0


The “output” property

  “output”                   AgsOutput *

The AgsOutput it contains.

Flags: Read

Since: 1.0.0


The “output-lines” property

  “output-lines”             guint

The output lines count.

Flags: Read

Allowed values: <= 65535

Default value: 0

Since: 1.0.0


The “output-pads” property

  “output-pads”              guint

The output pads count.

Flags: Read / Write

Allowed values: <= 65535

Default value: 0

Since: 1.0.0


The “play” property

  “play”                     gpointer

The AgsRecall it contains in play-context.

Flags: Read / Write

Since: 1.0.0


The “playback-domain” property

  “playback-domain”          AgsPlaybackDomain *

The assigned AgsPlaybackDomain.

Flags: Read / Write

Since: 1.0.0


The “preset” property

  “preset”                   GObject *

The assigned GList containing AgsPreset information.

Flags: Read / Write

Since: 1.0.0


The “recall” property

  “recall”                   gpointer

The AgsRecall it contains in recall-context.

Flags: Read / Write

Since: 1.0.0


The “recall-container” property

  “recall-container”         gpointer

The AgsRecallContainer it contains in container-context.

Flags: Read / Write

Since: 1.0.0


The “recall-id” property

  “recall-id”                gpointer

The assigned AgsRecallID.

Flags: Read / Write

Since: 1.0.0


The “recycling-context” property

  “recycling-context”        gpointer

The assigned AgsRecyclingContext.

Flags: Read / Write

Since: 1.0.0


The “samplerate” property

  “samplerate”               guint

The samplerate.

Flags: Read / Write

Default value: 0

Since: 1.0.0


The “sequence-length” property

  “sequence-length”          guint

The sequence length.

Flags: Read / Write

Default value: 0

Since: 1.0.0


The “sequencer” property

  “sequencer”                GObject *

The assigned AgsSequencer acting as default sink.

Flags: Read / Write

Since: 1.0.0


The “soundcard” property

  “soundcard”                GObject *

The assigned AgsSoundcard acting as default sink.

Flags: Read / Write

Since: 1.0.0

Signal Details

The “check-connection” signal

void
user_function (AgsAudio *audio,
               gpointer  user_data)

The ::check-connection checks your audio connections.

Parameters

audio

the object to init run.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 1.0.0


The “done” signal

void
user_function (AgsAudio *audio,
               GObject  *recall_id,
               gpointer  user_data)

The ::done signal is invoked while terminating playback of audio .

Parameters

audio

the object done playing.

 

recall_id

the appropriate AgsRecallID

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “init-run” signal

GObject*
user_function (AgsAudio *audio,
               gpointer  user_data)

The ::init-run signal is invoked during dynamic initialization of recalls of audio .

Parameters

audio

the object to init run.

 

user_data

user data set when the signal handler was connected.

 

Returns

the current AgsRecallID

Flags: Run Last


The “set-audio-channels” signal

void
user_function (AgsAudio *audio,
               guint     audio_channels_new,
               guint     audio_channels_old,
               gpointer  user_data)

The ::set-audio-channels signal notifies about changes in channel alignment.

Parameters

audio

the object to adjust the channels.

 

audio_channels_new

new audio channel count

 

audio_channels_old

old audio channel count

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “set-pads” signal

void
user_function (AgsAudio *audio,
               gulong    type,
               guint     pads_new,
               guint     pads_old,
               gpointer  user_data)

The ::set-pads signal notifies about changes in channel alignment.

Parameters

audio

the object to adjust pads.

 

type

either AGS_TYPE_INPUT or AGS_TYPE_OUTPUT

 

pads_new

new pad count

 

pads_old

old pad count

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “tact” signal

void
user_function (AgsAudio *audio,
               GObject  *recall_id,
               gpointer  user_data)

The ::tact signal is invoked during playback of recalls of audio .

Parameters

audio

the object playing.

 

recall_id

the appropriate AgsRecallID

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last