## AgsOscBuilder

AgsOscBuilder — OSC builder

## Stability Level

Stable, unless otherwise indicated

## Functions

#define | AGS_OSC_BUILDER_GET_OBJ_MUTEX()
#define | AGS_OSC_BUILDER_PACKET()
#define | AGS_OSC_BUILDER_BUNDLE()
#define | AGS_OSC_BUILDER_MESSAGE()
AgsOscBuilderPacket * | ags_osc_builder_packet_alloc ()
void | ags_osc_builder_packet_free ()
AgsOscBuilderBundle * | ags_osc_builder_bundle_alloc ()
void | ags_osc_builder_bundle_free ()
AgsOscBuilderMessage * | ags_osc_builder_message_alloc ()
void | ags_osc_builder_message_free ()
void | ags_osc_builder_osc_putc ()
void | ags_osc_builder_on_error ()
void | ags_osc_builder_append_packet ()
void | ags_osc_builder_append_bundle ()
void | ags_osc_builder_append_message ()
void | ags_osc_builder_append_value ()
void | ags_osc_builder_build ()
guchar * | ags_osc_builder_get_data ()
guchar * | ags_osc_builder_get_data_with_length ()
AgsOscBuilder * | ags_osc_builder_new ()

## Signals

void | append-bundle | Run Last
void | append-message | Run Last
void | append-packet | Run Last
void | append-value | Run Last
void | on-error | Run Last
void | osc-putc | Run Last

## Types and Values

#define | AGS_OSC_BUILDER_DEFAULT_CHUNK_SIZE
#define | AGS_OSC_BUILDER_MESSAGE_DEFAULT_CHUNK_SIZE
enum | AgsOscBuilderFlags
struct | AgsOscBuilderPacket
struct | AgsOscBuilderBundle
struct | AgsOscBuilderMessage

## Object Hierarchy

        GObject
        ╰── AgsOscBuilder

## Includes

    #include <ags/audio/osc/ags_osc_builder.h>

## Description

The AgsOscBuilder lets you create OSC files using its builder functions.

## Functions

### AGS_OSC_BUILDER_GET_OBJ_MUTEX()

    #define AGS_OSC_BUILDER_GET_OBJ_MUTEX(obj) (&(((AgsOscBuilder *) obj)->obj_mutex))

### AGS_OSC_BUILDER_PACKET()

    #define AGS_OSC_BUILDER_PACKET(x) ((AgsOscBuilderPacket *)(x))

### AGS_OSC_BUILDER_BUNDLE()

    #define AGS_OSC_BUILDER_BUNDLE(x) ((AgsOscBuilderBundle *)(x))

### AGS_OSC_BUILDER_MESSAGE()

    #define AGS_OSC_BUILDER_MESSAGE(x) ((AgsOscBuilderMessage *)(x))

### ags_osc_builder_packet_alloc ()

    AgsOscBuilderPacket *
    ags_osc_builder_packet_alloc (guint64 offset);

Allocate AgsOscBuilderPacket.

#### Parameters

offset | the current offset |

#### Returns

the newly allocated AgsOscBuilderPacket.

[type gpointer][transfer none]

Since: 3.0.0

### ags_osc_builder_packet_free ()

    void
    ags_osc_builder_packet_free (AgsOscBuilderPacket *packet);

Free `packet` .

#### Parameters

packet | the AgsOscBuilderPacket. | [type gpointer][transfer none]

Since: 3.0.0

### ags_osc_builder_bundle_alloc ()

    AgsOscBuilderBundle *
    ags_osc_builder_bundle_alloc (guint64 offset);

Allocate AgsOscBuilderBundle.

#### Parameters

offset | the current offset |

#### Returns

the newly allocated AgsOscBuilderBundle.

[type gpointer][transfer none]

Since: 3.0.0

### ags_osc_builder_bundle_free ()

    void
    ags_osc_builder_bundle_free (AgsOscBuilderBundle *bundle);

Free `bundle` .

#### Parameters

bundle | the AgsOscBuilderBundle. | [type gpointer][transfer none]

Since: 3.0.0

### ags_osc_builder_message_alloc ()

    AgsOscBuilderMessage *
    ags_osc_builder_message_alloc (guint64 offset);

Allocate AgsOscBuilderMessage.

#### Parameters

offset | the current offset |

#### Returns

the newly allocated AgsOscBuilderMessage.

[type gpointer][transfer none]

Since: 3.0.0

### ags_osc_builder_message_free ()

    void
    ags_osc_builder_message_free (AgsOscBuilderMessage *message);

Free `message` .

#### Parameters

message | the AgsOscBuilderMessage. | [type gpointer][transfer none]

Since: 3.0.0

### ags_osc_builder_osc_putc ()

    void
    ags_osc_builder_osc_putc (AgsOscBuilder *osc_builder,
                              gint c);

Put character

#### Parameters

osc_builder | the AgsOscBuilder |
c | the character |

Since: 3.0.0

### ags_osc_builder_on_error ()

    void
    ags_osc_builder_on_error (AgsOscBuilder *osc_builder,
                              GError **error);

Report error.

#### Parameters

osc_builder | the AgsOscBuilder |
error | the return location of GError |

Since: 3.0.0

### ags_osc_builder_append_packet ()

    void
    ags_osc_builder_append_packet (AgsOscBuilder *osc_builder);

#### Parameters

osc_builder | the AgsOscBuilder |

Since: 3.0.0

### ags_osc_builder_append_bundle ()

    void
    ags_osc_builder_append_bundle (AgsOscBuilder *osc_builder,
                                   AgsOscBuilderBundle *parent_bundle,
                                   gint tv_secs,
                                   gint tv_fraction,
                                   gboolean immediately);

Append bundle.

#### Parameters

osc_builder | the AgsOscBuilder |
parent_bundle | the parent AgsOscBuilderBundle or `NULL` |
tv_secs | number of seconds since midnight on January 1, 1900 |
tv_fraction | fraction of seconds to a precision of about 200 picoseconds |
immediately | if `TRUE` apply immediately, otherwise `FALSE` not immediately |

Since: 3.0.0

### ags_osc_builder_append_message ()

    void
    ags_osc_builder_append_message (AgsOscBuilder *osc_builder,
                                    AgsOscBuilderBundle *parent_bundle,
                                    gchar *address_pattern,
                                    gchar *type_tag);

Append message.

#### Parameters

osc_builder | the AgsOscBuilder |
parent_bundle | the parent AgsOscBuilderBundle or `NULL` |
address_pattern | the address pattern |
type_tag | the type tag |

Since: 3.0.0

### ags_osc_builder_append_value ()

    void
    ags_osc_builder_append_value (AgsOscBuilder *osc_builder,
                                  AgsOscBuilderMessage *message,
                                  gint v_type,
                                  GValue *value);

Append value.

#### Parameters

osc_builder | the AgsOscBuilder |
message | the message |
v_type | the type as char |
value | the GValue containinig value |

Since: 3.0.0

### ags_osc_builder_build ()

    void
    ags_osc_builder_build (AgsOscBuilder *osc_builder);

Build the OSC data.

#### Parameters

osc_builder | the AgsOscBuilder |

Since: 3.0.0

### ags_osc_builder_get_data ()

    guchar *
    ags_osc_builder_get_data (AgsOscBuilder *osc_builder);

Get OSC data of `osc_builder` .

#### Parameters

osc_builder | the AgsOscBuilder |

#### Returns

the OSC data

Since: 3.7.24

### ags_osc_builder_get_data_with_length ()

    guchar *
    ags_osc_builder_get_data_with_length (AgsOscBuilder *osc_builder,
                                          guint *length);

Get OSC data of `osc_builder` .

#### Parameters

osc_builder | the AgsOscBuilder |
length | the length of data. | [out]

#### Returns

the OSC data as array.

[transfer full]

Since: 3.7.24

### ags_osc_builder_new ()

    AgsOscBuilder *
    ags_osc_builder_new ();

Creates a new instance of AgsOscBuilder

#### Returns

the new AgsOscBuilder

Since: 3.0.0

## Types and Values

### AGS_OSC_BUILDER_DEFAULT_CHUNK_SIZE

    #define AGS_OSC_BUILDER_DEFAULT_CHUNK_SIZE (8192)

### AGS_OSC_BUILDER_MESSAGE_DEFAULT_CHUNK_SIZE

    #define AGS_OSC_BUILDER_MESSAGE_DEFAULT_CHUNK_SIZE (8192)

### enum AgsOscBuilderFlags

#### Members

AGS_OSC_BUILDER_ADD_VALUE |  |

### struct AgsOscBuilderPacket

    struct AgsOscBuilderPacket {
      guint64 offset;

      gsize packet_size;

      AgsOscBuilder *builder;

      GList *message;
      GList *bundle;
    };

### struct AgsOscBuilderBundle

    struct AgsOscBuilderBundle {
      guint64 offset;

      gsize bundle_size;

      gint32 tv_secs;
      gint32 tv_fraction;
      gboolean immediately;

      AgsOscBuilderPacket *packet;
      AgsOscBuilderBundle *parent_bundle;

      GList *message;
      GList *bundle;
    };

### struct AgsOscBuilderMessage

    struct AgsOscBuilderMessage {
      guint64 offset;

      gchar *address_pattern;
      gchar *type_tag;

      gsize data_allocated_length;
      gsize data_length;
      guchar *data;

      AgsOscBuilderPacket *packet;
      AgsOscBuilderBundle *parent_bundle;
    };

## Signal Details

### The `“append-bundle”` signal

    void
    user_function (AgsOscBuilder *osc_builder,
                   gpointer       parent_bundle,
                   int            tv_secs,
                   int            tv_fraction,
                   gboolean       immediately,
                   gpointer       user_data)

The ::append-bundle signal is emited during building bundle.

#### Parameters

osc_builder | the builder |
parent_bundle | the parent AgsOscBuilderBundle or `NULL` |
tv_secs | time value secondes since midnight January 1900 |
tv_fraction | time value fractions of second |
immediately | if `TRUE` apply immediately, otherwise `FALSE` |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.0.0

### The `“append-message”` signal

    void
    user_function (AgsOscBuilder *osc_builder,
                   gpointer       parent_bundle,
                   gpointer       address_pattern,
                   gpointer       type_tag,
                   gpointer       user_data)

The ::append-message signal is emited during building message.

#### Parameters

osc_builder | the builder |
parent_bundle | the parent AgsOscBuilderBundle or `NULL` |
address_pattern | the address pattern string |
type_tag | the type tag string |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.0.0

### The `“append-packet”` signal

    void
    user_function (AgsOscBuilder *osc_builder,
                   gpointer       user_data)

The ::append-packet signal is emited during building packet.

#### Parameters

osc_builder | the builder |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.0.0

### The `“append-value”` signal

    void
    user_function (AgsOscBuilder *osc_builder,
                   int            message,
                   gpointer       v_type,
                   gpointer       user_data)

The ::append-value signal is emited during building value.

#### Parameters

osc_builder | the builder |
message | the message |
v_type | the type as ASCII char |
value | the GValue |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.0.0

### The `“on-error”` signal

    void
    user_function (AgsOscBuilder *osc_builder,
                   gpointer       error,
                   gpointer       user_data)

The ::on-error signal is emited during building of event.

#### Parameters

osc_builder | the builder |
error | the GError |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.0.0

### The `“osc-putc”` signal

    void
    user_function (AgsOscBuilder *osc_builder,
                   int            error,
                   gpointer       user_data)

The ::osc-putc signal is emited during putting char to file.

#### Parameters

osc_builder | the builder |
error | the GError |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.0.0