From: Takashi Sakamoto Date: Wed, 1 Apr 2020 09:13:28 +0000 (+0900) Subject: seq: tstamp: add Boxed object for timestamp union X-Git-Tag: v0.1.0~285 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=bfe6e6e5a5cc8cbe18f55f0038bb664d902fccd6;p=alsa-gobject.git seq: tstamp: add Boxed object for timestamp union Signed-off-by: Takashi Sakamoto --- diff --git a/src/seq/alsaseq.map b/src/seq/alsaseq.map index b05a348..b10a425 100644 --- a/src/seq/alsaseq.map +++ b/src/seq/alsaseq.map @@ -52,6 +52,8 @@ ALSA_GOBJECT_0_0_0 { "alsaseq_port_info_new"; "alsaseq_client_pool_get_type"; + + "alsaseq_tstamp_get_type"; local: *; }; diff --git a/src/seq/meson.build b/src/seq/meson.build index 282a0c3..4f23a19 100644 --- a/src/seq/meson.build +++ b/src/seq/meson.build @@ -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 index 0000000..bf0d1f6 --- /dev/null +++ b/src/seq/tstamp.c @@ -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 index 0000000..191ffd7 --- /dev/null +++ b/src/seq/tstamp.h @@ -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 +#include + +#include + +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