"alsaseq_get_client_info";
"alsaseq_get_port_id_list";
"alsaseq_get_port_info";
+ "alsaseq_get_client_pool";
"alsaseq_system_info_get_type";
// SPDX-License-Identifier: LGPL-3.0-or-later
-#include "client-pool.h"
-
-#include <sound/asequencer.h>
+#include "privates.h"
struct _ALSASeqClientPoolPrivate {
struct snd_seq_client_pool pool;
{
return;
}
+
+void seq_client_pool_refer_private(ALSASeqClientPool *self,
+ struct snd_seq_client_pool **pool)
+{
+ ALSASeqClientPoolPrivate *priv =
+ alsaseq_client_pool_get_instance_private(self);
+
+ *pool = &priv->pool;
+}
#include "system-info.h"
#include "client-info.h"
#include "port-info.h"
+#include "client-pool.h"
#include <sound/asequencer.h>
void seq_port_info_refer_private(ALSASeqPortInfo *self,
struct snd_seq_port_info **info);
+void seq_client_pool_refer_private(ALSASeqClientPool *self,
+ struct snd_seq_client_pool **pool);
+
G_END_DECLS
#endif
*port_info = NULL;
}
}
+
+/**
+ * alsaseq_get_client_pool:
+ * @client_id: The numerical ID of client to query. One of
+ * ALSASeqSpecificClientId is available as well as any numerical
+ * value.
+ * @client_pool: (out): The information of memory pool for the client.
+ * @error: A #GError.
+ *
+ * Get statistical information of memory pool for the given client.
+ */
+void alsaseq_get_client_pool(gint client_id, ALSASeqClientPool **client_pool,
+ GError **error)
+{
+ char *devnode;
+ int fd;
+ struct snd_seq_client_pool *pool;
+
+ alsaseq_get_seq_devnode(&devnode, error);
+ if (*error != NULL)
+ return;
+
+ fd = open(devnode, O_RDONLY);
+ g_free(devnode);
+ if (fd < 0) {
+ generate_error(error, errno);
+ return;
+ }
+
+ *client_pool = g_object_new(ALSASEQ_TYPE_CLIENT_POOL, NULL);
+ seq_client_pool_refer_private(*client_pool, &pool);
+
+ pool->client = client_id;
+ if (ioctl(fd, SNDRV_SEQ_IOCTL_GET_CLIENT_POOL, pool) < 0) {
+ generate_error(error, errno);
+ close(fd);
+ g_object_unref(*client_pool);
+ return;
+ }
+
+ close(fd);
+}
#include <seq/system-info.h>
#include <seq/client-info.h>
#include <seq/port-info.h>
+#include <seq/client-pool.h>
G_BEGIN_DECLS
void alsaseq_get_port_info(guint client_id, guint port_id,
ALSASeqPortInfo **port_info, GError **error);
+void alsaseq_get_client_pool(gint client_id, ALSASeqClientPool **client_pool,
+ GError **error);
+
G_END_DECLS
#endif