From: Takashi Sakamoto Date: Sun, 5 Jun 2022 03:39:24 +0000 (+0900) Subject: timer: tstamp-event: rename from event-data-tstamp X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=0adf6b35ce9abd3a5b28adc8a1e6145c73baf7fe;p=alsa-gobject.git timer: tstamp-event: rename from event-data-tstamp The name of EventDataTstamp is redundant. Signed-off-by: Takashi Sakamoto --- diff --git a/src/timer/alsatimer.h b/src/timer/alsatimer.h index ddee966..68adfcc 100644 --- a/src/timer/alsatimer.h +++ b/src/timer/alsatimer.h @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include diff --git a/src/timer/alsatimer.map b/src/timer/alsatimer.map index 19fb740..ea16528 100644 --- a/src/timer/alsatimer.map +++ b/src/timer/alsatimer.map @@ -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 index d004a66..0000000 --- a/src/timer/event-data-tstamp.h +++ /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 - -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 diff --git a/src/timer/meson.build b/src/timer/meson.build index 5b8de7c..4cb6c0c 100644 --- a/src/timer/meson.build +++ b/src/timer/meson.build @@ -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( diff --git a/src/timer/event-data-tstamp.c b/src/timer/tstamp-event.c similarity index 51% rename from src/timer/event-data-tstamp.c rename to src/timer/tstamp-event.c index 80ceeaf..5970210 100644 --- a/src/timer/event-data-tstamp.c +++ b/src/timer/tstamp-event.c @@ -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 index 0000000..6957fbf --- /dev/null +++ b/src/timer/tstamp-event.h @@ -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 + +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 diff --git a/src/timer/user-instance.c b/src/timer/user-instance.c index ba96c37..4ce08df 100644 --- a/src/timer/user-instance.c +++ b/src/timer/user-instance.c @@ -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: diff --git a/src/timer/user-instance.h b/src/timer/user-instance.h index 15fac4f..6bd3fa7 100644 --- a/src/timer/user-instance.h +++ b/src/timer/user-instance.h @@ -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: