"alsaseq_get_seq_devnode";
"alsaseq_get_system_info";
"alsaseq_get_client_id_list";
+ "alsaseq_get_client_info";
"alsaseq_system_info_get_type";
// SPDX-License-Identifier: LGPL-3.0-or-later
-#include "client-info.h"
#include "privates.h"
#include <errno.h>
seq_client_info_props[SEQ_CLIENT_INFO_PROP_PROCESS_ID] =
g_param_spec_long("process-id", "process-id",
- "The process ID for uset client, otherwise -1.",
+ "The process ID for user client, otherwise -1.",
G_MINLONG, G_MAXLONG,
-1,
G_PARAM_READABLE);
}
}
}
+
+void seq_client_info_refer_private(ALSASeqClientInfo *self,
+ struct snd_seq_client_info **info)
+{
+ ALSASeqClientInfoPrivate *priv =
+ alsaseq_client_info_get_instance_private(self);
+
+ *info = &priv->info;
+}
#include <glib-object.h>
#include "system-info.h"
+#include "client-info.h"
#include <sound/asequencer.h>
void seq_system_info_refer_private(ALSASeqSystemInfo *self,
struct snd_seq_system_info **info);
+void seq_client_info_refer_private(ALSASeqClientInfo *self,
+ struct snd_seq_client_info **info);
+
G_END_DECLS
#endif
*entries = list;
*entry_count = count;
}
+
+/**
+ * alsaseq_get_client_info:
+ * @client_id: The numerical ID of client to query. One of
+ * ALSASeqSpecificClientId is available as well as any numerical
+ * value.
+ * @client_info: (out): A #ALSASeqClientInfo for the client.
+ * @error: A #GError.
+ *
+ * Get the information of client according to the numerical ID.
+ */
+void alsaseq_get_client_info(guint client_id, ALSASeqClientInfo **client_info,
+ GError **error)
+{
+ char *devnode;
+ struct snd_seq_client_info *info;
+ int fd;
+
+ alsaseq_get_seq_devnode(&devnode, error);
+ if (*error != NULL)
+ return;
+
+ *client_info = g_object_new(ALSASEQ_TYPE_CLIENT_INFO, NULL);
+ seq_client_info_refer_private(*client_info, &info);
+
+ fd = open(devnode, O_RDONLY);
+ g_free(devnode);
+ if (fd < 0) {
+ generate_error(error, errno);
+ g_object_unref(*client_info);
+ *client_info = NULL;
+ return;
+ }
+
+ info->client = client_id;
+ if (ioctl(fd, SNDRV_SEQ_IOCTL_GET_CLIENT_INFO, info) < 0)
+ generate_error(error, errno);
+ close(fd);
+ if (*error != NULL) {
+ g_object_unref(*client_info);
+ *client_info = NULL;
+ }
+}
#include <glib-object.h>
#include <seq/system-info.h>
+#include <seq/client-info.h>
G_BEGIN_DECLS
void alsaseq_get_client_id_list(guint **entries, gsize *entry_count,
GError **error);
+void alsaseq_get_client_info(guint client_id, ALSASeqClientInfo **client_info,
+ GError **error);
+
G_END_DECLS
#endif