]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
timer: tstamp-event: rename from event-data-tstamp topic/timer-signal-renames
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sun, 5 Jun 2022 03:39:24 +0000 (12:39 +0900)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sun, 5 Jun 2022 03:39:24 +0000 (12:39 +0900)
The name of EventDataTstamp is redundant.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
src/timer/alsatimer.h
src/timer/alsatimer.map
src/timer/event-data-tstamp.h [deleted file]
src/timer/meson.build
src/timer/tstamp-event.c [moved from src/timer/event-data-tstamp.c with 51% similarity]
src/timer/tstamp-event.h [new file with mode: 0644]
src/timer/user-instance.c
src/timer/user-instance.h

index ddee9663700e5cc9b611549329597185f47abcd1..68adfcc809cbd8aaff092f3a5e9c895fb5eb9f42 100644 (file)
@@ -11,7 +11,7 @@
 #include <alsatimer-enums.h>
 
 #include <tick-event.h>
-#include <event-data-tstamp.h>
+#include <tstamp-event.h>
 
 #include <device-id.h>
 #include <device-info.h>
index 19fb740bbc8f445816a631201c152b476a624d2a..ea16528093e1cf72e0bf1a11feb878407626efe3 100644 (file)
@@ -34,11 +34,6 @@ ALSA_GOBJECT_0_0_0 {
     "alsatimer_instance_status_get_type";
     "alsatimer_instance_status_new";
     "alsatimer_instance_status_get_tstamp";
-
-    "alsatimer_event_data_tstamp_get_type";
-    "alsatimer_event_data_tstamp_get_event";
-    "alsatimer_event_data_tstamp_get_tstamp";
-    "alsatimer_event_data_tstamp_get_val";
   local:
     *;
 };
@@ -77,4 +72,9 @@ ALSA_GOBJECT_0_3_0 {
     "alsatimer_tick_event_get_type";
     "alsatimer_tick_event_get_resolution";
     "alsatimer_tick_event_get_ticks";
+
+    "alsatimer_tstamp_event_get_type";
+    "alsatimer_tstamp_event_get_event";
+    "alsatimer_tstamp_event_get_tstamp";
+    "alsatimer_tstamp_event_get_val";
 } ALSA_GOBJECT_0_2_0;
diff --git a/src/timer/event-data-tstamp.h b/src/timer/event-data-tstamp.h
deleted file mode 100644 (file)
index d004a66..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// SPDX-License-Identifier: LGPL-3.0-or-later
-#ifndef __ALSA_GOBJECT_ALSATIMER_EVENT_DATA_TSTAMP_H__
-#define __ALSA_GOBJECT_ALSATIMER_EVENT_DATA_TSTAMP_H__
-
-#include <alsatimer.h>
-
-G_BEGIN_DECLS
-
-#define ALSATIMER_TYPE_EVENT_DATA_TSTAMP    (alsatimer_event_data_tstamp_get_type())
-
-typedef struct snd_timer_tread ALSATimerEventDataTstamp;
-
-GType alsatimer_event_data_tstamp_get_type() G_GNUC_CONST;
-
-void alsatimer_event_data_tstamp_get_event(const ALSATimerEventDataTstamp *self,
-                                           ALSATimerTstampEventType *event);
-
-void alsatimer_event_data_tstamp_get_tstamp(const ALSATimerEventDataTstamp *self,
-                                            gint64 *const tstamp[2]);
-
-void alsatimer_event_data_tstamp_get_val(const ALSATimerEventDataTstamp *self,
-                                         guint *val);
-
-G_END_DECLS
-
-#endif
index 5b8de7c3d197723ed5302464d2fcff2bc912b42e..4cb6c0cfb83dfc16958a1324bb2aad9770c22d5e 100644 (file)
@@ -19,7 +19,7 @@ sources = files(
   'instance-params.c',
   'instance-status.c',
   'tick-event.c',
-  'event-data-tstamp.c',
+  'tstamp-event.c',
 )
 
 headers = files(
@@ -33,7 +33,7 @@ headers = files(
   'instance-params.h',
   'instance-status.h',
   'tick-event.h',
-  'event-data-tstamp.h',
+  'tstamp-event.h',
 )
 
 privates = files(
similarity index 51%
rename from src/timer/event-data-tstamp.c
rename to src/timer/tstamp-event.c
index 80ceeaf757374a783bb476b18b1480b5e43d5cd4..5970210a182bd656c2fe5bc747f00eb3ee75d301 100644 (file)
@@ -2,14 +2,14 @@
 #include "privates.h"
 
 /**
- * ALSATimerEventDataTstamp:
+ * ALSATimerTstampEvent:
  * A boxed object to represent event of timer with tstamp.
  *
- * A [struct@EventDataTstamp] is a boxed object to represent event of timer with tstamp.
+ * A [struct@TstampEvent] is a boxed object to represent event of timer with tstamp.
  *
  * The object wraps `struct snd_timer_tread` in UAPI of Linux sound subsystem.
  */
-ALSATimerEventDataTstamp *timer_event_data_tstamp_copy(const ALSATimerEventDataTstamp *self)
+ALSATimerTstampEvent *timer_tstamp_event_copy(const ALSATimerTstampEvent *self)
 {
 #ifdef g_memdup2
     return g_memdup2(self, sizeof(*self));
@@ -22,45 +22,43 @@ ALSATimerEventDataTstamp *timer_event_data_tstamp_copy(const ALSATimerEventDataT
 #endif
 }
 
-G_DEFINE_BOXED_TYPE(ALSATimerEventDataTstamp, alsatimer_event_data_tstamp, timer_event_data_tstamp_copy, g_free)
+G_DEFINE_BOXED_TYPE(ALSATimerTstampEvent, alsatimer_tstamp_event, timer_tstamp_event_copy, g_free)
 
 /**
- * alsatimer_event_data_tstamp_get_event:
- * @self: A [struct@EventDataTstamp].
+ * alsatimer_tstamp_event_get_event:
+ * @self: A [struct@TstampEvent].
  * @event: (out): The type of tstamp event, one of [enum@TstampEventType].
  *
  * Get the kind of event for the timestamp event.
  */
-void alsatimer_event_data_tstamp_get_event(const ALSATimerEventDataTstamp *self,
-                                           ALSATimerTstampEventType *event)
+void alsatimer_tstamp_event_get_event(const ALSATimerTstampEvent *self,
+                                      ALSATimerTstampEventType *event)
 {
     *event = (ALSATimerTstampEventType)self->event;
 }
 
 /**
- * alsatimer_event_data_tstamp_get_tstamp:
- * @self: A [struct@EventDataTstamp].
- * @tstamp: (array fixed-size=2)(inout): The array with two elements for the seconds and
+ * alsatimer_tstamp_event_get_tstamp:
+ * @self: A [struct@TstampEvent].
+ * @tstamp: (array fixed-size=2) (inout): The array with two elements for the seconds and
  *          nanoseconds part of timestamp when the instance queues the timestamp event.
  *
  * Get the seconds and nanoseconds part for the timestamp event.
  */
-void alsatimer_event_data_tstamp_get_tstamp(const ALSATimerEventDataTstamp *self,
-                                            gint64 *const tstamp[2])
+void alsatimer_tstamp_event_get_tstamp(const ALSATimerTstampEvent *self, gint64 *const tstamp[2])
 {
     (*tstamp)[0] = (gint64)self->tstamp.tv_sec;
     (*tstamp)[1] = (gint64)self->tstamp.tv_nsec;
 }
 
 /**
- * alsatimer_event_data_tstamp_get_val:
- * @self: A [struct@EventDataTstamp].
+ * alsatimer_tstamp_event_get_val:
+ * @self: A [struct@TstampEvent].
  * @val: (out): The value depending on the type of timestamp event.
  *
  * Get the value depending on the type of timestamp event.
  */
-void alsatimer_event_data_tstamp_get_val(const ALSATimerEventDataTstamp *self,
-                                         guint *val)
+void alsatimer_tstamp_event_get_val(const ALSATimerTstampEvent *self, guint *val)
 {
     *val = self->val;
 }
diff --git a/src/timer/tstamp-event.h b/src/timer/tstamp-event.h
new file mode 100644 (file)
index 0000000..6957fbf
--- /dev/null
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: LGPL-3.0-or-later
+#ifndef __ALSA_GOBJECT_ALSATIMER_TSTAMP_EVENT_H__
+#define __ALSA_GOBJECT_ALSATIMER_TSTAMP_EVENT_H__
+
+#include <alsatimer.h>
+
+G_BEGIN_DECLS
+
+#define ALSATIMER_TYPE_TSTAMP_EVENT     (alsatimer_tstamp_event_get_type())
+
+typedef struct snd_timer_tread ALSATimerTstampEvent;
+
+GType alsatimer_tstamp_event_get_type() G_GNUC_CONST;
+
+void alsatimer_tstamp_event_get_event(const ALSATimerTstampEvent *self,
+                                      ALSATimerTstampEventType *event);
+
+void alsatimer_tstamp_event_get_tstamp(const ALSATimerTstampEvent *self, gint64 *const tstamp[2]);
+
+void alsatimer_tstamp_event_get_val(const ALSATimerTstampEvent *self, guint *val);
+
+G_END_DECLS
+
+#endif
index ba96c371741001e1de3109522c4acbb6e14c0ea9..4ce08df80992c2420636e124e3ad49c560b3b8c6 100644 (file)
@@ -103,7 +103,7 @@ static void alsatimer_user_instance_class_init(ALSATimerUserInstanceClass *klass
     /**
      * ALSATimerUserInstance::handle-tstamp-event:
      * @self: A [class@UserInstance].
-     * @event: (transfer none): The instance of [struct@EventDataTstamp].
+     * @event: (transfer none): The instance of [struct@TstampEvent].
      *
      * Emitted when timestamp event occurs.
      */
@@ -114,7 +114,7 @@ static void alsatimer_user_instance_class_init(ALSATimerUserInstanceClass *klass
                      G_STRUCT_OFFSET(ALSATimerUserInstanceClass, handle_tstamp_event),
                      NULL, NULL,
                      g_cclosure_marshal_VOID__BOXED,
-                     G_TYPE_NONE, 1, ALSATIMER_TYPE_EVENT_DATA_TSTAMP);
+                     G_TYPE_NONE, 1, ALSATIMER_TYPE_TSTAMP_EVENT);
 
     /**
      * ALSATimerUserInstance::handle-disconnection:
index 15fac4f34bbafe2540460dcad7cbbe7aae8335a0..6bd3fa78decb15cd907893b584c4e0c7a3940ae2 100644 (file)
@@ -30,11 +30,11 @@ struct _ALSATimerUserInstanceClass {
     /**
      * ALSATimerUserInstanceClass::handle_tstamp_event:
      * @self: A [class@UserInstance].
-     * @event: (transfer none): An object derived from [struct@EventDataTstamp].
+     * @event: (transfer none): An object derived from [struct@TstampEvent].
      *
      * Class closure for the [signal@UserInstance::handle-tstamp-event] signal.
      */
-    void (*handle_tstamp_event)(ALSATimerUserInstance *self, const ALSATimerEventDataTstamp *event);
+    void (*handle_tstamp_event)(ALSATimerUserInstance *self, const ALSATimerTstampEvent *event);
 
     /**
      * ALSATimerUserInstanceClass::handle_disconnection: