]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
seq: tstamp: remove unused boxed structure
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Tue, 14 Jun 2022 10:23:21 +0000 (19:23 +0900)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Tue, 14 Jun 2022 10:23:21 +0000 (19:23 +0900)
The boxed structure for time stamp union is not used anymore.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
src/seq/alsaseq.h
src/seq/alsaseq.map
src/seq/meson.build
src/seq/tstamp.c [deleted file]
src/seq/tstamp.h [deleted file]

index f003db5063b3175f74211110efb87057a2ccf9e1..ce06789ff1eb6e4beff55ab83831893a2cd54a6c 100644 (file)
@@ -10,7 +10,6 @@
 #include <alsaseq-enum-types.h>
 #include <alsaseq-enums.h>
 
-#include <tstamp.h>
 #include <addr.h>
 #include <event-data-note.h>
 #include <event-data-ctl.h>
index 35cde925fff2ea47f838341903bcaa88a36840ef..65243ea521ad9c022be98f5435a2ae3fcf57adfb 100644 (file)
@@ -37,12 +37,6 @@ ALSA_GOBJECT_0_0_0 {
 
     "alsaseq_client_pool_get_type";
 
-    "alsaseq_tstamp_get_type";
-    "alsaseq_tstamp_get_tick_time";
-    "alsaseq_tstamp_set_tick_time";
-    "alsaseq_tstamp_get_real_time";
-    "alsaseq_tstamp_set_real_time";
-
     "alsaseq_event_get_type";
 
     "alsaseq_event_data_result_get_type";
index a195f64513004df8a8028b4f84ac1d3c56dccc0c..24b8b1162d6e039f410f086390227e6845a50d2f 100644 (file)
@@ -16,7 +16,6 @@ sources = files(
   'addr.c',
   'port-info.c',
   'client-pool.c',
-  'tstamp.c',
   'event-data-result.c',
   'event-data-note.c',
   'event-data-ctl.c',
@@ -40,7 +39,6 @@ headers = files(
   'addr.h',
   'port-info.h',
   'client-pool.h',
-  'tstamp.h',
   'event-data-result.h',
   'event-data-note.h',
   'event-data-ctl.h',
diff --git a/src/seq/tstamp.c b/src/seq/tstamp.c
deleted file mode 100644 (file)
index 845ba81..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-// SPDX-License-Identifier: LGPL-3.0-or-later
-#include "privates.h"
-
-/**
- * ALSASeqTstamp:
- * A boxed object to represent timestamp.
- *
- * A [struct@Tstamp] is a boxed object to represent timestamp. The object shares storage for two
- * types of time; tick time and real time.
- *
- * The object wraps `struct snd_seq_timestamp` in UAPI of Linux sound subsystem.
- */
-ALSASeqTstamp *seq_tstamp_copy(const ALSASeqTstamp *self)
-{
-#ifdef g_memdup2
-    return g_memdup2(self, sizeof(*self));
-#else
-    // GLib v2.68 deprecated g_memdup() with concern about overflow by narrow conversion from size_t to
-    // unsigned int however it's safe in the local case.
-    gpointer ptr = g_malloc(sizeof(*self));
-    memcpy(ptr, self, sizeof(*self));
-    return ptr;
-#endif
-}
-
-G_DEFINE_BOXED_TYPE(ALSASeqTstamp, alsaseq_tstamp, seq_tstamp_copy, g_free)
-
-/**
- * alsaseq_tstamp_get_tick_time:
- * @self: A [struct@Tstamp].
- * @tick_time: (out): The value of MIDI ticks.
- *
- * Get time as MIDI ticks.
- */
-void alsaseq_tstamp_get_tick_time(const ALSASeqTstamp *self, guint32 *tick_time)
-{
-    *tick_time = self->tick;
-}
-
-/**
- * alsaseq_tstamp_set_tick_time:
- * @self: A [struct@Tstamp].
- * @tick_time: The number of MIDI ticks.
- *
- * Set time as MIDI ticks.
- */
-void alsaseq_tstamp_set_tick_time(ALSASeqTstamp *self, const guint32 tick_time)
-{
-    self->tick = tick_time;
-}
-
-/**
- * alsaseq_tstamp_get_real_time:
- * @self: A [struct@Tstamp].
- * @real_time: (array fixed-size=2)(out)(transfer none): The array with two elements for sec part
- *             and nsec part of real time.
- *
- * Refer to the time as wall-clock time.
- */
-void alsaseq_tstamp_get_real_time(const ALSASeqTstamp *self,
-                                  const guint32 *real_time[2])
-{
-    // MEMO: I wish 32-bit storage size is aligned to 32 bit offset in all of
-    // supported ABIs.
-    *real_time = (guint32 *)&self->time;
-}
-
-
-/**
- * alsaseq_tstamp_set_real_time:
- * @self: A [struct@Tstamp].
- * @real_time: (array fixed-size=2)(transfer none): The array with two elements for sec part and
- *             nsec part of real time.
- *
- * Copy the time as wall-clock time.
- */
-void alsaseq_tstamp_set_real_time(ALSASeqTstamp *self, const guint32 real_time[2])
-{
-    self->time.tv_sec = real_time[0];
-    self->time.tv_nsec = real_time[1];
-}
diff --git a/src/seq/tstamp.h b/src/seq/tstamp.h
deleted file mode 100644 (file)
index bb00392..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// SPDX-License-Identifier: LGPL-3.0-or-later
-#ifndef __ALSA_GOBJECT_ALSASEQ_TSTAMP_H__
-#define __ALSA_GOBJECT_ALSASEQ_TSTAMP_H__
-
-#include <alsaseq.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;
-
-void alsaseq_tstamp_get_tick_time(const ALSASeqTstamp *self, guint32 *tick_time);
-void alsaseq_tstamp_set_tick_time(ALSASeqTstamp *self, const guint32 tick_time);
-
-void alsaseq_tstamp_get_real_time(const ALSASeqTstamp *self,
-                                  const guint32 *real_time[2]);
-void alsaseq_tstamp_set_real_time(ALSASeqTstamp *self, const guint32 real_time[2]);
-
-G_END_DECLS
-
-#endif