]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
timer: user_instance: add virtual method to handle event
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sun, 9 Feb 2020 03:20:53 +0000 (12:20 +0900)
committer坂本 貴史 <o-takashi@sakamocchi.jp>
Tue, 11 Feb 2020 04:28:18 +0000 (13:28 +0900)
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
src/timer/user-instance.c
src/timer/user-instance.h
tests/alsatimer-user-instance

index 0bbc947d9d6a14f6bd073d4f6bdc15fff3789195..6ec4ce5ecaf95db6f0bd4713910d06bc52bae386 100644 (file)
@@ -58,7 +58,7 @@ static void alsatimer_user_instance_class_init(ALSATimerUserInstanceClass *klass
         g_signal_new("handle-event",
                      G_OBJECT_CLASS_TYPE(klass),
                      G_SIGNAL_RUN_LAST,
-                     0,
+                     G_STRUCT_OFFSET(ALSATimerUserInstanceClass, handle_event),
                      NULL, NULL,
                      g_cclosure_marshal_VOID__OBJECT,
                      G_TYPE_NONE, 1, ALSATIMER_TYPE_EVENT_DATA);
index a4cc9bfc344d4b64f3f1a75b83bbc6f9c91f40c7..1448575107ae9499412291e9cd2309ef02fb1f47 100644 (file)
@@ -47,6 +47,16 @@ struct _ALSATimerUserInstance {
 
 struct _ALSATimerUserInstanceClass {
     GObjectClass parent_class;
+
+    /**
+     * ALSATimerUserInstanceClass::handle_event:
+     * @self: A #ALSATimerUserInstance.
+     * @event_data: (transfer none): An object derived from #ALSATimerEventData.
+     *
+     * When event occurs, this signal is emit.
+     */
+    void (*handle_event)(ALSATimerUserInstance *self,
+                         const ALSATimerEventData *event_data);
 };
 
 GType alsatimer_user_instance_get_type() G_GNUC_CONST;
index b369f53eb76cec3abf4be2b4ad7003b6a0169444..3140cea13b4ee0ebd887f937077529aca03f6842 100644 (file)
@@ -20,6 +20,7 @@ methods = (
     'set_params',
     'get_status',
     'create_source',
+    'do_handle_event',
 )
 signals = (
     'handle-event',