</releaseinfo>
</bookinfo>
+ <chapter id="introduction">
+ <title>Introduction</title>
+ <para>This library is designed for applications to manipulate ALSA
+ Rawmidi character device and operate rawmidi functionality abstracted
+ as a pair of streams and substream. ALSARawmidiStreamPair represents
+ the pair of streams. It holds file descriptor and creates GSource for
+ event dispathing by GLib's GMainContext/GMainLoop.</para>
+ </chapter>
+
<chapter id="alsarawmidi-enumerations">
<title>ALSARawmidi enumerations</title>
<xi:include href="xml/alsarawmidi-enum-types.xml"/>
#include <libudev.h>
+/**
+ * SECTION: query
+ * @Title: Global functions in ALSARawmidi
+ * @Short_description: Global functions available without holding any file
+ * descriptor
+ */
+
// For error reporting.
G_DEFINE_QUARK("alsarawmidi-error", alsarawmidi_error)
#include <unistd.h>
#include <sys/ioctl.h>
+/**
+ * SECTION: stream-pair
+ * @Title: ALSARawmidiStreamPair
+ * @Short_description: A GObject-derived object to represent a pair of Rawmidi
+ * stream.
+ *
+ * A #ALSARawmidiStreamPair is a GObject-derived object to represent a pair
+ * of Rawmidi stream to which substreams are attached. The substream is pointed
+ * by the combination of the numerical ID of device, subdevice, and direction.
+ * When the call of alsarawmidi_stream_pair_open() with the combination,
+ * corresponding substreams are attached to the object. Then the object maintains
+ * file descriptor till object destruction. The call of
+ * alsarawmidi_stream_pair_create_source() returns the instance of GSource. Once
+ * attached to the GSource, GMainContext/GMainLoop is available as event
+ * dispatcher. The 'handle-messages' GObject signal is emit in the event
+ * dispatcher to notify the intermediate buffer of capture substream has
+ * available messages. The call of alsarawmidi_stream_pair_read_from_substream()
+ * fills the given buffer with the available messages. The call of
+ * alsarawmidi_stream_pair_write_to_substream() write messages in the given
+ * buffer into the intermediate buffer of playback substream. The call of
+ * alsarawmidi_stream_pair_get_substream_status() is available to check the
+ * space in the intermediate buffer according to direction argument.
+ */
struct _ALSARawmidiStreamPairPrivate {
int fd;
char *devnode;
// SPDX-License-Identifier: LGPL-3.0-or-later
#include "privates.h"
+/**
+ * SECTION: substream-info
+ * @Title: ALSARawmidiSubstreamInfo
+ * @Short_description: A GObject-derived object to represent information of
+ * substream
+ *
+ * A #ALSARawmidiSubstreamInfo is a GObject-derived object to represent
+ * information of substream attached to the pair of streams. The call of
+ * alsarawmidi_stream_pair_get_substream_info() or
+ * alsarawmidi_get_substream_info() return the instance of object.
+ *
+ * The object wraps 'struct snd_rawmidi_info' in UAPI of Linux sound subsystem.
+ */
struct _ALSARawmidiSubstreamInfoPrivate {
struct snd_rawmidi_info info;
};
#include <unistd.h>
+/**
+ * SECTION: substream-params
+ * @Title: ALSARawmidiSubstreamParams
+ * @Short_description: A GObject-derived object to represent parameters of
+ * substream.
+ *
+ * A #ALSARawmidiSubstreamParams is a GObject-derived object to represent
+ * parameters of substream attached to the pair of streams. The call of
+ * alsarawmidi_stream_pair_set_substream_params() requires the instance of
+ * object.
+ *
+ * The object wraps 'struct snd_rawmidi_params' in UAPI of Linux sound subsystem.
+ */
struct _ALSARawmidiSubstreamParamsPrivate {
struct snd_rawmidi_params params;
};
// SPDX-License-Identifier: LGPL-3.0-or-later
#include "privates.h"
+/**
+ * SECTION: substream-status
+ * @Title: ALSARawmidiSubstreamStatus
+ * @Short_description: A GObject-derived object to represent status of substream
+ *
+ * A #ALSARawmidiSubstreamStatus is a GObject-derived object to represent status
+ * of substream attached to the pair of stream. The call of
+ * alsarawmidi_stream_pair_get_substream_status() returns the instance of
+ * object.
+ *
+ * The object wraps 'struct snd_rawmidi_status' in UAPI of Linux sound subsystem.
+ */
struct _ALSARawmidiSubstreamStatusPrivate {
struct snd_rawmidi_status status;
};