]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
seq: event_variable: dismiss ALSASeqEventVariable
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/alsaseq.map
src/seq/event-variable.c [deleted file]
src/seq/event-variable.h [deleted file]
src/seq/meson.build
src/seq/user-client.h
tests/alsaseq-event-variable [deleted file]
tests/meson.build

index 8eaf22185e52d49d260800770c9f577c884519a2..deda322c8bc980c745af454468a56c361f9ab4f6 100644 (file)
@@ -43,7 +43,6 @@
         <xi:include href="xml/event-cntr.xml"/>
         <xi:include href="xml/event.xml"/>
         <xi:include href="xml/event-fixed.xml"/>
-        <xi:include href="xml/event-variable.xml"/>
         <xi:include href="xml/tstamp.xml"/>
         <xi:include href="xml/event-data-result.xml"/>
         <xi:include href="xml/event-data-note.xml"/>
index 03e29e9aed92fa5cfc51a7bc91915c296be93190..ed8beb6073f7c0ea77d993ba0e89ba31ed79da7f 100644 (file)
@@ -14,7 +14,6 @@ alsaseq_event_priority_mode_get_type
 alsaseq_event_time_mode_get_type
 alsaseq_event_timestamp_mode_get_type
 alsaseq_event_type_get_type
-alsaseq_event_variable_get_type
 alsaseq_filter_attr_flag_get_type
 alsaseq_port_attr_flag_get_type
 alsaseq_port_cap_flag_get_type
index b9dfa6830513734cd00b6d31ab86b5baa6247161..c16127b681241ca8b8986f4972b7b1d338843c56 100644 (file)
@@ -88,11 +88,6 @@ ALSA_GOBJECT_0_0_0 {
     "alsaseq_event_fixed_get_quadlet_data";
     "alsaseq_event_fixed_set_quadlet_data";
 
-    "alsaseq_event_variable_get_type";
-    "alsaseq_event_variable_new";
-    "alsaseq_event_variable_get_data";
-    "alsaseq_event_variable_set_data";
-
     "alsaseq_event_data_result_get_type";
     "alsaseq_event_data_result_get_event";
     "alsaseq_event_data_result_set_event";
diff --git a/src/seq/event-variable.c b/src/seq/event-variable.c
deleted file mode 100644 (file)
index e76b3aa..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-// SPDX-License-Identifier: LGPL-3.0-or-later
-#include "event-variable.h"
-#include "privates.h"
-
-#include <errno.h>
-
-/**
- * SECTION: event-variable
- * @Title: ALSASeqEventVariable
- * @Short_description: A GObject-derived object to represent event with the
- *                     various kind of variable-size data.
- *
- * A #ALSASeqEventVariable is a GObject-derived object to represent event with
- * the various kind of variable-size data. The object has accessor methods for
- * the variable-size data.
- * The object inherits properties and methods from #ALSASeqEvent.
- */
-struct _ALSASeqEventVariablePrivate {
-    void *data;
-};
-G_DEFINE_TYPE_WITH_PRIVATE(ALSASeqEventVariable, alsaseq_event_variable, ALSASEQ_TYPE_EVENT)
-
-static void seq_event_variable_finalize(GObject *obj)
-{
-    ALSASeqEventVariable *self = ALSASEQ_EVENT_VARIABLE(obj);
-    ALSASeqEventVariablePrivate *priv =
-                            alsaseq_event_variable_get_instance_private(self);
-
-    if (priv->data != NULL)
-        g_free(priv->data);
-
-    G_OBJECT_CLASS(alsaseq_event_variable_parent_class)->finalize(obj);
-}
-
-static void alsaseq_event_variable_class_init(ALSASeqEventVariableClass *klass)
-{
-    GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
-
-    gobject_class->finalize = seq_event_variable_finalize;
-}
-
-static void alsaseq_event_variable_init(ALSASeqEventVariable *self)
-{
-    ALSASeqEventVariablePrivate *priv =
-                            alsaseq_event_variable_get_instance_private(self);
-
-    priv->data = NULL;
-}
-
-/**
- * alsaseq_event_variable_new:
- * @event_type: A #ALSASeqEventType.
- * @error: A #GError.
- *
- * Allocate and return an instance of #ALSASeqEventVariable class.
- *
- * Returns: A #ALSASeqEventVariable.
- */
-ALSASeqEventVariable *alsaseq_event_variable_new(ALSASeqEventType event_type,
-                                                 GError **error)
-{
-    switch (event_type) {
-    case SNDRV_SEQ_EVENT_SYSEX:
-    case SNDRV_SEQ_EVENT_BOUNCE:
-    case SNDRV_SEQ_EVENT_USR_VAR0:
-    case SNDRV_SEQ_EVENT_USR_VAR1:
-    case SNDRV_SEQ_EVENT_USR_VAR2:
-    case SNDRV_SEQ_EVENT_USR_VAR3:
-    case SNDRV_SEQ_EVENT_USR_VAR4:
-        break;
-    default:
-        generate_error(error, EINVAL);
-        break;
-    }
-
-    return g_object_new(ALSASEQ_TYPE_EVENT_VARIABLE,
-                        "type", event_type,
-                        "length-mode", ALSASEQ_EVENT_LENGTH_MODE_VARIABLE,
-                        NULL);
-}
-
-/**
- * alsaseq_event_variable_get_data:
- * @self: A #ALSASeqEventVariable.
- * @data: (array length=size)(out)(transfer none): The pointer to external data.
- * @size: The size of data.
- *
- * Refer to the external data for the event.
- */
-void alsaseq_event_variable_get_data(ALSASeqEventVariable *self,
-                                     const guint8 **data, gsize *size)
-{
-    ALSASeqEvent *parent;
-    struct snd_seq_event *ev;
-
-    g_return_if_fail(ALSASEQ_IS_EVENT_VARIABLE(self));
-    parent = ALSASEQ_EVENT(self);
-    seq_event_refer_private(parent, &ev);
-
-    *data = ev->data.ext.ptr;
-    *size = ev->data.ext.len;
-}
-
-/**
- * alsaseq_event_variable_set_data:
- * @self: A #ALSASeqEventVariable.
- * @data: (array length=size)(transfer none): The pointer to external data.
- * @size: The size of data.
- *
- * Allocate and copy the external data for the event.
- */
-void alsaseq_event_variable_set_data(ALSASeqEventVariable *self,
-                                     const guint8 *data, gsize size)
-{
-    ALSASeqEventVariablePrivate *priv;
-    ALSASeqEvent *parent;
-    struct snd_seq_event *ev;
-
-    g_return_if_fail(ALSASEQ_IS_EVENT_VARIABLE(self));
-    priv = alsaseq_event_variable_get_instance_private(self);
-    parent = ALSASEQ_EVENT(self);
-    seq_event_refer_private(parent, &ev);
-
-    if (priv->data != NULL)
-        g_free(priv->data);
-    priv->data = NULL;
-    ev->data.ext.ptr = NULL;
-    ev->data.ext.len = 0;
-
-    priv->data = g_memdup(data, size);
-    if (priv->data == NULL)
-        return;
-
-    ev->data.ext.ptr = priv->data;
-    ev->data.ext.len = size;
-}
diff --git a/src/seq/event-variable.h b/src/seq/event-variable.h
deleted file mode 100644 (file)
index 169c26c..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-// SPDX-License-Identifier: LGPL-3.0-or-later
-#ifndef __ALSA_GOBJECT_ALSASEQ_EVENT_VARIABLE_H__
-#define __ALSA_GOBJECT_ALSASEQ_EVENT_VARIABLE_H__
-
-#include <glib.h>
-#include <glib-object.h>
-
-#include <seq/event.h>
-
-G_BEGIN_DECLS
-
-#define ALSASEQ_TYPE_EVENT_VARIABLE     (alsaseq_event_variable_get_type())
-
-#define ALSASEQ_EVENT_VARIABLE(obj)                             \
-    (G_TYPE_CHECK_INSTANCE_CAST((obj),                          \
-                                ALSASEQ_TYPE_EVENT_VARIABLE,    \
-                                ALSASeqEventVariable))
-#define ALSASEQ_IS_EVENT_VARIABLE(obj)                          \
-    (G_TYPE_CHECK_INSTANCE_TYPE((obj),                          \
-                                ALSASEQ_TYPE_EVENT_VARIABLE))
-
-#define ALSASEQ_EVENT_VARIABLE_CLASS(klass)                     \
-    (G_TYPE_CHECK_CLASS_CAST((klass),                           \
-                             ALSASEQ_TYPE_EVENT_VARIABLE,       \
-                             ALSASeqEventVariableClass))
-#define ALSASEQ_IS_EVENT_VARIABLE_CLASS(klass)                  \
-    (G_TYPE_CHECK_CLASS_TYPE((klass),                           \
-                             ALSASEQ_TYPE_EVENT_VARIABLE))
-#define ALSASEQ_EVENT_VARIABLE_GET_CLASS(obj)                   \
-    (G_TYPE_INSTANCE_GET_CLASS((obj),                           \
-                               ALSASEQ_TYPE_EVENT_VARIABLE,     \
-                               ALSASeqEventVariableClass))
-
-typedef struct _ALSASeqEventVariable        ALSASeqEventVariable;
-typedef struct _ALSASeqEventVariableClass   ALSASeqEventVariableClass;
-typedef struct _ALSASeqEventVariablePrivate ALSASeqEventVariablePrivate;
-
-struct _ALSASeqEventVariable {
-    ALSASeqEvent parent_instance;
-
-    ALSASeqEventVariablePrivate *priv;
-};
-
-struct _ALSASeqEventVariableClass {
-    ALSASeqEventClass parent_class;
-};
-
-GType alsaseq_event_variable_get_type() G_GNUC_CONST;
-
-ALSASeqEventVariable *alsaseq_event_variable_new(ALSASeqEventType event_type,
-                                                 GError **error);
-
-void alsaseq_event_variable_get_data(ALSASeqEventVariable *self,
-                                     const guint8 **data, gsize *size);
-void alsaseq_event_variable_set_data(ALSASeqEventVariable *self,
-                                     const guint8 *data, gsize size);
-G_END_DECLS
-
-#endif
index 03e2244f92416480ea5b5815ede426d001503ca7..75f3bf2973ca965e232f2a5c4b0fd07ae9c67b11 100644 (file)
@@ -19,7 +19,6 @@ sources = files(
   'tstamp.c',
   'event.c',
   'event-fixed.c',
-  'event-variable.c',
   'event-data-result.c',
   'event-data-note.c',
   'event-data-ctl.c',
@@ -46,7 +45,6 @@ headers = files(
   'tstamp.h',
   'event.h',
   'event-fixed.h',
-  'event-variable.h',
   'event-data-result.h',
   'event-data-note.h',
   'event-data-ctl.h',
index 82f69e9eee5b204006e5fcf67613faa720590f14..9f65a724eea57d67ac046a3ea30da0191226c6b0 100644 (file)
@@ -10,7 +10,6 @@
 #include <seq/client-pool.h>
 #include <seq/event.h>
 #include <seq/event-fixed.h>
-#include <seq/event-variable.h>
 #include <seq/subscribe-data.h>
 #include <seq/queue-info.h>
 #include <seq/queue-tempo.h>
diff --git a/tests/alsaseq-event-variable b/tests/alsaseq-event-variable
deleted file mode 100644 (file)
index 4ead81b..0000000
+++ /dev/null
@@ -1,23 +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.EventVariable()
-props = ()
-methods = (
-    'new',
-    'get_data',
-    'set_data',
-)
-signals = ()
-
-if not test(target, props, methods, signals):
-    exit(ENXIO)
-
index 12e5d7687df16eed4274bc1a07766bda7a4372fc..31df0147b769d33b5266659d4ff7ce7080d6df79 100644 (file)
@@ -37,7 +37,6 @@ tests = {
     'alsaseq-client-pool',
     'alsaseq-event',
     'alsaseq-event-fixed',
-    'alsaseq-event-variable',
     'alsaseq-subscribe-data',
     'alsaseq-queue-info',
     'alsaseq-queue-status',