]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
seq: addr: add object to represent address in ALSA Sequencer
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/addr.c [new file with mode: 0644]
src/seq/addr.h [new file with mode: 0644]
src/seq/alsaseq.map
src/seq/meson.build

diff --git a/src/seq/addr.c b/src/seq/addr.c
new file mode 100644 (file)
index 0000000..242826a
--- /dev/null
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: LGPL-3.0-or-later
+#include "addr.h"
+
+ALSASeqAddr *seq_addr_copy(const ALSASeqAddr *self)
+{
+    return g_memdup(self, sizeof(*self));
+}
+
+G_DEFINE_BOXED_TYPE(ALSASeqAddr, alsaseq_addr, seq_addr_copy, g_free)
diff --git a/src/seq/addr.h b/src/seq/addr.h
new file mode 100644 (file)
index 0000000..6844697
--- /dev/null
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: LGPL-3.0-or-later
+#ifndef __ALSA_GOBJECT_ALSASEQ_ADDR__H__
+#define __ALSA_GOBJECT_ALSASEQ_ADDR__H__
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include <sound/asequencer.h>
+
+G_BEGIN_DECLS
+
+#define ALSASEQ_TYPE_ADDR   (alsaseq_addr_get_type())
+
+typedef struct snd_seq_addr ALSASeqAddr;
+
+GType alsaseq_addr_get_type() G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif
index bbd7bdc30694d064b3012502877a63c2fd1108b1..a39fa39a99939506ac2fa3e46cbab5322764c6b6 100644 (file)
@@ -35,6 +35,9 @@ ALSA_GOBJECT_0_0_0 {
     "alsaseq_user_client_open";
     "alsaseq_user_client_set_info";
     "alsaseq_user_client_get_info";
+
+    "alsaseq_addr_get_type";
+    "alsaseq_addr_new";
   local:
     *;
 };
index 3e8d511799998c0b5732aa6ea5d8859a7e77d396..d5fc3b6808ca0a8b45a9721b0b9eca51abfb90fe 100644 (file)
@@ -13,6 +13,7 @@ sources = files(
   'system-info.c',
   'client-info.c',
   'user-client.c',
+  'addr.c',
 )
 
 headers = files(
@@ -20,6 +21,7 @@ headers = files(
   'system-info.h',
   'client-info.h',
   'user-client.h',
+  'addr.h',
 )
 
 privates = files(