]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
seq: event: dismiss ALSASeqEvent
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 8 Jun 2020 14:10:10 +0000 (23:10 +0900)
committer坂本 貴史 <o-takashi@sakamocchi.jp>
Tue, 9 Jun 2020 00:16:09 +0000 (09:16 +0900)
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
doc/reference/seq/alsaseq-docs.xml
doc/reference/seq/alsaseq.types
src/seq/event.c [deleted file]
src/seq/event.h [deleted file]
src/seq/meson.build
src/seq/privates.h
src/seq/user-client.h
tests/alsaseq-event [deleted file]
tests/meson.build

index 58ab9d49c35a7018cb70b92748d6fd715564abf7..df38e5592aabe998c2b84eb54a682a687154a2c5 100644 (file)
@@ -41,7 +41,6 @@
         <xi:include href="xml/port-info.xml"/>
         <xi:include href="xml/subscribe-data.xml"/>
         <xi:include href="xml/event-cntr.xml"/>
-        <xi:include href="xml/event.xml"/>
         <xi:include href="xml/tstamp.xml"/>
         <xi:include href="xml/event-data-result.xml"/>
         <xi:include href="xml/event-data-note.xml"/>
index d1cac7acf465e0db17533e0c94be1db06a17ef76..5982da028178994e53bf764f2e52d036679b8b91 100644 (file)
@@ -7,7 +7,6 @@ alsaseq_event_data_ctl_get_type
 alsaseq_event_data_note_get_type
 alsaseq_event_data_queue_get_type
 alsaseq_event_data_result_get_type
-alsaseq_event_get_type
 alsaseq_event_length_mode_get_type
 alsaseq_event_priority_mode_get_type
 alsaseq_event_time_mode_get_type
diff --git a/src/seq/event.c b/src/seq/event.c
deleted file mode 100644 (file)
index 6ad2999..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-// SPDX-License-Identifier: LGPL-3.0-or-later
-#include "privates.h"
-
-#include <errno.h>
-
-/**
- * SECTION: event
- * @Title: ALSASeqEvent
- * @Short_description: A GObject-derived abstract object to represent any event
- *
- * A #ALSASeqEvent is a GObject-derived abstract object to represent common
- * properties and method for any event. Applications can use derived object;
- * #ALSASeqEventFixed and #ALSASeqEventVariable.
- *
- * The object wraps 'struct snd_seq_event' in UAPI of Linux sound subsystem.
- */
-struct _ALSASeqEventPrivate {
-    struct snd_seq_event ev;
-};
-G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE(ALSASeqEvent, alsaseq_event, G_TYPE_OBJECT)
-
-enum seq_event_prop_type {
-    SEQ_EVENT_PROP_EVENT_TYPE = 1,
-    SEQ_EVENT_PROP_MODE_TIMESTAMP,
-    SEQ_EVENT_PROP_MODE_TIME,
-    SEQ_EVENT_PROP_MODE_LENGTH,
-    SEQ_EVENT_PROP_MODE_PRIORITY,
-    SEQ_EVENT_PROP_TAG,
-    SEQ_EVENT_PROP_QUEUE_ID,
-    SEQ_EVENT_PROP_TSTAMP,
-    SEQ_EVENT_PROP_SRC_ADDR,
-    SEQ_EVENT_PROP_DST_ADDR,
-    SEQ_EVENT_PROP_COUNT,
-};
-static GParamSpec *seq_event_props[SEQ_EVENT_PROP_COUNT] = { NULL, };
-
-static void seq_event_set_property(GObject *obj, guint id, const GValue *val,
-                                   GParamSpec *spec)
-{
-    ALSASeqEvent *self = ALSASEQ_EVENT(obj);
-    ALSASeqEventPrivate *priv = alsaseq_event_get_instance_private(self);
-    struct snd_seq_event *ev = &priv->ev;
-
-    switch (id) {
-    case SEQ_EVENT_PROP_EVENT_TYPE:
-       ev->type = (snd_seq_event_type_t)g_value_get_enum(val);
-        break;
-    case SEQ_EVENT_PROP_MODE_TIMESTAMP:
-        ev->flags &= ~SNDRV_SEQ_TIME_STAMP_MASK;
-        ev->flags |= (unsigned char)g_value_get_enum(val);
-        break;
-    case SEQ_EVENT_PROP_MODE_TIME:
-        ev->flags &= ~SNDRV_SEQ_TIME_MODE_MASK;
-        ev->flags |= (unsigned char)g_value_get_enum(val);
-        break;
-    case SEQ_EVENT_PROP_MODE_LENGTH:
-        ev->flags &= ~SNDRV_SEQ_EVENT_LENGTH_MASK;
-        ev->flags |= (unsigned char)g_value_get_enum(val);
-        break;
-    case SEQ_EVENT_PROP_MODE_PRIORITY:
-        ev->flags &= ~SNDRV_SEQ_PRIORITY_MASK;
-        ev->flags |= (unsigned char)g_value_get_enum(val);
-        break;
-    case SEQ_EVENT_PROP_TAG:
-        ev->tag = g_value_get_schar(val);
-        break;
-    case SEQ_EVENT_PROP_QUEUE_ID:
-        ev->queue = g_value_get_uchar(val);
-        break;
-    case SEQ_EVENT_PROP_TSTAMP:
-    {
-        ALSASeqTstamp *tstamp = g_value_get_boxed(val);
-        if (tstamp != NULL)
-            ev->time = *tstamp;
-        break;
-    }
-    case SEQ_EVENT_PROP_SRC_ADDR:
-    {
-        ALSASeqAddr *addr = g_value_get_boxed(val);
-        if (addr != NULL)
-            ev->source = *addr;
-        break;
-    }
-    case SEQ_EVENT_PROP_DST_ADDR:
-    {
-        ALSASeqAddr *addr = g_value_get_boxed(val);
-        if (addr != NULL)
-            ev->dest = *addr;
-        break;
-    }
-    default:
-        G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, id, spec);
-        break;
-    }
-}
-
-static void seq_event_get_property(GObject *obj, guint id, GValue *val,
-                                   GParamSpec *spec)
-{
-    ALSASeqEvent *self = ALSASEQ_EVENT(obj);
-    ALSASeqEventPrivate *priv = alsaseq_event_get_instance_private(self);
-    struct snd_seq_event *ev = &priv->ev;
-
-    switch (id) {
-    case SEQ_EVENT_PROP_EVENT_TYPE:
-        g_value_set_enum(val, (ALSASeqEventType)ev->type);
-        break;
-    case SEQ_EVENT_PROP_MODE_TIMESTAMP:
-    {
-        ALSASeqEventTimestampMode entry;
-        entry = ev->flags & SNDRV_SEQ_TIME_STAMP_MASK;
-        g_value_set_enum(val, entry);
-        break;
-    }
-    case SEQ_EVENT_PROP_MODE_TIME:
-    {
-        ALSASeqEventTimeMode entry;
-        entry = ev->flags & SNDRV_SEQ_TIME_MODE_MASK;
-        g_value_set_enum(val, entry);
-        break;
-    }
-    case SEQ_EVENT_PROP_MODE_LENGTH:
-    {
-        ALSASeqEventLengthMode entry;
-        entry = ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK;
-        g_value_set_enum(val, entry);
-        break;
-    }
-    case SEQ_EVENT_PROP_MODE_PRIORITY:
-    {
-        ALSASeqEventPriorityMode entry;
-        entry = ev->flags & SNDRV_SEQ_PRIORITY_MASK;
-        g_value_set_enum(val, entry);
-        break;
-    }
-    case SEQ_EVENT_PROP_TAG:
-        g_value_set_schar(val, ev->tag);
-        break;
-    case SEQ_EVENT_PROP_QUEUE_ID:
-        g_value_set_uchar(val, ev->queue);
-        break;
-    case SEQ_EVENT_PROP_TSTAMP:
-        g_value_set_static_boxed(val, &ev->time);
-        break;
-    case SEQ_EVENT_PROP_SRC_ADDR:
-        g_value_set_static_boxed(val, &ev->source);
-        break;
-    case SEQ_EVENT_PROP_DST_ADDR:
-        g_value_set_static_boxed(val, &ev->dest);
-        break;
-    default:
-        G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, id, spec);
-        break;
-    }
-}
-
-static void alsaseq_event_class_init(ALSASeqEventClass *klass)
-{
-    GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
-
-    gobject_class->set_property = seq_event_set_property;
-    gobject_class->get_property = seq_event_get_property;
-
-    seq_event_props[SEQ_EVENT_PROP_EVENT_TYPE] =
-        g_param_spec_enum("type", "type",
-                         "The type of event, one of ALSASeqEventType.",
-                         ALSASEQ_TYPE_EVENT_TYPE,
-                         ALSASEQ_EVENT_TYPE_NONE,
-                         G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
-
-    seq_event_props[SEQ_EVENT_PROP_MODE_TIMESTAMP] =
-        g_param_spec_enum("timestamp-mode", "timestamp-mode",
-                          "The mode of timestamp for the event, one of "
-                          "ALSASeqEventTimestampMode",
-                          ALSASEQ_TYPE_EVENT_TIMESTAMP_MODE,
-                          ALSASEQ_EVENT_TIMESTAMP_MODE_TICK,
-                          G_PARAM_READWRITE);
-
-    seq_event_props[SEQ_EVENT_PROP_MODE_TIME] =
-        g_param_spec_enum("time-mode", "time-mode",
-                          "The mode of time for the event, one of "
-                          "ALSASeqEventTimeMode",
-                          ALSASEQ_TYPE_EVENT_TIME_MODE,
-                          ALSASEQ_EVENT_TIME_MODE_ABS,
-                          G_PARAM_READWRITE);
-
-    seq_event_props[SEQ_EVENT_PROP_MODE_LENGTH] =
-        g_param_spec_enum("length-mode", "length-mode",
-                          "The mode of length for the event, one of "
-                          "ALSASeqEventLengthMode",
-                          ALSASEQ_TYPE_EVENT_LENGTH_MODE,
-                          ALSASEQ_EVENT_LENGTH_MODE_FIXED,
-                          G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
-
-    seq_event_props[SEQ_EVENT_PROP_MODE_PRIORITY] =
-        g_param_spec_enum("priority-mode", "priority-mode",
-                          "The mode of priority for the event, one of "
-                          "ALSASeqEventPriorityMode",
-                          ALSASEQ_TYPE_EVENT_PRIORITY_MODE,
-                          ALSASEQ_EVENT_PRIORITY_MODE_NORMAL,
-                          G_PARAM_READWRITE);
-
-    seq_event_props[SEQ_EVENT_PROP_TAG] =
-        g_param_spec_char("tag", "tag",
-                          "The arbitrary tag associated to the event.",
-                          G_MININT8, G_MAXINT8,
-                          0,
-                          G_PARAM_READWRITE);
-
-    seq_event_props[SEQ_EVENT_PROP_QUEUE_ID] =
-        g_param_spec_uchar("queue-id", "queue-id",
-                           "The numerical ID of queue to deliver the event. "
-                           "One of ALSASeqSpecificQueueId is available as well.",
-                           0, G_MAXUINT8,
-                           0,
-                           G_PARAM_READWRITE);
-
-    seq_event_props[SEQ_EVENT_PROP_TSTAMP] =
-        g_param_spec_boxed("tstamp", "tstamp",
-                           "The timestamp for the event. The content is "
-                           "decided according to timestamp-mode property.",
-                           ALSASEQ_TYPE_TSTAMP,
-                           G_PARAM_READWRITE);
-
-    seq_event_props[SEQ_EVENT_PROP_SRC_ADDR] =
-        g_param_spec_boxed("src-addr", "src-addr",
-                           "The address of source for the event.",
-                           ALSASEQ_TYPE_ADDR,
-                           G_PARAM_READWRITE);
-
-    seq_event_props[SEQ_EVENT_PROP_DST_ADDR] =
-        g_param_spec_boxed("dst-addr", "dst-addr",
-                           "The address of destination for the event.",
-                           ALSASEQ_TYPE_ADDR,
-                           G_PARAM_READWRITE);
-
-    g_object_class_install_properties(gobject_class,
-                                      SEQ_EVENT_PROP_COUNT,
-                                      seq_event_props);
-}
-
-static void alsaseq_event_init(ALSASeqEvent *self)
-{
-    return;
-}
-
-void seq_event_refer_private(ALSASeqEvent *self, struct snd_seq_event **ev)
-{
-    ALSASeqEventPrivate *priv = alsaseq_event_get_instance_private(self);
-    *ev = &priv->ev;
-}
diff --git a/src/seq/event.h b/src/seq/event.h
deleted file mode 100644 (file)
index 7553d15..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-// SPDX-License-Identifier: LGPL-3.0-or-later
-#ifndef __ALSA_GOBJECT_ALSASEQ_EVENT__H__
-#define __ALSA_GOBJECT_ALSASEQ_EVENT__H__
-
-#include <glib.h>
-#include <glib-object.h>
-
-#include <seq/addr.h>
-#include <seq/tstamp.h>
-
-#include <seq/alsaseq-enums.h>
-
-G_BEGIN_DECLS
-
-#define ALSASEQ_TYPE_EVENT     (alsaseq_event_get_type())
-
-#define ALSASEQ_EVENT(obj)                              \
-    (G_TYPE_CHECK_INSTANCE_CAST((obj),                  \
-                                ALSASEQ_TYPE_EVENT,     \
-                                ALSASeqEvent))
-#define ALSASEQ_IS_EVENT(obj)                           \
-    (G_TYPE_CHECK_INSTANCE_TYPE((obj),                  \
-                                ALSASEQ_TYPE_EVENT))
-
-#define ALSASEQ_EVENT_CLASS(klass)                      \
-    (G_TYPE_CHECK_CLASS_CAST((klass),                   \
-                             ALSASEQ_TYPE_EVENT,        \
-                             ALSASeqEventClass))
-#define ALSASEQ_IS_EVENT_CLASS(klass)                   \
-    (G_TYPE_CHECK_CLASS_TYPE((klass),                   \
-                             ALSASEQ_TYPE_EVENT))
-#define ALSASEQ_EVENT_GET_CLASS(obj)                    \
-    (G_TYPE_INSTANCE_GET_CLASS((obj),                   \
-                               ALSASEQ_TYPE_EVENT,      \
-                               ALSASeqEventClass))
-
-typedef struct _ALSASeqEvent        ALSASeqEvent;
-typedef struct _ALSASeqEventClass   ALSASeqEventClass;
-typedef struct _ALSASeqEventPrivate ALSASeqEventPrivate;
-
-struct _ALSASeqEvent {
-    GObject parent_instance;
-
-    ALSASeqEventPrivate *priv;
-};
-
-struct _ALSASeqEventClass {
-    GObjectClass parent_class;
-};
-
-GType alsaseq_event_get_type() G_GNUC_CONST;
-
-G_END_DECLS
-
-#endif
index 25f3f73f024404e8b0d96fa598ec1779237bba5a..57927ad4f6fd8fd89fae80b7e202ffd6b6211aa7 100644 (file)
@@ -17,7 +17,6 @@ sources = files(
   'port-info.c',
   'client-pool.c',
   'tstamp.c',
-  'event.c',
   'event-data-result.c',
   'event-data-note.c',
   'event-data-ctl.c',
@@ -42,7 +41,6 @@ headers = files(
   'port-info.h',
   'client-pool.h',
   'tstamp.h',
-  'event.h',
   'event-data-result.h',
   'event-data-note.h',
   'event-data-ctl.h',
index 5129374fe215846fca384a7c0a26ac756761de88..7ed2030dfeaca277245a74be1adec56e871adfc1 100644 (file)
@@ -11,7 +11,6 @@
 #include "client-info.h"
 #include "port-info.h"
 #include "client-pool.h"
-#include "event.h"
 #include "subscribe-data.h"
 #include "queue-info.h"
 #include "queue-status.h"
@@ -41,8 +40,6 @@ void seq_port_info_refer_private(ALSASeqPortInfo *self,
 void seq_client_pool_refer_private(ALSASeqClientPool *self,
                                    struct snd_seq_client_pool **pool);
 
-void seq_event_refer_private(ALSASeqEvent *self, struct snd_seq_event **ev);
-
 void seq_subscribe_data_refer_private(ALSASeqSubscribeData *self,
                                       struct snd_seq_port_subscribe **data);
 
index 298448ece21b8361e2ab4fd252d61189e994f8ef..e2ea8a85b6063fd082123b9565cf5b8ab913f382 100644 (file)
@@ -8,7 +8,6 @@
 #include <seq/client-info.h>
 #include <seq/port-info.h>
 #include <seq/client-pool.h>
-#include <seq/event.h>
 #include <seq/subscribe-data.h>
 #include <seq/queue-info.h>
 #include <seq/queue-tempo.h>
diff --git a/tests/alsaseq-event b/tests/alsaseq-event
deleted file mode 100644 (file)
index 986b05b..0000000
+++ /dev/null
@@ -1,28 +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.Event
-props = (
-    'type',
-    'timestamp-mode',
-    'time-mode',
-    'priority-mode',
-    'tag',
-    'queue-id',
-    'tstamp',
-    'src-addr',
-    'dst-addr',
-)
-methods = ()
-signals = ()
-
-if not test(target, props, methods, signals):
-    exit(ENXIO)
index 602e02eb56d422ba0c368a80219ebed4c66a3051..1a74b730ae6dfe9bf6e04e5798454a8f2755e893 100644 (file)
@@ -35,7 +35,6 @@ tests = {
     'alsaseq-user-client',
     'alsaseq-port-info',
     'alsaseq-client-pool',
-    'alsaseq-event',
     'alsaseq-subscribe-data',
     'alsaseq-queue-info',
     'alsaseq-queue-status',