]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
seq: client_info: add object to represent information of client
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Wed, 1 Apr 2020 09:13:28 +0000 (18:13 +0900)
committer坂本 貴史 <o-takashi@sakamocchi.jp>
Fri, 3 Apr 2020 13:06:25 +0000 (22:06 +0900)
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
src/seq/alsaseq.map
src/seq/client-info.c [new file with mode: 0644]
src/seq/client-info.h [new file with mode: 0644]
src/seq/meson.build
tests/alsaseq-client-info [new file with mode: 0644]
tests/meson.build

index 571fc8451d688cf5649d80e8472dcc0f8dc94172..0b515a0c4091641ee0bc2b40b5feba1418fadaa8 100644 (file)
@@ -22,6 +22,9 @@ ALSA_GOBJECT_0_0_0 {
     "alsaseq_get_client_id_list";
 
     "alsaseq_system_info_get_type";
+
+    "alsaseq_client_info_get_type";
+    "alsaseq_client_info_new";
   local:
     *;
 };
diff --git a/src/seq/client-info.c b/src/seq/client-info.c
new file mode 100644 (file)
index 0000000..561397f
--- /dev/null
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: LGPL-3.0-or-later
+#include "client-info.h"
+
+G_DEFINE_TYPE(ALSASeqClientInfo, alsaseq_client_info, G_TYPE_OBJECT)
+
+static void alsaseq_client_info_class_init(ALSASeqClientInfoClass *klass)
+{
+    return;
+}
+
+static void alsaseq_client_info_init(ALSASeqClientInfo *self)
+{
+    return;
+}
+
+/**
+ * alsaseq_client_info_new:
+ *
+ * Allocate and return an instance of ALSASeqClientinfo class.
+ */
+ALSASeqClientInfo *alsaseq_client_info_new()
+{
+    return g_object_new(ALSASEQ_TYPE_CLIENT_INFO, NULL);
+}
diff --git a/src/seq/client-info.h b/src/seq/client-info.h
new file mode 100644 (file)
index 0000000..cb746ca
--- /dev/null
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: LGPL-3.0-or-later
+#ifndef __ALSA_GOBJECT_ALSASEQ_CLIENT_INFO__H__
+#define __ALSA_GOBJECT_ALSASEQ_CLIENT_INFO__H__
+
+#include <glib.h>
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define ALSASEQ_TYPE_CLIENT_INFO     (alsaseq_client_info_get_type())
+
+#define ALSASEQ_CLIENT_INFO(obj)                            \
+    (G_TYPE_CHECK_INSTANCE_CAST((obj),                      \
+                                ALSASEQ_TYPE_CLIENT_INFO,   \
+                                ALSASeqClientInfo))
+#define ALSASEQ_IS_CLIENT_INFO(obj)                         \
+    (G_TYPE_CHECK_INSTANCE_TYPE((obj),                      \
+                                ALSASEQ_TYPE_CLIENT_INFO))
+
+#define ALSASEQ_CLIENT_INFO_CLASS(klass)                    \
+    (G_TYPE_CHECK_CLASS_CAST((klass),                       \
+                             ALSASEQ_TYPE_CLIENT_INFO,      \
+                             ALSASeqClientInfoClass))
+#define ALSASEQ_IS_CLIENT_INFO_CLASS(klass)                 \
+    (G_TYPE_CHECK_CLASS_TYPE((klass),                       \
+                             ALSASEQ_TYPE_CLIENT_INFO))
+#define ALSASEQ_CLIENT_INFO_GET_CLASS(obj)                  \
+    (G_TYPE_INSTANCE_GET_CLASS((obj),                       \
+                               ALSASEQ_TYPE_CLIENT_INFO,    \
+                               ALSASeqClientInfoClass))
+
+typedef struct _ALSASeqClientInfo           ALSASeqClientInfo;
+typedef struct _ALSASeqClientInfoClass      ALSASeqClientInfoClass;
+
+struct _ALSASeqClientInfo {
+    GObject parent_instance;
+};
+
+struct _ALSASeqClientInfoClass {
+    GObjectClass parent_class;
+};
+
+GType alsaseq_client_info_get_type() G_GNUC_CONST;
+
+ALSASeqClientInfo *alsaseq_client_info_new();
+
+G_END_DECLS
+
+#endif
index 440f06ae0b8b436c374b24dd2d2fcd55b95b1c45..44ec1aa7f9a9419d598b449c2a6b18c3b398943b 100644 (file)
@@ -11,11 +11,13 @@ has_marshaller = false
 sources = files(
   'query.c',
   'system-info.c',
+  'client-info.c',
 )
 
 headers = files(
   'query.h',
   'system-info.h',
+  'client-info.h',
 )
 
 privates = files(
diff --git a/tests/alsaseq-client-info b/tests/alsaseq-client-info
new file mode 100644 (file)
index 0000000..7c9259e
--- /dev/null
@@ -0,0 +1,20 @@
+#!/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.ClientInfo()
+props = ()
+methods = (
+    'new',
+)
+signals = ()
+
+if not test(target, props, methods, signals):
+    exit(ENXIO)
index dba7e558e815e0fca6bb6038a1ecc5f468948296..629141d1ecbceb83366822fd34d162fc2e3d62fb 100644 (file)
@@ -31,6 +31,7 @@ tests = {
   'seq': [
     'alsaseq-enums',
     'alsaseq-system-info',
+    'alsaseq-client-info',
   ],
 }