HinawaSndUnit

HinawaSndUnit — An event listener for ALSA FireWire sound devices

Functions

Properties

guint card Read
char * device Read
guint64 guid Read
gboolean streaming Read
HinawaSndUnitType type Read

Signals

void disconnected Run Last
void lock-status Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── HinawaSndUnit
        ├── HinawaSndDg00x
        ├── HinawaSndDice
        ├── HinawaSndEfw
        ├── HinawaSndMotu
        ╰── HinawaSndTscm

Includes

#include <snd_unit.h>

Description

This class is an application of ALSA FireWire stack. Any functionality which ALSA drivers in the stack can be available.

Functions

hinawa_snd_unit_error_quark ()

GQuark
hinawa_snd_unit_error_quark ();

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

Returns

A GQuark.

Since: 2.1


hinawa_snd_unit_new ()

HinawaSndUnit *
hinawa_snd_unit_new (void);

Instantiate HinawaSndUnit object and return the instance.

Returns

an instance of HinawaSndUnit.

Since: 1.3.


hinawa_snd_unit_open ()

void
hinawa_snd_unit_open (HinawaSndUnit *self,
                      gchar *path,
                      GError **exception);

Open ALSA hwdep character device and check it for FireWire sound 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.4


hinawa_snd_unit_get_node ()

void
hinawa_snd_unit_get_node (HinawaSndUnit *self,
                          HinawaFwNode **node);

Retrieve an instance of HinawaFwNode associated to the given unit.

Parameters

self

A HinawaSndUnit.

 

node

A HinawaFwNode.

[out][transfer none]

Since: 2.0.


hinawa_snd_unit_lock ()

void
hinawa_snd_unit_lock (HinawaSndUnit *self,
                      GError **exception);

Disallow ALSA to start kernel-streaming.

Parameters

self

A HinawaSndUnit

 

exception

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

 

Since: 0.3


hinawa_snd_unit_unlock ()

void
hinawa_snd_unit_unlock (HinawaSndUnit *self,
                        GError **exception);

Allow ALSA to start kernel-streaming.

Parameters

self

A HinawaSndUnit

 

exception

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

 

Since: 0.3


hinawa_snd_unit_create_source ()

void
hinawa_snd_unit_create_source (HinawaSndUnit *self,
                               GSource **gsrc,
                               GError **exception);

Create Gsource for GMainContext to dispatch events for the sound device.

Parameters

self

A HinawaSndUnit.

 

gsrc

A GSource.

[out]

exception

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

 

Since: 1.4.

Types and Values

HINAWA_SND_UNIT_ERROR

#define HINAWA_SND_UNIT_ERROR hinawa_snd_unit_error_quark()

Property Details

The “card” property

  “card”                     guint

The numeric ID for ALSA sound card.

Owner: HinawaSndUnit

Flags: Read

Default value: 0

Since: 2.0


The “device” property

  “device”                   char *

A name of special file as FireWire unit.

Owner: HinawaSndUnit

Flags: Read

Default value: NULL

Since: 0.3


The “guid” property

  “guid”                     guint64

Global unique ID for this firewire unit.

Owner: HinawaSndUnit

Flags: Read

Default value: 0

Since: 0.4


The “streaming” property

  “streaming”                gboolean

Whether this device is streaming or not.

Owner: HinawaSndUnit

Flags: Read

Default value: FALSE

Since: 0.4


The “type” property

  “type”                     HinawaSndUnitType

The value of HinawaSndUnitType enumerators.

Owner: HinawaSndUnit

Flags: Read

Default value: HINAWA_SND_UNIT_TYPE_DICE

Since: 1.0

Signal Details

The “disconnected” signal

void
user_function (HinawaSndUnit *self,
               gpointer       user_data)

When the sound card is not available anymore due to unbinding driver or hot unplugging, this signal is emit. The owner of this object should call g_object_free() as quickly as possible to release ALSA hwdep character device.

Parameters

self

A HinawaSndUnit

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 2.0


The “lock-status” signal

void
user_function (HinawaSndUnit *self,
               gboolean       state,
               gpointer       user_data)

When ALSA kernel-streaming status is changed, this “lock-status” signal is generated.

Parameters

self

A HinawaSndUnit

 

state

TRUE when locked, FALSE when unlocked.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.3