]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
timer: user_instance: add class virtual method to handle disconnection of the attache...
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 8e6e845869018e5cb984c1e2aa2d56d07fed7e10..6a0da62713e1d1a54a8963c552d3865d21c56abd 100644 (file)
@@ -79,7 +79,7 @@ static void alsatimer_user_instance_class_init(ALSATimerUserInstanceClass *klass
         g_signal_new("handle-disconnection",
                      G_OBJECT_CLASS_TYPE(klass),
                      G_SIGNAL_RUN_LAST,
-                     0,
+                     G_STRUCT_OFFSET(ALSATimerUserInstanceClass, handle_disconnection),
                      NULL, NULL,
                      g_cclosure_marshal_VOID__VOID,
                      G_TYPE_NONE, 0, G_TYPE_NONE, 0);
index 5d83933624f607165388edb193eaed848a792876..c271084b7f40fa9d93784fa7965a25236d1a6ed1 100644 (file)
@@ -57,6 +57,17 @@ struct _ALSATimerUserInstanceClass {
      */
     void (*handle_event)(ALSATimerUserInstance *self,
                          const ALSATimerEventData *event_data);
+
+    /**
+     * ALSATimerUserInstanceClass::handle_disconnection:
+     * @self: A #ALSATimerUserInstance.
+     *
+     * When the attached timer device is not available anymore due to unbinding
+     * driver or hot unplugging, this signal is emit. The owner of this object
+     * should call g_object_free() as quickly as possible to release ALSA timer
+     * character device.
+     */
+    void (*handle_disconnection)(ALSATimerUserInstance *self);
 };
 
 GType alsatimer_user_instance_get_type() G_GNUC_CONST;
index f74fa21aed223c35dbe58832225d6670d1eedd08..83df59dfa5232e5757f952a769017b0fe3561320 100644 (file)
@@ -21,6 +21,7 @@ methods = (
     'get_status',
     'create_source',
     'do_handle_event',
+    'do_handle_disconnection',
 )
 signals = (
     'handle-event',