## AgsCoreAudioPort

AgsCoreAudioPort — core audio resource.

## Stability Level

Stable, unless otherwise indicated

## Functions

#define | AGS_CORE_AUDIO_PORT_GET_OBJ_MUTEX()
gboolean | ags_core_audio_port_test_flags ()
void | ags_core_audio_port_set_flags ()
void | ags_core_audio_port_unset_flags ()
void | ags_core_audio_port_set_pcm_channels ()
guint | ags_core_audio_port_get_pcm_channels ()
void | ags_core_audio_port_set_buffer_size ()
guint | ags_core_audio_port_get_buffer_size ()
void | ags_core_audio_port_set_format ()
AgsSoundcardFormat | ags_core_audio_port_get_format ()
void | ags_core_audio_port_set_samplerate ()
guint | ags_core_audio_port_get_samplerate ()
GList * | ags_core_audio_port_find ()
void | ags_core_audio_port_register ()
void | ags_core_audio_port_unregister ()
void | ags_core_audio_port_set_cache_buffer_size ()
guint | ags_core_audio_port_get_latency ()
AgsCoreAudioPort * | ags_core_audio_port_new ()

## Properties

guint | buffer-size | Read / Write
AgsCoreAudioClient * | core-audio-client | Read / Write
GObject * | core-audio-device | Read / Write
guint | format | Read / Write
guint | pcm-channels | Read / Write
char * | port-name | Read / Write
guint | samplerate | Read / Write

## Types and Values

#define | AGS_CORE_AUDIO_PORT_DEFAULT_CACHE_BUFFER_SIZE
enum | AgsCoreAudioPortFlags

## Object Hierarchy

        GFlags
        ╰── AgsCoreAudioPortFlags
        GObject
        ╰── AgsCoreAudioPort

## Includes

    #include <ags/audio/core-audio/ags_core_audio_port.h>

## Description

The AgsCoreAudioPort represents either a core audio sequencer or soundcard to communicate with.

## Functions

### AGS_CORE_AUDIO_PORT_GET_OBJ_MUTEX()

    #define AGS_CORE_AUDIO_PORT_GET_OBJ_MUTEX(obj) (&(((AgsCoreAudioPort *) obj)->obj_mutex))

### ags_core_audio_port_test_flags ()

    gboolean
    ags_core_audio_port_test_flags (AgsCoreAudioPort *core_audio_port,
                                    AgsCoreAudioPortFlags flags);

Test `flags` to be set on `core_audio_port` .

#### Parameters

core_audio_port | the AgsCoreAudioPort |
flags | the flags |

#### Returns

`TRUE` if flags are set, else `FALSE`

Since: 3.0.0

### ags_core_audio_port_set_flags ()

    void
    ags_core_audio_port_set_flags (AgsCoreAudioPort *core_audio_port,
                                   AgsCoreAudioPortFlags flags);

Enable a feature of `core_audio_port` .

#### Parameters

core_audio_port | the AgsCoreAudioPort |
flags | see AgsCoreAudioPortFlags |

Since: 3.0.0

### ags_core_audio_port_unset_flags ()

    void
    ags_core_audio_port_unset_flags (AgsCoreAudioPort *core_audio_port,
                                     AgsCoreAudioPortFlags flags);

Disable a feature of `core_audio_port` .

#### Parameters

core_audio_port | the AgsCoreAudioPort |
flags | see AgsCoreAudioPortFlags |

Since: 3.0.0

### ags_core_audio_port_set_pcm_channels ()

    void
    ags_core_audio_port_set_pcm_channels (AgsCoreAudioPort *core_audio_port,
                                          guint pcm_channels);

Set pcm channels of `core_audio_port` .

#### Parameters

core_audio_port | the AgsCoreAudioPort |
pcm_channels | the pcm channels |

Since: 7.3.8

### ags_core_audio_port_get_pcm_channels ()

    guint
    ags_core_audio_port_get_pcm_channels (AgsCoreAudioPort *core_audio_port);

Get pcm channels of `core_audio_port` .

#### Parameters

core_audio_port | the AgsCoreAudioPort |

#### Returns

the pcm channels

Since: 7.3.8

### ags_core_audio_port_set_buffer_size ()

    void
    ags_core_audio_port_set_buffer_size (AgsCoreAudioPort *core_audio_port,
                                         guint buffer_size);

Set buffer size of `core_audio_port` .

#### Parameters

core_audio_port | the AgsCoreAudioPort |
buffer_size | the buffer size |

Since: 7.3.8

### ags_core_audio_port_get_buffer_size ()

    guint
    ags_core_audio_port_get_buffer_size (AgsCoreAudioPort *core_audio_port);

Get buffer size of `core_audio_port` .

#### Parameters

core_audio_port | the AgsCoreAudioPort |

#### Returns

the buffer size

Since: 7.3.8

### ags_core_audio_port_set_format ()

    void
    ags_core_audio_port_set_format (AgsCoreAudioPort *core_audio_port,
                                    AgsSoundcardFormat format);

Set format of `core_audio_port` .

#### Parameters

core_audio_port | the AgsCoreAudioPort |
format | the format |

Since: 7.3.8

### ags_core_audio_port_get_format ()

    AgsSoundcardFormat
    ags_core_audio_port_get_format (AgsCoreAudioPort *core_audio_port);

Get format of `core_audio_port` .

#### Parameters

core_audio_port | the AgsCoreAudioPort |

#### Returns

the format

Since: 7.3.8

### ags_core_audio_port_set_samplerate ()

    void
    ags_core_audio_port_set_samplerate (AgsCoreAudioPort *core_audio_port,
                                        guint samplerate);

Set samplerate of `core_audio_port` .

#### Parameters

core_audio_port | the AgsCoreAudioPort |
samplerate | the samplerate |

Since: 7.3.8

### ags_core_audio_port_get_samplerate ()

    guint
    ags_core_audio_port_get_samplerate (AgsCoreAudioPort *core_audio_port);

Get samplerate of `core_audio_port` .

#### Parameters

core_audio_port | the AgsCoreAudioPort |

#### Returns

the samplerate

Since: 7.3.8

### ags_core_audio_port_find ()

    GList *
    ags_core_audio_port_find (GList *core_audio_port,
                              gchar *port_name);

Finds next match of `port_name` in `core_audio_port` .

#### Parameters

core_audio_port | the GList containing AgsCoreAudioPort. | [element-type AgsAudio.CoreAudioPort][transfer none]
port_name | the port name to find |

#### Returns

the next matching GList or `NULL`.

[element-type AgsAudio.CoreAudioPort][transfer none]

Since: 3.0.0

### ags_core_audio_port_register ()

    void
    ags_core_audio_port_register (AgsCoreAudioPort *core_audio_port,
                                  gchar *port_name,
                                  gboolean is_audio,
                                  gboolean is_midi,
                                  gboolean is_output);

Register a new core audio port and read uuid. Creates a new AgsSequencer or AgsSoundcard object.

#### Parameters

core_audio_port | the AgsCoreAudioPort |
port_name | the name as string |
is_audio | if `TRUE` interpreted as audio port |
is_midi | if `TRUE` interpreted as midi port |
is_output | if `TRUE` port is acting as output, otherwise as input |

Since: 3.0.0

### ags_core_audio_port_unregister ()

    void
    ags_core_audio_port_unregister (AgsCoreAudioPort *core_audio_port);

### ags_core_audio_port_set_cache_buffer_size ()

    void
    ags_core_audio_port_set_cache_buffer_size
                                   (AgsCoreAudioPort *core_audio_port,
                                    guint cache_buffer_size);

### ags_core_audio_port_get_latency ()

    guint
    ags_core_audio_port_get_latency (AgsCoreAudioPort *core_audio_port);

Gets latency.

#### Parameters

core_audio_port | the AgsCoreAudioPort |

Since: 3.0.0

### ags_core_audio_port_new ()

    AgsCoreAudioPort *
    ags_core_audio_port_new (GObject *core_audio_client);

Create a new instance of AgsCoreAudioPort.

#### Parameters

core_audio_client | the AgsCoreAudioClient assigned to |

#### Returns

the new AgsCoreAudioPort

Since: 3.0.0

## Types and Values

### AGS_CORE_AUDIO_PORT_DEFAULT_CACHE_BUFFER_SIZE

    #define AGS_CORE_AUDIO_PORT_DEFAULT_CACHE_BUFFER_SIZE (4096)

### enum AgsCoreAudioPortFlags

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

#### Members

AGS_CORE_AUDIO_PORT_REGISTERED | the port was registered |
AGS_CORE_AUDIO_PORT_IS_AUDIO | the port provides audio data |
AGS_CORE_AUDIO_PORT_IS_MIDI | the port provides midi data |
AGS_CORE_AUDIO_PORT_IS_OUTPUT | the port does output |
AGS_CORE_AUDIO_PORT_IS_INPUT | the port does input |

## Property Details

### The `“buffer-size”` property

      “buffer-size”              guint

The buffer size

Owner: AgsCoreAudioPort

Flags: Read / Write

Allowed values: [16,16384]

Default value: 2048

Since: 7.3.6

### The `“core-audio-client”` property

      “core-audio-client”        AgsCoreAudioClient *

The assigned AgsCoreAudioClient.

Owner: AgsCoreAudioPort

Flags: Read / Write

Since: 3.0.0

### The `“core-audio-device”` property

      “core-audio-device”        GObject *

The assigned AgsCoreAudioDevout.

Owner: AgsCoreAudioPort

Flags: Read / Write

Since: 3.0.0

### The `“format”` property

      “format”                   guint

The precision of the buffer

Owner: AgsCoreAudioPort

Flags: Read / Write

Allowed values: >= 1

Default value: 4294967280

Since: 7.3.6

### The `“pcm-channels”` property

      “pcm-channels”             guint

The pcm channel count

Owner: AgsCoreAudioPort

Flags: Read / Write

Allowed values: [1,64]

Default value: 2

Since: 7.3.6

### The `“port-name”` property

      “port-name”                char *

The core audio soundcard indentifier

Owner: AgsCoreAudioPort

Flags: Read / Write

Default value: NULL

Since: 3.0.0

### The `“samplerate”` property

      “samplerate”               guint

The samplerate

Owner: AgsCoreAudioPort

Flags: Read / Write

Allowed values: [8000,5644800]

Default value: 44100

Since: 7.3.6