]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
seq: queue-timer/queue-timer-data-alsa: remove unused gobject classes
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Wed, 1 Jun 2022 02:35:44 +0000 (11:35 +0900)
committer坂本 貴史 <o-takashi@sakamocchi.jp>
Thu, 2 Jun 2022 09:33:12 +0000 (18:33 +0900)
The former commit made some gobject classes as unused. This commit deletes
them.

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

index 4164b414a70a9e9a49936339fb6c9644689a787a..f003db5063b3175f74211110efb87057a2ccf9e1 100644 (file)
@@ -30,8 +30,6 @@
 #include <queue-info.h>
 #include <queue-status.h>
 #include <queue-tempo.h>
-#include <queue-timer-data-alsa.h>
-#include <queue-timer.h>
 #include <queue-timer-alsa.h>
 
 #include <user-client.h>
index 446f31fc533e9e3b0284fb6a3fef207093dc4db2..f14f35e0fadd7b99e39d568df9e67f6316437216 100644 (file)
@@ -109,17 +109,6 @@ ALSA_GOBJECT_0_0_0 {
     "alsaseq_queue_tempo_get_skew";
     "alsaseq_queue_tempo_set_skew";
 
-    "alsaseq_queue_timer_get_type";
-    "alsaseq_queue_timer_new";
-    "alsaseq_queue_timer_get_alsa_data";
-    "alsaseq_queue_timer_set_alsa_data";
-
-    "alsaseq_queue_timer_data_alsa_get_type";
-    "alsaseq_queue_timer_data_alsa_get_device_id";
-    "alsaseq_queue_timer_data_alsa_set_device_id";
-    "alsaseq_queue_timer_data_alsa_get_resolution";
-    "alsaseq_queue_timer_data_alsa_set_resolution";
-
     "alsaseq_remove_filter_get_type";
     "alsaseq_remove_filter_new_with_dest_addr";
     "alsaseq_remove_filter_new_with_note_channel";
index ed52440a2a73ebac2b403deacdd7e29c65f41be5..a195f64513004df8a8028b4f84ac1d3c56dccc0c 100644 (file)
@@ -26,8 +26,6 @@ sources = files(
   'queue-info.c',
   'queue-status.c',
   'queue-tempo.c',
-  'queue-timer.c',
-  'queue-timer-data-alsa.c',
   'remove-filter.c',
   'event-cntr.c',
   'queue-timer-common.c',
@@ -52,8 +50,6 @@ headers = files(
   'queue-info.h',
   'queue-status.h',
   'queue-tempo.h',
-  'queue-timer.h',
-  'queue-timer-data-alsa.h',
   'remove-filter.h',
   'event-cntr.h',
   'queue-timer-common.h',
diff --git a/src/seq/queue-timer-data-alsa.c b/src/seq/queue-timer-data-alsa.c
deleted file mode 100644 (file)
index 5a0aadc..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-// SPDX-License-Identifier: LGPL-3.0-or-later
-#include "privates.h"
-
-/**
- * ALSASeqQueueTimerDataAlsa:
- * A boxed object to represent data of queue timer in the case of ALSATimer.
- *
- * A [struct@QueueTimerDataAlsa] is a boxed object to represent data of queue timer in the case of
- * ALSATimer. The instance of object is one of data properties in queue timer.
- */
-ALSASeqQueueTimerDataAlsa *seq_queue_timer_data_alsa_copy(const ALSASeqQueueTimerDataAlsa *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(ALSASeqQueueTimerDataAlsa, alsaseq_queue_timer_data_alsa, seq_queue_timer_data_alsa_copy, g_free)
-
-/**
- * alsaseq_queue_timer_data_alsa_get_device_id:
- * @self: A [struct@QueueTimerDataAlsa].
- * @device_id: (out)(transfer none): A [struct@ALSATimer.DeviceId].
- *
- * Refer to the device identifier of timer which drives the queue.
- */
-void alsaseq_queue_timer_data_alsa_get_device_id(const ALSASeqQueueTimerDataAlsa *self,
-                                        const ALSATimerDeviceId **device_id)
-{
-    *device_id = (ALSATimerDeviceId *)&self->device_id;
-}
-
-/**
- * alsaseq_queue_timer_data_alsa_set_device_id:
- * @self: A [struct@QueueTimerDataAlsa].
- * @device_id: A [struct@ALSATimer.DeviceId].
- *
- * Copy the device identifier of timer which drives the queue.
- */
-void alsaseq_queue_timer_data_alsa_set_device_id(ALSASeqQueueTimerDataAlsa *self,
-                                        const ALSATimerDeviceId *device_id)
-{
-    self->device_id = *(struct snd_timer_id *)device_id;
-}
-
-/**
- * alsaseq_queue_timer_data_alsa_get_resolution:
- * @self: A [struct@QueueTimerDataAlsa].
- * @resolution: (out): The resolution of timer.
- *
- * Get the resolution of timer which drives the queue.
- */
-void alsaseq_queue_timer_data_alsa_get_resolution(const ALSASeqQueueTimerDataAlsa *self,
-                                                  guint *resolution)
-{
-    *resolution = self->resolution;
-}
-
-/**
- * alsaseq_queue_timer_data_alsa_set_resolution:
- * @self: A [struct@QueueTimerDataAlsa].
- * @resolution: The resolution of timer.
- *
- * Set the resolution of timer which drives the queue.
- */
-void alsaseq_queue_timer_data_alsa_set_resolution(ALSASeqQueueTimerDataAlsa *self,
-                                                  guint resolution)
-{
-    self->resolution = resolution;
-}
diff --git a/src/seq/queue-timer-data-alsa.h b/src/seq/queue-timer-data-alsa.h
deleted file mode 100644 (file)
index 6af0356..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// SPDX-License-Identifier: LGPL-3.0-or-later
-#ifndef __ALSA_GOBJECT_ALSASEQ_QUEUE_TIMER_DATA_ALSA_H__
-#define __ALSA_GOBJECT_ALSASEQ_QUEUE_TIMER_DATA_ALSA_H__
-
-#include <alsaseq.h>
-#include <alsatimer.h>
-
-G_BEGIN_DECLS
-
-#define ALSASEQ_TYPE_QUEUE_TIMER_DATA_ALSA  (alsaseq_queue_time_data_alsa_get_type())
-
-// This structure should be the same layout as 'struct snd_seq_queue_timer.u.alsa'
-typedef struct {
-    /*< private >*/
-    ALSATimerDeviceId device_id;
-    unsigned int resolution;
-} ALSASeqQueueTimerDataAlsa;
-
-GType alsaseq_queue_timer_data_alsa_get_type() G_GNUC_CONST;
-
-void alsaseq_queue_timer_data_alsa_get_device_id(const ALSASeqQueueTimerDataAlsa *self,
-                                        const ALSATimerDeviceId **device_id);
-void alsaseq_queue_timer_data_alsa_set_device_id(ALSASeqQueueTimerDataAlsa *self,
-                                        const ALSATimerDeviceId *device_id);
-
-void alsaseq_queue_timer_data_alsa_get_resolution(const ALSASeqQueueTimerDataAlsa *self,
-                                                  guint *resolution);
-void alsaseq_queue_timer_data_alsa_set_resolution(ALSASeqQueueTimerDataAlsa *self,
-                                                  guint resolution);
-G_END_DECLS
-
-#endif
diff --git a/src/seq/queue-timer.c b/src/seq/queue-timer.c
deleted file mode 100644 (file)
index c6e38c2..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-// SPDX-License-Identifier: LGPL-3.0-or-later
-#include "privates.h"
-
-/**
- * ALSASeqQueueTimer:
- * A GObject-derived object to represent timer for queue.
- *
- * A [class@QueueTimer] is a GObject-derived object to represent the information of timer which
- * drives the queue.
- *
- * The object wraps `struct snd_seq_queue_timer` in UAPI of Linux sound subsystem.
- */
-typedef struct {
-    struct snd_seq_queue_timer timer;
-} ALSASeqQueueTimerPrivate;
-G_DEFINE_TYPE_WITH_PRIVATE(ALSASeqQueueTimer, alsaseq_queue_timer, G_TYPE_OBJECT)
-
-enum seq_queue_timer_prop_type {
-    SEQ_QUEUE_TIMER_PROP_QUEUE_ID = 1,
-    SEQ_QUEUE_TIMER_PROP_TIMER_TYPE,
-    SEQ_QUEUE_TIMER_PROP_COUNT,
-};
-static GParamSpec *seq_queue_timer_props[SEQ_QUEUE_TIMER_PROP_COUNT] = { NULL, };
-
-static void seq_queue_timer_get_property(GObject *obj, guint id, GValue *val,
-                                         GParamSpec *spec)
-{
-    ALSASeqQueueTimer *self = ALSASEQ_QUEUE_TIMER(obj);
-    ALSASeqQueueTimerPrivate *priv =
-                                alsaseq_queue_timer_get_instance_private(self);
-
-    switch (id) {
-    case SEQ_QUEUE_TIMER_PROP_QUEUE_ID:
-        g_value_set_int(val, priv->timer.queue);
-        break;
-    case SEQ_QUEUE_TIMER_PROP_TIMER_TYPE:
-        g_value_set_enum(val, (ALSASeqQueueTimerType)priv->timer.type);
-        break;
-    default:
-        G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, id, spec);
-        break;
-    }
-}
-
-static void alsaseq_queue_timer_class_init(ALSASeqQueueTimerClass *klass)
-{
-    GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
-
-    gobject_class->get_property = seq_queue_timer_get_property;
-
-    seq_queue_timer_props[SEQ_QUEUE_TIMER_PROP_QUEUE_ID] =
-        g_param_spec_uchar("queue-id", "queue-id",
-                           "The numerical ID of queue, except for one of "
-                           "ALSASeqSpecificClientId.",
-                           0, G_MAXUINT8,
-                           0,
-                           G_PARAM_READABLE);
-
-    seq_queue_timer_props[SEQ_QUEUE_TIMER_PROP_TIMER_TYPE] =
-        g_param_spec_enum("type", "type",
-                          "The type of timer for the queue, one of "
-                          "ALSASeqQueueTimerType.",
-                          ALSASEQ_TYPE_QUEUE_TIMER_TYPE,
-                          ALSASEQ_QUEUE_TIMER_TYPE_ALSA,
-                          G_PARAM_READABLE);
-
-    g_object_class_install_properties(gobject_class,
-                                      SEQ_QUEUE_TIMER_PROP_COUNT,
-                                      seq_queue_timer_props);
-}
-
-static void alsaseq_queue_timer_init(ALSASeqQueueTimer *self)
-{
-    return;
-}
-
-/**
- * alsaseq_queue_timer_new:
- *
- * Allocate and return an instance of [class@QueueTimer].
- *
- * Returns: An instance of [class@QueueTimer].
- */
-ALSASeqQueueTimer *alsaseq_queue_timer_new()
-{
-    return g_object_new(ALSASEQ_TYPE_QUEUE_TIMER, NULL);
-}
-
-/**
- * alsaseq_queue_timer_get_alsa_data:
- * @self: A [class@QueueTimer].
- * @data: (out)(transfer none): A [struct@QueueTimerDataAlsa].
- *
- * Refer to the data of timer for queue in the case that the device in ALSATimer drives the timer.
- */
-void alsaseq_queue_timer_get_alsa_data(ALSASeqQueueTimer *self,
-                                       const ALSASeqQueueTimerDataAlsa **data)
-{
-    ALSASeqQueueTimerPrivate *priv;
-
-    g_return_if_fail(ALSASEQ_IS_QUEUE_TIMER(self));
-    priv = alsaseq_queue_timer_get_instance_private(self);
-
-    g_return_if_fail(data != NULL);
-
-    *data = (const ALSASeqQueueTimerDataAlsa *)&priv->timer.u.alsa;
-}
-
-/**
- * alsaseq_queue_timer_set_alsa_data:
- * @self: A [class@QueueTimer].
- * @data: A [struct@QueueTimerDataAlsa].
- *
- * Set the data of timer for queue in the case that the device in ALSATimer drives the timer.
- */
-void alsaseq_queue_timer_set_alsa_data(ALSASeqQueueTimer *self,
-                                       const ALSASeqQueueTimerDataAlsa *data)
-{
-    ALSASeqQueueTimerPrivate *priv;
-
-    g_return_if_fail(ALSASEQ_IS_QUEUE_TIMER(self));
-    priv = alsaseq_queue_timer_get_instance_private(self);
-
-    g_return_if_fail(data != NULL);
-
-    priv->timer.type = SNDRV_SEQ_TIMER_ALSA;
-    priv->timer.u.alsa.id = data->device_id;
-    priv->timer.u.alsa.resolution = data->resolution;
-}
-
-void seq_queue_timer_refer_private(ALSASeqQueueTimer *self,
-                                   struct snd_seq_queue_timer **timer)
-{
-    ALSASeqQueueTimerPrivate *priv =
-                                alsaseq_queue_timer_get_instance_private(self);
-
-    *timer = &priv->timer;
-}
diff --git a/src/seq/queue-timer.h b/src/seq/queue-timer.h
deleted file mode 100644 (file)
index a30db71..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// SPDX-License-Identifier: LGPL-3.0-or-later
-#ifndef __ALSA_GOBJECT_ALSASEQ_QUEUE_TIMER_H__
-#define __ALSA_GOBJECT_ALSASEQ_QUEUE_TIMER_H__
-
-#include <alsaseq.h>
-
-G_BEGIN_DECLS
-
-#define ALSASEQ_TYPE_QUEUE_TIMER     (alsaseq_queue_timer_get_type())
-
-G_DECLARE_DERIVABLE_TYPE(ALSASeqQueueTimer, alsaseq_queue_timer, ALSASEQ, QUEUE_TIMER, GObject);
-
-struct _ALSASeqQueueTimerClass {
-    GObjectClass parent_class;
-};
-
-ALSASeqQueueTimer *alsaseq_queue_timer_new();
-
-void alsaseq_queue_timer_get_alsa_data(ALSASeqQueueTimer *self,
-                                       const ALSASeqQueueTimerDataAlsa **data);
-void alsaseq_queue_timer_set_alsa_data(ALSASeqQueueTimer *self,
-                                       const ALSASeqQueueTimerDataAlsa *data);
-
-G_END_DECLS
-
-#endif
diff --git a/tests/alsaseq-queue-timer b/tests/alsaseq-queue-timer
deleted file mode 100644 (file)
index 858ba3a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/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.QueueTimer()
-props = (
-    'queue-id',
-    'type',
-)
-
-methods = (
-    'new',
-    'get_alsa_data',
-    'set_alsa_data',
-)
-
-signals = ()
-
-if not test(target, props, methods, signals):
-    exit(ENXIO)
index 6df94d53c7f4677ca04ba756bbd1958deb408d22..0cb8d30122c85525012e67d8bf6fe8b643816273 100644 (file)
@@ -35,7 +35,6 @@ tests = {
     'alsaseq-queue-info',
     'alsaseq-queue-status',
     'alsaseq-queue-tempo',
-    'alsaseq-queue-timer',
     'alsaseq-queue-timer-alsa',
     'alsaseq-event-cntr',
   ],