AgsPort

AgsPort — Perform thread-safe operations

Synopsis

#include <ags/audio/ags_port.h>

struct              AgsPort;
struct              AgsPortClass;
GList *             ags_port_find_specifier             (GList *port,
                                                         gchar *specifier);
AgsPort *           ags_port_new                        ();
void                ags_port_safe_get_property          (AgsPort *port,
                                                         gchar *property_name,
                                                         GValue *value);
void                ags_port_safe_read                  (AgsPort *port,
                                                         GValue *value);
void                ags_port_safe_set_property          (AgsPort *port,
                                                         gchar *property_name,
                                                         GValue *value);
void                ags_port_safe_write                 (AgsPort *port,
                                                         GValue *value);

Description

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

Details

struct AgsPort

struct AgsPort {
  GObject object;

  gchar *plugin_name;
  gchar *specifier;

  gchar *control_port;

  gboolean port_value_is_pointer;
  GType port_value_type;

  guint port_value_size;
  guint port_value_length;

  pthread_mutex_t mutex;

  union _AgsPortValue{
    gboolean ags_port_boolean;
    gint64 ags_port_int;
    guint64 ags_port_uint;
    gfloat ags_port_float;
    gdouble ags_port_double;
    gboolean *ags_port_boolean_ptr;
    gint64 *ags_port_int_ptr;
    guint64 *ags_port_uint_ptr;
    gfloat *ags_port_float_ptr;
    gdouble *ags_port_double_ptr;
    gpointer ags_port_pointer;
    GObject *ags_port_object;
  }port_value;
};

struct AgsPortClass

struct AgsPortClass {
  GObjectClass object;

  void (*safe_read)(AgsPort *port, GValue *value);
  void (*safe_write)(AgsPort *port, GValue *value);

  void (*safe_get_property)(AgsPort *port, gchar *property_name, GValue *value);
  void (*safe_set_property)(AgsPort *port, gchar *property_name, GValue *value);
};

ags_port_find_specifier ()

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

Retrieve port by specifier.

port :

a GList containing AgsPort

specifier :

the recall specifier to match

Returns :

Next match.

Since 0.4


ags_port_new ()

AgsPort *           ags_port_new                        ();

Creates an AgsPort.

Returns :

a new AgsPort.

Since 0.4


ags_port_safe_get_property ()

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

Perform safe get property.

port :

an AgsPort

property_name :

the property's name

value :

the GValue to store the result

Since 0.4


ags_port_safe_read ()

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

Perform safe read.

port :

an AgsPort

value :

the GValue to store result

Since 0.4


ags_port_safe_set_property ()

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

Perform safe set property.

port :

an AgsPort

property_name :

the property's name

value :

the GValue containing data

Since 0.4


ags_port_safe_write ()

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

Perform safe write.

port :

an AgsPort

value :

the GValue containing data

Since 0.4