alsa-gobject: obsolete abstract class for `snd_timer_read` and `snd_timer_tread` structure
alsa-project/alsa-gobject pull request #31 was opened from takaswie:
In UAPI of Linux sound subsystem, two types of event is read from ALSA Timer character device; snd_timer_read and snd_timer_tread. Before attached to any timer device, an user instance can select which type of event is expected.
ALSATimer.UserInstance uses one GObject signal to handle these events. These events are defined as derived object from abstract class, ALSATimer.EventData. However, the design pattern is not convenient for some language bindings.
For example, in Rust language, class-based inheritance is not supported. Gtk-rs project produces mechanism to upcast/downcast between super/sub classes and handles GObject class system. In my opinion, the code to upcast/downcast is a bit complicated to handle derivatives.
This patchset obsoletes usage of abstract class for ALSATimer.EventData. Instead, ALSATimer.Event is defined as concrete class and the instance of class is passed to the GObject signal. Applications use APIs to pick up expected type of data from the instance.
Request URL : https://github.com/alsa-project/alsa-gobject/pull/31 Patch URL : https://github.com/alsa-project/alsa-gobject/pull/31.patch Repository URL: https://github.com/alsa-project/alsa-gobject
participants (1)
-
GitHub pull_request - opened