]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
seq: event_fixed: dismiss ALSASeqEventFixed
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>
14 files changed:
doc/reference/seq/alsaseq-docs.xml
doc/reference/seq/alsaseq.types
src/seq/alsaseq.map
src/seq/event-data-connect.c
src/seq/event-data-ctl.c
src/seq/event-data-note.c
src/seq/event-data-queue.c
src/seq/event-data-result.c
src/seq/event-fixed.c [deleted file]
src/seq/event-fixed.h [deleted file]
src/seq/meson.build
src/seq/user-client.h
tests/alsaseq-event-fixed [deleted file]
tests/meson.build

index deda322c8bc980c745af454468a56c361f9ab4f6..58ab9d49c35a7018cb70b92748d6fd715564abf7 100644 (file)
@@ -42,7 +42,6 @@
         <xi:include href="xml/subscribe-data.xml"/>
         <xi:include href="xml/event-cntr.xml"/>
         <xi:include href="xml/event.xml"/>
-        <xi:include href="xml/event-fixed.xml"/>
         <xi:include href="xml/tstamp.xml"/>
         <xi:include href="xml/event-data-result.xml"/>
         <xi:include href="xml/event-data-note.xml"/>
index ed8beb6073f7c0ea77d993ba0e89ba31ed79da7f..d1cac7acf465e0db17533e0c94be1db06a17ef76 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_fixed_get_type
 alsaseq_event_get_type
 alsaseq_event_length_mode_get_type
 alsaseq_event_priority_mode_get_type
index c16127b681241ca8b8986f4972b7b1d338843c56..9c3fbfd66b180e1101cd2a01e1a0e17769ec682f 100644 (file)
@@ -81,13 +81,6 @@ ALSA_GOBJECT_0_0_0 {
 
     "alsaseq_event_get_type";
 
-    "alsaseq_event_fixed_get_type";
-    "alsaseq_event_fixed_new";
-    "alsaseq_event_fixed_get_byte_data";
-    "alsaseq_event_fixed_set_byte_data";
-    "alsaseq_event_fixed_get_quadlet_data";
-    "alsaseq_event_fixed_set_quadlet_data";
-
     "alsaseq_event_data_result_get_type";
     "alsaseq_event_data_result_get_event";
     "alsaseq_event_data_result_set_event";
index 44e3b1e69fd77199d262208fc588ff52ff4a4696..1ec84570707d9059add1b9a7a689264c178cc59d 100644 (file)
@@ -7,8 +7,7 @@
  * @Short_description: A boxed object to represent data of connect event
  *
  * A #ALSASeqEventDataConnect is a boxed object to represent data of connect
- * event. The instance of object is one of data properties in
- * #ALSASeqEventFixed.
+ * event. The instance of object is one of data properties in event.
  *
  * The object wraps 'struct snd_seq_connect' in UAPI of Linux sound subsystem.
  */
index 266abf4b8717833d1af043066928690eb0c9e860..1cbbefa09d8d647ffaa54a66b335f6dd259f5289 100644 (file)
@@ -7,8 +7,7 @@
  * @Short_description: A boxed object to represent data of control event
  *
  * A #ALSASeqEventDataCtl is a boxed object to represent data of control
- * event. The instance of object is one of data properties in
- * #ALSASeqEventFixed.
+ * event. The instance of object is one of data properties in event.
  *
  * The object wraps 'struct snd_seq_ev_ctrl' in UAPI of Linux sound subsystem.
  */
index 37796388bee635cb2db633cc2a1ec3ce995e1edc..19cc517e4ab211c8b3e847ac4cf0ce85215c9142 100644 (file)
@@ -7,7 +7,7 @@
  * @Short_description: A boxed object to represent data of note event
  *
  * A #ALSASeqEventDataNote is a boxed object to represent data of note event.
- * The instance of object is one of data properties in #ALSASeqEventFixed.
+ * The instance of object is one of data properties in event.
  *
  * The object wraps 'struct snd_seq_ev_note' in UAPI of Linux sound subsystem.
  */
index 5dad16b6b0e67f7009b5ce17f3fe4473116dced0..5b5b4c0af44e528b71ec1bf4e5a7fe2a3e09fa43 100644 (file)
@@ -7,7 +7,7 @@
  * @Short_description: A boxed object to represent data of queue event
  *
  * A #ALSASeqEventDataQueue is a boxed object to represent data of queue event.
- * The instance of object is one of data properties in #ALSASeqEventFixed.
+ * The instance of object is one of data properties in event.
  *
  * The object wraps 'struct snd_seq_ev_queue_control' in UAPI of Linux sound
  * subsystem.
index 6cf376adb44aa4833ddf5ea959430a79ff8a7b50..fc118345d6af660347fa6bbede9e24308cedbdb7 100644 (file)
@@ -7,8 +7,7 @@
  * @Short_description: A boxed object to represent data of result event
  *
  * A #ALSASeqEventDataResult is a boxed object to represent data of result
- * event. The instance of object is one of data properties in
- * #ALSASeqEventFixed.
+ * event. The instance of object is one of data properties in event.
  *
  * The object wraps 'struct snd_seq_result' in UAPI of Linux sound subsystem.
  */
diff --git a/src/seq/event-fixed.c b/src/seq/event-fixed.c
deleted file mode 100644 (file)
index f5355b4..0000000
+++ /dev/null
@@ -1,308 +0,0 @@
-// SPDX-License-Identifier: LGPL-3.0-or-later
-#include "event-fixed.h"
-#include "privates.h"
-
-#include <errno.h>
-
-/**
- * SECTION: event-fixed
- * @Title: ALSASeqEventFixed
- * @Short_description: A GObject-derived object to represent event with the
- *                     various kind of fixed-size data.
- *
- * A #ALSASeqEventFixed is a GObject-derived object to represent event with the
- * various kind of fixed-size data. The object has several properties to access
- * to the data. The object inherits properties and methods from #ALSASeqEvent.
- */
-G_DEFINE_TYPE(ALSASeqEventFixed, alsaseq_event_fixed, ALSASEQ_TYPE_EVENT)
-
-enum seq_event_fixed_prop_type {
-    SEQ_EVENT_FIXED_PROP_RESULT_DATA = 1,
-    SEQ_EVENT_FIXED_PROP_NOTE_DATA,
-    SEQ_EVENT_FIXED_PROP_CTL_DATA,
-    SEQ_EVENT_FIXED_PROP_QUEUE_DATA,
-    SEQ_EVENT_FIXED_PROP_ADDR_DATA,
-    SEQ_EVENT_FIXED_PROP_CONNECT_DATA,
-    SEQ_EVENT_FIXED_PROP_TSTAMP_DATA,
-    SEQ_EVENT_FIXED_PROP_COUNT,
-};
-static GParamSpec *seq_event_fixed_props[SEQ_EVENT_FIXED_PROP_COUNT] = { NULL, };
-
-static void seq_event_fixed_set_property(GObject *obj, guint id,
-                                         const GValue *val, GParamSpec *spec)
-{
-    ALSASeqEvent *parent = ALSASEQ_EVENT(obj);
-    struct snd_seq_event *ev;
-    seq_event_refer_private(parent, &ev);
-
-    switch (id) {
-    case SEQ_EVENT_FIXED_PROP_RESULT_DATA:
-    {
-        ALSASeqEventDataResult *data = g_value_get_boxed(val);
-        if (data != NULL)
-            ev->data.result = *data;
-        break;
-    }
-    case SEQ_EVENT_FIXED_PROP_NOTE_DATA:
-    {
-        ALSASeqEventDataNote *data = g_value_get_boxed(val);
-        if (data != NULL)
-            ev->data.note = *data;
-        break;
-    }
-    case SEQ_EVENT_FIXED_PROP_CTL_DATA:
-    {
-        ALSASeqEventDataCtl *data = g_value_get_boxed(val);
-        if (data != NULL)
-            ev->data.control = *data;
-        break;
-    }
-    case SEQ_EVENT_FIXED_PROP_QUEUE_DATA:
-    {
-        ALSASeqEventDataQueue *data = g_value_get_boxed(val);
-        if (data != NULL)
-            ev->data.queue = *data;
-        break;
-    }
-    case SEQ_EVENT_FIXED_PROP_ADDR_DATA:
-    {
-        ALSASeqAddr *data = g_value_get_boxed(val);
-        if (data != NULL)
-            ev->data.addr = *data;
-        break;
-    }
-    case SEQ_EVENT_FIXED_PROP_CONNECT_DATA:
-    {
-        ALSASeqEventDataConnect *data = g_value_get_boxed(val);
-        if (data != NULL)
-            ev->data.connect = *data;
-        break;
-    }
-    case SEQ_EVENT_FIXED_PROP_TSTAMP_DATA:
-    {
-        ALSASeqTstamp *data = g_value_get_boxed(val);
-        if (data != NULL)
-            ev->data.time = *data;
-        break;
-    }
-    default:
-        G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, id, spec);
-        break;
-    }
-}
-
-static void seq_event_fixed_get_property(GObject *obj, guint id, GValue *val,
-                                         GParamSpec *spec)
-{
-    ALSASeqEvent *parent = ALSASEQ_EVENT(obj);
-    struct snd_seq_event *ev;
-    seq_event_refer_private(parent, &ev);
-
-    switch (id) {
-    case SEQ_EVENT_FIXED_PROP_RESULT_DATA:
-        g_value_set_static_boxed(val, &ev->data.result);
-        break;
-    case SEQ_EVENT_FIXED_PROP_NOTE_DATA:
-        g_value_set_static_boxed(val, &ev->data.note);
-        break;
-    case SEQ_EVENT_FIXED_PROP_CTL_DATA:
-        g_value_set_static_boxed(val, &ev->data.control);
-        break;
-    case SEQ_EVENT_FIXED_PROP_QUEUE_DATA:
-        g_value_set_static_boxed(val, &ev->data.queue);
-        break;
-    case SEQ_EVENT_FIXED_PROP_ADDR_DATA:
-        g_value_set_static_boxed(val, &ev->data.addr);
-        break;
-    case SEQ_EVENT_FIXED_PROP_CONNECT_DATA:
-        g_value_set_static_boxed(val, &ev->data.connect);
-        break;
-    case SEQ_EVENT_FIXED_PROP_TSTAMP_DATA:
-        g_value_set_static_boxed(val, &ev->data.time);
-        break;
-    default:
-        G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, id, spec);
-        break;
-    }
-}
-
-static void alsaseq_event_fixed_class_init(ALSASeqEventFixedClass *klass)
-{
-    GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
-
-    gobject_class->set_property = seq_event_fixed_set_property;
-    gobject_class->get_property = seq_event_fixed_get_property;
-
-    seq_event_fixed_props[SEQ_EVENT_FIXED_PROP_RESULT_DATA] =
-        g_param_spec_boxed("result-data", "result-data",
-                           "The data of result type. This shares the same "
-                           "storage between the other properties",
-                           ALSASEQ_TYPE_EVENT_DATA_RESULT,
-                           G_PARAM_READWRITE);
-
-    seq_event_fixed_props[SEQ_EVENT_FIXED_PROP_NOTE_DATA] =
-        g_param_spec_boxed("note-data", "note-data",
-                           "The data of note type. This shares the same "
-                           "storage between the other properties",
-                           ALSASEQ_TYPE_EVENT_DATA_NOTE,
-                           G_PARAM_READWRITE);
-
-    seq_event_fixed_props[SEQ_EVENT_FIXED_PROP_CTL_DATA] =
-        g_param_spec_boxed("ctl-data", "ctl-data",
-                           "The data of ctl type. This shares the same "
-                           "storage between the other properties",
-                           ALSASEQ_TYPE_EVENT_DATA_CTL,
-                           G_PARAM_READWRITE);
-
-    seq_event_fixed_props[SEQ_EVENT_FIXED_PROP_QUEUE_DATA] =
-        g_param_spec_boxed("queue-data", "queue-data",
-                           "The data of queue type. This shares the same "
-                           "storage between the other properties",
-                           ALSASEQ_TYPE_EVENT_DATA_QUEUE,
-                           G_PARAM_READWRITE);
-
-    seq_event_fixed_props[SEQ_EVENT_FIXED_PROP_ADDR_DATA] =
-        g_param_spec_boxed("addr-data", "addr-data",
-                           "The data of addr type. This shares the same "
-                           "storage between the other properties",
-                           ALSASEQ_TYPE_ADDR,
-                           G_PARAM_READWRITE);
-
-    seq_event_fixed_props[SEQ_EVENT_FIXED_PROP_CONNECT_DATA] =
-        g_param_spec_boxed("connect-data", "connect-data",
-                           "The data of connect type. This shares the same "
-                           "storage between the other properties",
-                           ALSASEQ_TYPE_EVENT_DATA_CONNECT,
-                           G_PARAM_READWRITE);
-
-    seq_event_fixed_props[SEQ_EVENT_FIXED_PROP_TSTAMP_DATA] =
-        g_param_spec_boxed("tstamp-data", "tstamp-data",
-                           "The data of timestamp type. This shares the same "
-                           "storage between the other properties",
-                           ALSASEQ_TYPE_TSTAMP,
-                           G_PARAM_READWRITE);
-
-    g_object_class_install_properties(gobject_class,
-                                      SEQ_EVENT_FIXED_PROP_COUNT,
-                                      seq_event_fixed_props);
-}
-
-static void alsaseq_event_fixed_init(ALSASeqEventFixed *self)
-{
-    return;
-}
-
-/**
- * alsaseq_event_fixed_new:
- * @event_type: A #ALSASeqEventType.
- * @error: A #GError.
- *
- * Allocate and returns an instance of #ALSASeqEventFixed class.
- *
- * Returns: A #ALSASeqEventFixed.
- */
-ALSASeqEventFixed *alsaseq_event_fixed_new(ALSASeqEventType event_type,
-                                           GError **error)
-{
-    switch (event_type) {
-    case ALSASEQ_EVENT_TYPE_BOUNCE:
-    case ALSASEQ_EVENT_TYPE_USR_VAR0:
-    case ALSASEQ_EVENT_TYPE_USR_VAR1:
-    case ALSASEQ_EVENT_TYPE_USR_VAR2:
-    case ALSASEQ_EVENT_TYPE_USR_VAR3:
-    case ALSASEQ_EVENT_TYPE_USR_VAR4:
-        generate_error(error, EINVAL);
-        return NULL;
-    default:
-       break;
-    }
-
-    return g_object_new(ALSASEQ_TYPE_EVENT_FIXED,
-                        "type", event_type,
-                        "length-mode", ALSASEQ_EVENT_LENGTH_MODE_FIXED,
-                        NULL);
-}
-
-/**
- * alsaseq_event_fixed_get_byte_data:
- * @self: A #ALSASeqEventFixed.
- * @bytes: (array fixed-size=12)(out)(transfer none): The array with twelve
- *         elements for byte data of the event.
- *
- * Refer to the twelve bytes as the data of event.
- */
-void alsaseq_event_fixed_get_byte_data(ALSASeqEventFixed *self,
-                                       const guint8 *bytes[12])
-{
-    ALSASeqEvent *parent;
-    struct snd_seq_event *ev;
-
-    g_return_if_fail(ALSASEQ_IS_EVENT_FIXED(self));
-    parent = ALSASEQ_EVENT(self);
-    seq_event_refer_private(parent, &ev);
-
-    *bytes = ev->data.raw8.d;
-}
-
-/**
- * alsaseq_event_fixed_set_byte_data:
- * @self: A #ALSASeqEventFixed.
- * @bytes: (array fixed-size=12)(transfer none): The array with twelve elements
- *         for byte data of the event.
- *
- * Copy the twelve bytes from the given buffer as the data of event.
- */
-void alsaseq_event_fixed_set_byte_data(ALSASeqEventFixed *self,
-                                       const guint8 bytes[12])
-{
-    ALSASeqEvent *parent;
-    struct snd_seq_event *ev;
-
-    g_return_if_fail(ALSASEQ_IS_EVENT_FIXED(self));
-    parent = ALSASEQ_EVENT(self);
-    seq_event_refer_private(parent, &ev);
-
-    memcpy(ev->data.raw8.d, bytes, sizeof(ev->data.raw8.d));
-}
-
-/**
- * alsaseq_event_fixed_get_quadlet_data:
- * @self: A #ALSASeqEventFixed.
- * @quadlets: (array fixed-size=3)(out)(transfer none): The array with three
- *            elements for quadlets as the data of event.
- *
- * Refer to three quadlet as the data of event.
- */
-void alsaseq_event_fixed_get_quadlet_data(ALSASeqEventFixed *self,
-                                          const guint32 *quadlets[3])
-{
-    ALSASeqEvent *parent;
-    struct snd_seq_event *ev;
-
-    g_return_if_fail(ALSASEQ_IS_EVENT_FIXED(self));
-    parent = ALSASEQ_EVENT(self);
-    seq_event_refer_private(parent, &ev);
-
-    *quadlets = ev->data.raw32.d;
-}
-
-/**
- * alsaseq_event_fixed_set_quadlet_data:
- * @self: A #ALSASeqEventFixed.
- * @quadlets: (array fixed-size=3)(transfer none): The array with three elements
- *            for quadlets for the data of event.
- *
- * Copy three quadlets from the given buffer as the data of event.
- */
-void alsaseq_event_fixed_set_quadlet_data(ALSASeqEventFixed *self,
-                                          const guint32 quadlets[3])
-{
-    ALSASeqEvent *parent;
-    struct snd_seq_event *ev;
-
-    g_return_if_fail(ALSASEQ_IS_EVENT_FIXED(self));
-    parent = ALSASEQ_EVENT(self);
-    seq_event_refer_private(parent, &ev);
-
-    memcpy(ev->data.raw32.d, quadlets, sizeof(ev->data.raw32.d));
-}
diff --git a/src/seq/event-fixed.h b/src/seq/event-fixed.h
deleted file mode 100644 (file)
index 63809a3..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-// SPDX-License-Identifier: LGPL-3.0-or-later
-#ifndef __ALSA_GOBJECT_ALSASEQ_EVENT_FIXED_H__
-#define __ALSA_GOBJECT_ALSASEQ_EVENT_FIXED_H__
-
-#include <glib.h>
-#include <glib-object.h>
-
-#include <seq/event.h>
-#include <seq/event-data-result.h>
-#include <seq/event-data-note.h>
-#include <seq/event-data-ctl.h>
-#include <seq/event-data-queue.h>
-#include <seq/event-data-connect.h>
-
-G_BEGIN_DECLS
-
-#define ALSASEQ_TYPE_EVENT_FIXED    (alsaseq_event_fixed_get_type())
-
-#define ALSASEQ_EVENT_FIXED(obj)                            \
-    (G_TYPE_CHECK_INSTANCE_CAST((obj),                      \
-                                ALSASEQ_TYPE_EVENT_FIXED,   \
-                                ALSASeqEventFixed))
-#define ALSASEQ_IS_EVENT_FIXED(obj)                         \
-    (G_TYPE_CHECK_INSTANCE_TYPE((obj),                      \
-                                ALSASEQ_TYPE_EVENT_FIXED))
-
-#define ALSASEQ_EVENT_FIXED_CLASS(klass)                    \
-    (G_TYPE_CHECK_CLASS_CAST((klass),                       \
-                             ALSASEQ_TYPE_EVENT_FIXED,      \
-                             ALSASeqEventFixedClass))
-#define ALSASEQ_IS_EVENT_FIXED_CLASS(klass)                 \
-    (G_TYPE_CHECK_CLASS_TYPE((klass),                       \
-                             ALSASEQ_TYPE_EVENT_FIXED))
-#define ALSASEQ_EVENT_FIXED_GET_CLASS(obj)                  \
-    (G_TYPE_INSTANCE_GET_CLASS((obj),                       \
-                               ALSASEQ_TYPE_EVENT_FIXED,    \
-                               ALSASeqEventFixedClass))
-
-typedef struct _ALSASeqEventFixed           ALSASeqEventFixed;
-typedef struct _ALSASeqEventFixedClass      ALSASeqEventFixedClass;
-
-struct _ALSASeqEventFixed {
-    ALSASeqEvent parent_instance;
-};
-
-struct _ALSASeqEventFixedClass {
-    ALSASeqEventClass parent_class;
-};
-
-GType alsaseq_event_fixed_get_type() G_GNUC_CONST;
-
-ALSASeqEventFixed *alsaseq_event_fixed_new(ALSASeqEventType event_type,
-                                           GError **error);
-
-void alsaseq_event_fixed_get_byte_data(ALSASeqEventFixed *self,
-                                       const guint8 *bytes[12]);
-void alsaseq_event_fixed_set_byte_data(ALSASeqEventFixed *self,
-                                       const guint8 bytes[12]);
-
-void alsaseq_event_fixed_get_quadlet_data(ALSASeqEventFixed *self,
-                                          const guint32 *quadlets[3]);
-void alsaseq_event_fixed_set_quadlet_data(ALSASeqEventFixed *self,
-                                          const guint32 quadlets[3]);
-
-G_END_DECLS
-
-#endif
index 75f3bf2973ca965e232f2a5c4b0fd07ae9c67b11..25f3f73f024404e8b0d96fa598ec1779237bba5a 100644 (file)
@@ -18,7 +18,6 @@ sources = files(
   'client-pool.c',
   'tstamp.c',
   'event.c',
-  'event-fixed.c',
   'event-data-result.c',
   'event-data-note.c',
   'event-data-ctl.c',
@@ -44,7 +43,6 @@ headers = files(
   'client-pool.h',
   'tstamp.h',
   'event.h',
-  'event-fixed.h',
   'event-data-result.h',
   'event-data-note.h',
   'event-data-ctl.h',
index 9f65a724eea57d67ac046a3ea30da0191226c6b0..298448ece21b8361e2ab4fd252d61189e994f8ef 100644 (file)
@@ -9,7 +9,6 @@
 #include <seq/port-info.h>
 #include <seq/client-pool.h>
 #include <seq/event.h>
-#include <seq/event-fixed.h>
 #include <seq/subscribe-data.h>
 #include <seq/queue-info.h>
 #include <seq/queue-tempo.h>
diff --git a/tests/alsaseq-event-fixed b/tests/alsaseq-event-fixed
deleted file mode 100644 (file)
index 6d24bc2..0000000
+++ /dev/null
@@ -1,33 +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.EventFixed()
-props = (
-    'result-data',
-    'note-data',
-    'ctl-data',
-    'queue-data',
-    'addr-data',
-    'connect-data',
-    'tstamp-data',
-)
-methods = (
-    'new',
-    'get_byte_data',
-    'set_byte_data',
-    'get_quadlet_data',
-    'set_quadlet_data',
-)
-signals = ()
-
-if not test(target, props, methods, signals):
-    exit(ENXIO)
-
index 31df0147b769d33b5266659d4ff7ce7080d6df79..602e02eb56d422ba0c368a80219ebed4c66a3051 100644 (file)
@@ -36,7 +36,6 @@ tests = {
     'alsaseq-port-info',
     'alsaseq-client-pool',
     'alsaseq-event',
-    'alsaseq-event-fixed',
     'alsaseq-subscribe-data',
     'alsaseq-queue-info',
     'alsaseq-queue-status',