From: Takashi Sakamoto Date: Wed, 1 Apr 2020 09:13:28 +0000 (+0900) Subject: seq: client_pool: add object to represent memory pool in client X-Git-Tag: v0.1.0~289 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=8aea841808ea7493338831385b0215f7253f27de;p=alsa-gobject.git seq: client_pool: add object to represent memory pool in client Signed-off-by: Takashi Sakamoto --- diff --git a/src/seq/alsaseq.map b/src/seq/alsaseq.map index 3e4ee36..d64a61b 100644 --- a/src/seq/alsaseq.map +++ b/src/seq/alsaseq.map @@ -47,6 +47,8 @@ ALSA_GOBJECT_0_0_0 { "alsaseq_port_info_get_type"; "alsaseq_port_info_new"; + + "alsaseq_client_pool_get_type"; local: *; }; diff --git a/src/seq/client-pool.c b/src/seq/client-pool.c new file mode 100644 index 0000000..ba85eff --- /dev/null +++ b/src/seq/client-pool.c @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later +#include "client-pool.h" + +G_DEFINE_TYPE(ALSASeqClientPool, alsaseq_client_pool, G_TYPE_OBJECT) + +static void alsaseq_client_pool_class_init(ALSASeqClientPoolClass *klass) +{ + return; +} + +static void alsaseq_client_pool_init(ALSASeqClientPool *self) +{ + return; +} diff --git a/src/seq/client-pool.h b/src/seq/client-pool.h new file mode 100644 index 0000000..7437565 --- /dev/null +++ b/src/seq/client-pool.h @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later +#ifndef __ALSA_GOBJECT_ALSASEQ_CLIENT_POOL__H__ +#define __ALSA_GOBJECT_ALSASEQ_CLIENT_POOL__H__ + +#include +#include + +G_BEGIN_DECLS + +#define ALSASEQ_TYPE_CLIENT_POOL (alsaseq_client_pool_get_type()) + +#define ALSASEQ_CLIENT_POOL(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), \ + ALSASEQ_TYPE_CLIENT_POOL, \ + ALSASeqClientPool)) +#define ALSASEQ_IS_CLIENT_POOL(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ + ALSASEQ_TYPE_CLIENT_POOL)) + +#define ALSASEQ_CLIENT_POOL_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), \ + ALSASEQ_TYPE_CLIENT_POOL, \ + ALSASeqClientPoolClass)) +#define ALSASEQ_IS_CLIENT_POOL_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), \ + ALSASEQ_TYPE_CLIENT_POOL)) +#define ALSASEQ_CLIENT_POOL_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS((obj), \ + ALSASEQ_TYPE_CLIENT_POOL, \ + ALSASeqClientPoolClass)) + +typedef struct _ALSASeqClientPool ALSASeqClientPool; +typedef struct _ALSASeqClientPoolClass ALSASeqClientPoolClass; + +struct _ALSASeqClientPool { + GObject parent_instance; +}; + +struct _ALSASeqClientPoolClass { + GObjectClass parent_class; +}; + +GType alsaseq_client_pool_get_type() G_GNUC_CONST; + +ALSASeqClientPool *alsaseq_client_pool_new(); + +G_END_DECLS + +#endif diff --git a/src/seq/meson.build b/src/seq/meson.build index cea2452..282a0c3 100644 --- a/src/seq/meson.build +++ b/src/seq/meson.build @@ -15,6 +15,7 @@ sources = files( 'user-client.c', 'addr.c', 'port-info.c', + 'client-pool.c', ) headers = files( @@ -24,6 +25,7 @@ headers = files( 'user-client.h', 'addr.h', 'port-info.h', + 'client-pool.h', ) privates = files( diff --git a/tests/alsaseq-client-pool b/tests/alsaseq-client-pool new file mode 100644 index 0000000..6a494ab --- /dev/null +++ b/tests/alsaseq-client-pool @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +from sys import exit +from errno import ENXIO + +from helper import test + +import gi +gi.require_version('ALSASeq', '0.0') +from gi.repository import ALSASeq + +target = ALSASeq.ClientPool() +props = () +methods = () +signals = () + +if not test(target, props, methods, signals): + exit(ENXIO) diff --git a/tests/meson.build b/tests/meson.build index a682172..0cddeb5 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -34,6 +34,7 @@ tests = { 'alsaseq-client-info', 'alsaseq-user-client', 'alsaseq-port-info', + 'alsaseq-client-pool', ], }