## AgsPort

AgsPort — Perform thread-safe operations

## Stability Level

Stable, unless otherwise indicated

## Functions

#define | AGS_PORT_GET_OBJ_MUTEX()
gboolean | ags_port_test_flags ()
void | ags_port_set_flags ()
void | ags_port_unset_flags ()
GObject * | ags_port_get_plugin_port ()
void | ags_port_set_plugin_port ()
void | ags_port_safe_read ()
void | ags_port_safe_read_raw ()
void | ags_port_safe_write ()
void | ags_port_safe_write_raw ()
void | ags_port_safe_get_property ()
void | ags_port_safe_set_property ()
GList * | ags_port_find_specifier ()
GList * | ags_port_find_plugin_port ()
guint | ags_port_get_line ()
GType | ags_port_get_channel_type ()
GList * | ags_port_get_automation ()
void | ags_port_add_automation ()
void | ags_port_remove_automation ()
AgsPort * | ags_port_new ()

## Properties

gpointer | automation | Read / Write
GType * | channel-type | Read / Write
char * | control-port | Read / Write
AgsConversion * | conversion | Read / Write
guint | line | Read / Write
char * | plugin-name | Read / Write
AgsPluginPort * | plugin-port | Read / Write
gboolean | port-value-is-pointer | Read / Write
guint | port-value-length | Read / Write
guint | port-value-size | Read / Write
GType * | port-value-type | Read / Write
char * | specifier | Read / Write

## Signals

void | safe-get-property | Run Last
void | safe-read | Run Last
void | safe-set-property | Run Last
void | safe-write | Run Last

## Types and Values

enum | AgsPortFlags

## Object Hierarchy

        GFlags
        ╰── AgsPortFlags
        GObject
        ╰── AgsPort

## Includes

    #include <ags/audio/ags_port.h>

## Description

AgsPort provides a thread-safe way to access or change values or properties.

The `specifier` property has to be unique within context.

You call `ags_port_safe_write()` to alter a value or `ags_port_safe_read()` to read a port.

## Functions

### AGS_PORT_GET_OBJ_MUTEX()

    #define AGS_PORT_GET_OBJ_MUTEX(obj) (&(((AgsPort *) obj)->obj_mutex))

### ags_port_test_flags ()

    gboolean
    ags_port_test_flags (AgsPort *port,
                         AgsPortFlags flags);

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

#### Parameters

port | the AgsPort |
flags | the flags |

#### Returns

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

Since: 3.0.0

### ags_port_set_flags ()

    void
    ags_port_set_flags (AgsPort *port,
                        AgsPortFlags flags);

Set flags.

#### Parameters

port | the AgsPort |
flags | the flags |

Since: 3.0.0

### ags_port_unset_flags ()

    void
    ags_port_unset_flags (AgsPort *port,
                          AgsPortFlags flags);

Unset flags.

#### Parameters

port | the AgsPort |
flags | the flags |

Since: 3.0.0

### ags_port_get_plugin_port ()

    GObject *
    ags_port_get_plugin_port (AgsPort *port);

Get the plugin port of `port` .

#### Parameters

port | the AgsPort |

#### Returns

the plugin port.

[transfer full]

Since: 7.0.0

### ags_port_set_plugin_port ()

    void
    ags_port_set_plugin_port (AgsPort *port,
                              GObject *plugin_port);

Set the plugin port of `port` .

#### Parameters

port | the AgsPort |
plugin_port | the AgsPluginPort |

Since: 7.0.0

### ags_port_safe_read ()

    void
    ags_port_safe_read (AgsPort *port,
                        GValue *value);

Perform safe read.

#### Parameters

port | an AgsPort |
value | the GValue to store result |

Since: 3.0.0

### ags_port_safe_read_raw ()

    void
    ags_port_safe_read_raw (AgsPort *port,
                            GValue *value);

Perform safe read.

#### Parameters

port | an AgsPort |
value | the GValue to store result |

Since: 3.0.0

### ags_port_safe_write ()

    void
    ags_port_safe_write (AgsPort *port,
                         GValue *value);

Perform safe write.

#### Parameters

port | an AgsPort |
value | the GValue containing data |

Since: 3.0.0

### ags_port_safe_write_raw ()

    void
    ags_port_safe_write_raw (AgsPort *port,
                             GValue *value);

### ags_port_safe_get_property ()

    void
    ags_port_safe_get_property (AgsPort *port,
                                gchar *property_name,
                                GValue *value);

Perform safe get property.

#### Parameters

port | an AgsPort |
property_name | the property's name |
value | the GValue to store the result |

Since: 3.0.0

### ags_port_safe_set_property ()

    void
    ags_port_safe_set_property (AgsPort *port,
                                gchar *property_name,
                                GValue *value);

Perform safe set property.

#### Parameters

port | an AgsPort |
property_name | the property's name |
value | the GValue containing data |

Since: 3.0.0

### ags_port_find_specifier ()

    GList *
    ags_port_find_specifier (GList *port,
                             gchar *specifier);

Retrieve port by specifier.

#### Parameters

port | the GList containing AgsPort. | [element-type AgsAudio.Port][transfer none]
specifier | the recall specifier to match |

#### Returns

Next matching GList or `NULL`.

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

Since: 3.0.0

### ags_port_find_plugin_port ()

    GList *
    ags_port_find_plugin_port (GList *port,
                               GObject *plugin_port);

Retrieve port by plugin port.

#### Parameters

port | the GList containing AgsPort. | [element-type AgsAudio.Port][transfer none]
plugin_port | the AgsPluginPort |

#### Returns

Next matching GList or `NULL`.

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

Since: 3.11.4

### ags_port_get_line ()

    guint
    ags_port_get_line (AgsPort *port);

Get line.

#### Parameters

port | the AgsPort |

#### Returns

get line

Since: 5.4.0

### ags_port_get_channel_type ()

    GType
    ags_port_get_channel_type (AgsPort *port);

Get channel type.

#### Parameters

port | the AgsPort |

#### Returns

get channel type

Since: 5.4.0

### ags_port_get_automation ()

    GList *
    ags_port_get_automation (AgsPort *port);

Get automation.

#### Parameters

port | the AgsPort |

#### Returns

get automation GList.

[element-type AgsAudio.Port][transfer full]

Since: 5.4.0

### ags_port_add_automation ()

    void
    ags_port_add_automation (AgsPort *port,
                             GObject *automation);

Adds an automation.

#### Parameters

port | the AgsPort |
automation | the AgsAutomation |

Since: 3.0.0

### ags_port_remove_automation ()

    void
    ags_port_remove_automation (AgsPort *port,
                                GObject *automation);

Removes an automation.

#### Parameters

port | the AgsPort |
automation | the AgsAutomation |

Since: 3.0.0

### ags_port_new ()

    AgsPort *
    ags_port_new ();

Creates an AgsPort.

#### Returns

a new AgsPort.

Since: 3.0.0

## Types and Values

### enum AgsPortFlags

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

#### Members

AGS_PORT_CONVERT_ALWAYS | convert always |
AGS_PORT_USE_LADSPA_FLOAT | use ladspa float |
AGS_PORT_IS_OUTPUT | is output |
AGS_PORT_INFINITE_RANGE | infinite range |

## Property Details

### The `“automation”` property

      “automation”               gpointer

The port's automation.

[transfer full]

Owner: AgsPort

Flags: Read / Write

Since: 3.0.0

### The `“channel-type”` property

      “channel-type”             GType *

The port's channel type.

Owner: AgsPort

Flags: Read / Write

Allowed values: void

Since: 5.4.0

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

      “control-port”             char *

The assigned plugin control port.

Owner: AgsPort

Flags: Read / Write

Default value: NULL

Since: 3.0.0

### The `“conversion”` property

      “conversion”               AgsConversion *

The port's conversion object.

Owner: AgsPort

Flags: Read / Write

Since: 3.0.0

### The `“line”` property

      “line”                     guint

The port's line.

Owner: AgsPort

Flags: Read / Write

Default value: 0

Since: 5.4.0

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

      “plugin-name”              char *

The assigned plugin.

Owner: AgsPort

Flags: Read / Write

Default value: NULL

Since: 3.0.0

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

      “plugin-port”              AgsPluginPort *

The plugin-port.

Owner: AgsPort

Flags: Read / Write

Since: 3.0.0

### The `“port-value-is-pointer”` property

      “port-value-is-pointer”    gboolean

Specify port data as pointer.

Owner: AgsPort

Flags: Read / Write

Default value: FALSE

Since: 3.0.0

### The `“port-value-length”` property

      “port-value-length”        guint

The port's data array length.

Owner: AgsPort

Flags: Read / Write

Default value: 1

Since: 3.0.0

### The `“port-value-size”` property

      “port-value-size”          guint

The port's data type size.

Owner: AgsPort

Flags: Read / Write

Allowed values: [1,16]

Default value: 8

Since: 3.0.0

### The `“port-value-type”` property

      “port-value-type”          GType *

The port's data type.

Owner: AgsPort

Flags: Read / Write

Allowed values: void

Since: 3.0.0

### The `“specifier”` property

      “specifier”                char *

The assigned plugin identifier.

Owner: AgsPort

Flags: Read / Write

Default value: NULL

Since: 3.0.0

## Signal Details

### The `“safe-get-property”` signal

    void
    user_function (AgsPort *port,
                   char    *property_name,
                   gpointer value,
                   gpointer user_data)

The ::safe-get-property signal is emited while safe get property.

#### Parameters

port | the object providing safe get property |
property_name | the property name |
value | the GValue |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.0.0

### The `“safe-read”` signal

    void
    user_function (AgsPort *port,
                   gpointer value,
                   gpointer user_data)

The ::safe-read signal is emited while doing safe read operation.

#### Parameters

port | the object providing safe read |
value | the GValue |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.0.0

### The `“safe-set-property”` signal

    void
    user_function (AgsPort *port,
                   char    *property_name,
                   gpointer value,
                   gpointer user_data)

The ::safe-set-property signal is emited while safe set property.

#### Parameters

port | the object providing safe set property |
property_name | the property name |
value | the GValue |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.0.0

### The `“safe-write”` signal

    void
    user_function (AgsPort *port,
                   gpointer value,
                   gpointer user_data)

The ::safe-write signal is emited while doing safe write operation.

#### Parameters

port | the object providing safe write |
value | the GValue |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.0.0