All of lore.kernel.org
 help / color / mirror / Atom feed
* [alsa-devel] Restart alsa-gi project as alsa-gobject project
@ 2019-12-01  8:04 Takashi Sakamoto
  2019-12-04  0:33 ` Takashi Sakamoto
  2019-12-13 11:17 ` Jaroslav Kysela
  0 siblings, 2 replies; 10+ messages in thread
From: Takashi Sakamoto @ 2019-12-01  8:04 UTC (permalink / raw)
  To: perex; +Cc: alsa-devel

Hi Jaroslav,

Since Audio Mini Conference 2018, I continued to work for alsa-gi[1] in
my local to integrate toward better I/O libraries. However I realized
that its basic design includes some disadvantages to produce useful APIs.

I rethink the design and realize it better to wrap each of structures
in <sound/asound.h> simply. Then, I restart it as alsa-gobject[2].
At present, master branch includes a library, `libalsactl0` for the
most of I/O features in ALSA control interface, which is compatible with
GObject mechanism and GObject introspection.

Jaroslav, would you please delete the alsa-gi repository and fork
the master branch from my alsa-gobject repository, then apply enough
configurations to the new repository?


My repository includes four branches as well for ALSA
hwdep/rawmidi/timer/seq interfaces. The most of features in each
interface is already available via included libraries but under heavy
development.

I already start to test them with Python 3 (PyGObject) and they seem
work well. I also test them with Rust bindings generated by gtk-rs/gir[3]
tool. Near future I also publish Rust crates for further convenience.


For your interests, this Python 3 script is a sample to listen one
event from ALSA control character device. This simple program is not
terminated voluntarily or by sending UNIX signal, thus please generate
control event by alsamixer or amixer:

```
#!/usr/bin/env python3

import gi
gi.require_version('GLib', '2.0')
gi.require_version('ALSACtl', '0.0')
from gi.repository import GLib, ALSACtl

class MyCard(ALSACtl.Card):
    def __init__(self, card_id, ctx, dispatcher):
        super().__init__()
        self.open(card_id)

        self.create_source().attach(ctx)

        self.__dispatcher = dispatcher

    def do_handle_disconnection(self):
        self.__dispatcher.quit()

    def do_handle_elem_event(self, elem_id, events):
        # Print the first event and quit event loop.
        print(elem_id.get_iface().value_nick,
              elem_id.get_device_id(), elem_id.get_subdevice_id(),
              elem_id.get_name(), elem_id.get_index(),
              events.value_nicks)
        self.__dispatcher.quit()


ctx = GLib.MainContext.new()
dispatcher = GLib.MainLoop.new(ctx, False)
card = MyCard(0, ctx, dispatcher)

dispatcher.run()
```

[1] https://github.com/alsa-project/alsa-gi
[2] https://github.com/takaswie/alsa-gobject
[3] https://github.com/gtk-rs/gir


Regards

Takashi Sakamoto
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-12-28  4:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-01  8:04 [alsa-devel] Restart alsa-gi project as alsa-gobject project Takashi Sakamoto
2019-12-04  0:33 ` Takashi Sakamoto
2019-12-04  9:10   ` Jaroslav Kysela
2019-12-04 13:34     ` Takashi Sakamoto
2019-12-13 11:17 ` Jaroslav Kysela
2019-12-14 16:52   ` Takashi Sakamoto
2019-12-18 19:20     ` Jaroslav Kysela
2019-12-22  8:04       ` Takashi Sakamoto
2019-12-25 11:11         ` Jaroslav Kysela
2019-12-28  4:30           ` Takashi Sakamoto

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.