]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
seq: event_fixed: add GObject object for event with fixed length data
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/event-fixed.c [new file with mode: 0644]
src/seq/event-fixed.h [new file with mode: 0644]
src/seq/meson.build
tests/alsaseq-event-fixed [new file with mode: 0644]
tests/meson.build

index 69e8599f6fdf10ad33de75411a2ffc1ca3cadeb3..2ca157fe1e7d1bbc1d661e864d370bdff537b69a 100644 (file)
@@ -60,6 +60,8 @@ ALSA_GOBJECT_0_0_0 {
     "alsaseq_tstamp_set_real_time";
 
     "alsaseq_event_get_type";
+
+    "alsaseq_event_fixed_get_type";
   local:
     *;
 };
diff --git a/src/seq/event-fixed.c b/src/seq/event-fixed.c
new file mode 100644 (file)
index 0000000..105c361
--- /dev/null
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: LGPL-3.0-or-later
+#include "event-fixed.h"
+
+G_DEFINE_TYPE(ALSASeqEventFixed, alsaseq_event_fixed, ALSASEQ_TYPE_EVENT)
+
+static void alsaseq_event_fixed_class_init(ALSASeqEventFixedClass *klass)
+{
+    return;
+}
+
+static void alsaseq_event_fixed_init(ALSASeqEventFixed *self)
+{
+    return;
+}
diff --git a/src/seq/event-fixed.h b/src/seq/event-fixed.h
new file mode 100644 (file)
index 0000000..aabc7e6
--- /dev/null
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: LGPL-3.0-or-later
+#ifndef __ALSA_GOBJECT_ALSASEQ_EVENT_FIXED_H__
+#define __ALSA_GOBJECT_ALSASEQ_EVENT_FIXED_H__
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include <seq/event.h>
+
+G_BEGIN_DECLS
+
+#define ALSASEQ_TYPE_EVENT_FIXED    (alsaseq_event_fixed_get_type())
+
+#define ALSASEQ_EVENT_FIXED(obj)                            \
+    (G_TYPE_CHECK_INSTANCE_CAST((obj),                      \
+                                ALSASEQ_TYPE_EVENT_FIXED,   \
+                                ALSASeqEventFixed))
+#define ALSASEQ_IS_EVENT_FIXED(obj)                         \
+    (G_TYPE_CHECK_INSTANCE_TYPE((obj),                      \
+                                ALSASEQ_TYPE_EVENT_FIXED))
+
+#define ALSASEQ_EVENT_FIXED_CLASS(klass)                    \
+    (G_TYPE_CHECK_CLASS_CAST((klass),                       \
+                             ALSASEQ_TYPE_EVENT_FIXED,      \
+                             ALSASeqEventFixedClass))
+#define ALSASEQ_IS_EVENT_FIXED_CLASS(klass)                 \
+    (G_TYPE_CHECK_CLASS_TYPE((klass),                       \
+                             ALSASEQ_TYPE_EVENT_FIXED))
+#define ALSASEQ_EVENT_FIXED_GET_CLASS(obj)                  \
+    (G_TYPE_INSTANCE_GET_CLASS((obj),                       \
+                               ALSASEQ_TYPE_EVENT_FIXED,    \
+                               ALSASeqEventFixedClass))
+
+typedef struct _ALSASeqEventFixed           ALSASeqEventFixed;
+typedef struct _ALSASeqEventFixedClass      ALSASeqEventFixedClass;
+
+struct _ALSASeqEventFixed {
+    ALSASeqEvent parent_instance;
+};
+
+struct _ALSASeqEventFixedClass {
+    ALSASeqEventClass parent_class;
+};
+
+GType alsaseq_event_fixed_get_type() G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif
index 97ba11982caf0a12adf85d12f6d79f7dbb4765e0..c249c752e9abf79b2c348cf5d5e263febdc7fd97 100644 (file)
@@ -18,6 +18,7 @@ sources = files(
   'client-pool.c',
   'tstamp.c',
   'event.c',
+  'event-fixed.c',
 )
 
 headers = files(
@@ -30,6 +31,7 @@ headers = files(
   'client-pool.h',
   'tstamp.h',
   'event.h',
+  'event-fixed.h',
 )
 
 privates = files(
diff --git a/tests/alsaseq-event-fixed b/tests/alsaseq-event-fixed
new file mode 100644 (file)
index 0000000..e1aa9d0
--- /dev/null
@@ -0,0 +1,19 @@
+#!/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.EventFixed()
+props = ()
+methods = ()
+signals = ()
+
+if not test(target, props, methods, signals):
+    exit(ENXIO)
+
index 1aabba5d4ea24989491aceff3a40b9736d1f862f..fe1335b360479235342db5c52910c0a514f27421 100644 (file)
@@ -36,6 +36,7 @@ tests = {
     'alsaseq-port-info',
     'alsaseq-client-pool',
     'alsaseq-event',
+    'alsaseq-event-fixed',
   ],
 }