]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
seq: tstamp: add Boxed object for timestamp union
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/meson.build
src/seq/tstamp.c [new file with mode: 0644]
src/seq/tstamp.h [new file with mode: 0644]

index b05a34839779208ec75d26811b88704e57ef4d17..b10a425c25e9dc1d7d91a8ecd56fea31660b7497 100644 (file)
@@ -52,6 +52,8 @@ ALSA_GOBJECT_0_0_0 {
     "alsaseq_port_info_new";
 
     "alsaseq_client_pool_get_type";
+
+    "alsaseq_tstamp_get_type";
   local:
     *;
 };
index 282a0c398f60ca6b686c66f3c3e241f8c12f75d9..4f23a1952950e1ef22b659e9efa1bd21fccef236 100644 (file)
@@ -16,6 +16,7 @@ sources = files(
   'addr.c',
   'port-info.c',
   'client-pool.c',
+  'tstamp.c',
 )
 
 headers = files(
@@ -26,6 +27,7 @@ headers = files(
   'addr.h',
   'port-info.h',
   'client-pool.h',
+  'tstamp.h',
 )
 
 privates = files(
diff --git a/src/seq/tstamp.c b/src/seq/tstamp.c
new file mode 100644 (file)
index 0000000..bf0d1f6
--- /dev/null
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: LGPL-3.0-or-later
+#include "tstamp.h"
+
+ALSASeqTstamp *seq_tstamp_copy(const ALSASeqTstamp *self)
+{
+    return g_memdup(self, sizeof(*self));
+}
+
+G_DEFINE_BOXED_TYPE(ALSASeqTstamp, alsaseq_tstamp, seq_tstamp_copy, g_free)
diff --git a/src/seq/tstamp.h b/src/seq/tstamp.h
new file mode 100644 (file)
index 0000000..191ffd7
--- /dev/null
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: LGPL-3.0-or-later
+#ifndef __ALSA_GOBJECT_ALSASEQ_TSTAMP__H__
+#define __ALSA_GOBJECT_ALSASEQ_TSTAMP__H__
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include <sound/asequencer.h>
+
+G_BEGIN_DECLS
+
+#define ALSASEQ_TYPE_TSTAMP   (alsaseq_tstamp_get_type())
+
+typedef union snd_seq_timestamp ALSASeqTstamp;
+
+GType alsaseq_tstamp_get_type() G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif