HinawaSndUnit

HinawaSndUnit — An event listener for ALSA FireWire sound devices

Functions

Properties

gint card Read
gchar * device Read
guint64 guid Read
gboolean listening Read
gboolean streaming Read
HinawaSndUnitType type Read

Signals

void lock-status Run Last

Object Hierarchy

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

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_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

 

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

 

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

 

hinawa_snd_unit_listen ()

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

hinawa_snd_unit_listen has been deprecated since version 1.4 and should not be used in newly-written code.

Instead, use GSource retrieved by a call of hinawa_snd_unit_create_source(). Then use GMainContext and GMainLoop of GLib for event loop.

Start listening to events.

Parameters

self

A HinawaSndUnit

 

exception

A GError

 

hinawa_snd_unit_unlisten ()

void
hinawa_snd_unit_unlisten (HinawaSndUnit *self);

hinawa_snd_unit_unlisten has been deprecated since version 1.4 and should not be used in newly-written code.

Instead, maintain GMainContext and GMainLoop with GSource retrieved by a call of hinawa_snd_unit_create_source().

Stop listening to events.

Parameters

self

A HinawaSndUnit

 

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.

 

Since: 1.4.

Property Details

The “card” property

  “card”                     gint

A numerical ID for ALSA sound card.

Owner: HinawaSndUnit

Flags: Read

Allowed values: >= 0

Default value: 0


The “device” property

  “device”                   gchar *

A name of special file as FireWire unit.

Owner: HinawaSndUnit

Flags: Read

Default value: NULL


The “guid” property

  “guid”                     guint64

Global unique ID for this firewire unit.

Owner: HinawaSndUnit

Flags: Read

Allowed values: <= 4294967295

Default value: 0


The “listening” property

  “listening”                gboolean

Whether this device is under listening.

Owner: HinawaSndUnit

Flags: Read

Default value: FALSE


The “streaming” property

  “streaming”                gboolean

Whether this device is streaming or not.

Owner: HinawaSndUnit

Flags: Read

Default value: FALSE


The “type” property

  “type”                     HinawaSndUnitType

The value of HinawaSndUnitType enumerators.

Owner: HinawaSndUnit

Flags: Read

Default value: HINAWA_SND_UNIT_TYPE_DICE

Signal Details

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