</releaseinfo>
</bookinfo>
+ <chapter id="introduction">
+ <title>Introduction</title>
+ <para>This library is designed for applications to manipulate ALSA
+ timer character device and operate timer functionality abstracted
+ as timer device and user instance. ALSATimerUserInstance represents
+ the user instance. It holds file descriptor and creates GSource for
+ event dispatching by GLib's GMainContext/GMainLoop.</para>
+ </chapter>
+
<chapter id="alsatimer-enumerations">
<title>ALSATimer enumerations</title>
<xi:include href="xml/alsatimer-enum-types.xml"/>
// SPDX-License-Identifier: LGPL-3.0-or-later
#include "device-id.h"
+/**
+ * SECTION: device-id
+ * @Title: ALSATimerDeviceId
+ * @Short_description: A boxed object to represent the identifier of timer
+ * device.
+ *
+ * A #ALSATimerDeviceId is a boxed object to represent the identifier of timer
+ * device. The identifier mainly consists of the class of timer device. The
+ * other members; the numerical ID of card, device, and subdevice are optional
+ * according to the class of timer device.
+ *
+ * The object wraps 'struct snd_timer_id' in UAPI of Linux sound subsystem.
+ */
ALSATimerDeviceId *timer_device_id_copy(const ALSATimerDeviceId *self)
{
return g_memdup(self, sizeof(*self));
// SPDX-License-Identifier: LGPL-3.0-or-later
#include "privates.h"
+/**
+ * SECTION: device-info
+ * @Title: ALSATimerDeviceInfo
+ * @Short_description: A GObject-derived object to represent information of
+ * timer device.
+ *
+ * A #ALSATimerDeviceInfo is a GObject-derived object to represent information
+ * of timer device. The call of alsatimer_get_device_info() returns an instance
+ * of the object according to the identifier of timer device.
+ *
+ * The object wraps 'struct snd_timer_ginfo' in UAPI of Linux sound subsystem.
+ */
struct _ALSATimerDeviceInfoPrivate {
struct snd_timer_ginfo info;
};
// SPDX-License-Identifier: LGPL-3.0-or-later
#include "privates.h"
+/**
+ * SECTION: device-params
+ * @Title: ALSATimerDeviceParams
+ * @Short_description: A GObject-derived object to represent parameter of timer
+ * device.
+ *
+ * A #ALSATimerDeviceParams is a GObject-derived object to represent parameter
+ * of timer device. The call of alsatimer_set_device_params() requires the
+ * instance of object.
+ *
+ * The object wraps 'struct snd_timer_gparams' in UAPI of Linux sound subsystem.
+ */
struct _ALSATimerDeviceParamsPrivate {
struct snd_timer_gparams params;
};
// SPDX-License-Identifier: LGPL-3.0-or-later
#include "privates.h"
+/**
+ * SECTION: device-status
+ * @Title: ALSATimerDeviceStatus
+ * @Short_description: A GObject-derived object to represent status of timer
+ * device.
+ *
+ * A #ALSATimerDeviceStatus is a GObject-derived object to represent status of
+ * timer device. The call of alsatimer_get_device_status() returns the instance
+ * of object.
+ *
+ * The object wraps 'struct snd_timer_gstatus' in UAPI of Linux sound subsystem.
+ */
struct _ALSATimerDeviceStatusPrivate {
struct snd_timer_gstatus status;
};
#include "event-data-tick.h"
#include "privates.h"
+/**
+ * SECTION: event-data-tick
+ * @Title: ALSATimerEventDataTick
+ * @Short_description: A GObject-derived object to represent event of timer with
+ * tick count
+ *
+ * A #ALSATimerEventDataTick is a GObject-derived object to represent event of
+ * timer with tick count. The instance of object is passed to handler for
+ * 'handle-event' GObject signal in ALSATimerUserInstance when it's available.
+ * The object inherits properties of #ALSATimerEventData.
+ *
+ * The object wraps 'struct snd_timer_read' in UAPI of Linux sound subsystem.
+ */
struct _ALSATimerEventDataTickPrivate {
struct snd_timer_read event;
};
#include "event-data-timestamp.h"
#include "privates.h"
+/**
+ * SECTION: event-data-timestamp
+ * @Title: ALSATimerEventDataTimestamp
+ * @Short_description: A GObject-derived object to represent event of timer with
+ * timestamp
+ *
+ * A #ALSATimerEventDataTimestamp is a GObject-derived object to represent
+ * event of timer with timestamp. The instance of object is passed to handler for
+ * 'handle-event' GObject signal in ALSATimerUserInstance when it's available.
+ * The source of timestamp is decided by 'timer_tstamp_monotonic' option of
+ * 'snd-timer' kernel module. The object inherits properties of
+ * #ALSATimerEventData.
+ *
+ * The object wraps 'struct snd_timer_read' in UAPI of Linux sound subsystem.
+ */
struct _ALSATimerEventDataTimestampPrivate {
struct snd_timer_tread event;
};
// SPDX-License-Identifier: LGPL-3.0-or-later
#include "event-data.h"
+/**
+ * SECTION: event-data
+ * @Title: ALSATimerEventData
+ * @Short_description: A GObject-derived abstract object to represent common
+ * data of event
+ *
+ * A #ALSATimerEventData is a GObject-derived abstract object to represent
+ * common data of event.
+ */
struct _ALSATimerEventDataPrivate {
ALSATimerEventDataType type;
};
// SPDX-License-Identifier: LGPL-3.0-or-later
#include "privates.h"
+/**
+ * SECTION: instance-info
+ * @Title: ALSATimerInstanceInfo
+ * @Short_description: A GObject-derived object to represent information of
+ * user instance
+ *
+ * A #ALSATimerInstanceInfo is a GObject-derived object to represent information
+ * of user instance attached to any timer device or the other instance as slave.
+ * The call of alsatimer_user_instance_get_info() returns the instance of object.
+ *
+ * The object wraps 'struct snd_timer_info' in UAPI of Linux sound subsystem.
+ */
struct _ALSATimerInstanceInfoPrivate {
struct snd_timer_info info;
};
#include <errno.h>
+/**
+ * SECTION: instance-params
+ * @Title: ALSATimerInstanceParams
+ * @Short_description: A GObject-derived object to represent parameters of user
+ * instance
+ *
+ * A #ALSATimerInstanceParams is a GObject-derived object to represent
+ * parameters of user instance attached to any timer device or the other
+ * instance as slave. The call of alsatimer_user_instance_set_params() requires
+ * the instance of object.
+ *
+ * The object wraps 'struct snd_timer_params' in UAPI of Linux sound subsystem.
+ */
struct _ALSATimerInstanceParamsPrivate{
struct snd_timer_params params;
};
#include <sound/asound.h>
+/**
+ * SECTION: instance-status
+ * @Title: ALSATimerInstanceStatus
+ * @Short_description: A GObject-derived object to represent status of user
+ * instance
+ *
+ * A #ALSATimerInstanceStatus is a GObject-derived object to represent status
+ * of user instance attached to any timer device or the other instance as slave.
+ * The call of alsatimer_user_instance_get_status() returns the instance of
+ * object.
+ *
+ * The object wraps 'struct snd_timer_status' in UAPI of Linux sound subsystem.
+ */
struct _ALSATimerInstanceStatusPrivate {
struct snd_timer_status status;
};
#define TIMER_SYSNAME_TEMPLATE "timer"
+/**
+ * SECTION: query
+ * @Title: Global functions in ALSATimer
+ * @Short_description: Global functions available without holding any
+ * file descriptor
+ */
+
// For error handling.
G_DEFINE_QUARK("alsatimer-error", alsatimer_error)
#include <sys/ioctl.h>
#include <errno.h>
+/**
+ * SECTION: user-instance
+ * @Title: ALSATimerUserInstance
+ * @Short_description: A GObject-derived object to represent user instance
+ *
+ * A #ALSATimerUserInstance is a GObject-derived object to represent information
+ * of user instance attached to any timer device or the other instance as slave.
+ * After calling alsatimer_user_instance_open(), the object maintains file
+ * descriptor till object destruction. After calling
+ * alsatimer_user_instance_attach() or alsatimer_user_instance_attach_as_slave(),
+ * the user instance is attached to any timer device or the other instance as
+ * slave.
+ */
struct _ALSATimerUserInstancePrivate {
int fd;
ALSATimerEventDataType event_data_type;