HinawaSndEfw

HinawaSndEfw — A transaction executor for Fireworks models

Functions

Signals

void responded Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── HinawaSndUnit
        ╰── HinawaSndEfw

Includes

#include <snd_efw.h>

Description

A HinawaSndEfw is an application of Echo Fireworks Transaction (EFT). This inherits HinawaSndUnit.

Functions

hinawa_snd_efw_error_quark ()

GQuark
hinawa_snd_efw_error_quark ();

Return the GQuark for error domain of GError which has code in HinawaSndEfwStatus.

Returns

A GQuark.

Since: 2.1


hinawa_snd_efw_new ()

HinawaSndEfw *
hinawa_snd_efw_new (void);

Instantiate HinawaSndEfw object and return the instance.

Returns

an instance of HinawaSndEfw.

Since: 1.3.


hinawa_snd_efw_open ()

void
hinawa_snd_efw_open (HinawaSndEfw *self,
                     gchar *path,
                     GError **exception);

Open ALSA hwdep character device and check it for Fireworks devices.

Parameters

self

A HinawaSndUnit

 

path

A full path of a special file for ALSA hwdep character device

 

exception

A GError. Error can be generated with three domains; g_file_error_quark(), hinawa_fw_node_error_quark(), and hinawa_snd_unit_error_quark().

 

Since: 0.3


hinawa_snd_efw_transaction_async ()

void
hinawa_snd_efw_transaction_async (HinawaSndEfw *self,
                                  guint category,
                                  guint command,
                                  const guint32 *args,
                                  gsize arg_count,
                                  guint32 *resp_seqnum,
                                  GError **exception);

Transfer asynchronous transaction for command frame of Echo Fireworks protocol. When receiving asynchronous transaction for response frame, “responded” GObject signal is emitted.

Parameters

self

A HinawaSndEfw.

 

category

One of category for the transaction.

 

command

One of commands for the transaction.

 

args

An array with elements for quadlet data as arguments for command.

[array length=arg_count][in][nullable]

arg_count

The number of quadlets in the args array.

 

resp_seqnum

The sequence number for response transaction;.

[out]

exception

A GError. Error can be generated with domain of hinawa_snd_unit_error_quark().

 

Since: 2.1.


hinawa_snd_efw_transaction ()

void
hinawa_snd_efw_transaction (HinawaSndEfw *self,
                            guint category,
                            guint command,
                            const guint32 *args,
                            gsize arg_count,
                            guint32 *const *params,
                            gsize *param_count,
                            GError **exception);

Transfer request of transaction according to Echo Fireworks Transaction protocol, then wait for the response of transaction within 200 millisecond timeout.

Parameters

self

A HinawaSndEfw.

 

category

one of category for the transaction.

 

command

one of commands for the transaction.

 

args

An array with elements for quadlet data as arguments for command.

[array length=arg_count][in][nullable]

arg_count

The number of quadlets in the args array.

 

params

An array with elements for quadlet data to save parameters in response. Callers should give it for buffer with enough space against the request since this library performs no reallocation. Due to the reason, the value of this argument should point to the pointer to the array and immutable. The content of array is mutable for parameters in response.

[array length=param_count][inout]

param_count

The number of quadlets in the params array.

 

exception

A GError. Error can be generated with three domains; hinawa_snd_unit_error_quark(), and hinawa_snd_efw_error_quark().

 

Since: 1.4.


hinawa_snd_efw_transaction_sync ()

void
hinawa_snd_efw_transaction_sync (HinawaSndEfw *self,
                                 guint category,
                                 guint command,
                                 const guint32 *args,
                                 gsize arg_count,
                                 guint32 *const *params,
                                 gsize *param_count,
                                 guint timeout_ms,
                                 GError **exception);

Transfer asynchronous transaction for command frame of Echo Fireworks protocol, then wait asynchronous transaction for response frame within the given timeout.

Parameters

self

A HinawaSndEfw.

 

category

one of category for the transaction.

 

command

one of commands for the transaction.

 

args

An array with elements for quadlet data as arguments for command.

[array length=arg_count][in][nullable]

arg_count

The number of quadlets in the args array.

 

params

An array with elements for quadlet data to save parameters in response. Callers should give it for buffer with enough space against the request since this library performs no reallocation. Due to the reason, the value of this argument should point to the pointer to the array and immutable. The content of array is mutable for parameters in response.

[array length=param_count][inout][nullable]

param_count

The number of quadlets in the params array.

 

timeout_ms

The timeout to wait for response of the transaction since request is transferred in milliseconds.

 

exception

A GError. Error can be generated with three domains; hinawa_snd_unit_error_quark(), and hinawa_snd_efw_error_quark().

 

Since: 2.1.

Types and Values

HINAWA_SND_EFW_ERROR

#define HINAWA_SND_EFW_ERROR hinawa_snd_efw_error_quark()

Signal Details

The “responded” signal

void
user_function (HinawaSndEfw      *self,
               HinawaSndEfwStatus status,
               guint              seqnum,
               guint              category,
               guint              command,
               gpointer           frame,
               guint              frame_size,
               gpointer           user_data)

When the unit transfers asynchronous packet as response for Echo Audio Fireworks protocol, and the process successfully reads the content of response from ALSA Fireworks driver, the “responded” signal handler is called with parameters of the response.

Parameters

self

A HinawaSndEfw.

 

status

One of HinawaSndEfwStatus.

 

seqnum

The sequence number of response.

 

category

The value of category field in the response.

 

command

The value of command field in the response.

 

frame

The array with elements for quadlet data of response for Echo Fireworks protocol.

[array length=frame_size][element-type guint32]

frame_size

The number of elements of the array.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 2.1