alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* alsa-gobject: seq: tstamp: use wrapper structure instead of union
       [not found] <1586762099508881092-webhooks-bot@alsa-project.org>
@ 2020-04-13  7:15 ` GitHub pull_request - opened
  0 siblings, 0 replies; only message in thread
From: GitHub pull_request - opened @ 2020-04-13  7:15 UTC (permalink / raw)
  To: alsa-devel

alsa-project/alsa-gobject pull request #17 was opened from takaswie:

In UAPI for ALSA Sequencer, snd_seq_timestamp is union with
snd_seq_tick_time_t and struct snd_seq_real_time types. The
libalsaseq has GLib Boxed object for the union, named as
ALSASeqTstamp.

```
$ cat build/src/seq/ALSASeq-0.0.gir
    ...
    <union name="Tstamp"
           c:type="ALSASeqTstamp"
           glib:type-name="ALSASeqTstamp"
           glib:get-type="alsaseq_tstamp_get_type"
           c:symbol-prefix="tstamp">
      <source-position filename="../src/seq/tstamp.h" line="14"/>
      ...
    </union>
    ...
```

Although this is valid in a view of GObject
Introspection, it's not necessarily convenient to language
bindings because some programming language doesn't support
union type. In this case, the type is not available.

This commit adds an alternative structure to wrap the union.
As a result, ALSASeqTstamp is GLib Boxed object for the
wrapper structure.

```
$ cat build/src/seq/ALSASeq-0.0.gir
    ...
    <record name="Tstamp"
            c:type="ALSASeqTstamp"
            glib:type-name="ALSASeqTstamp"
            glib:get-type="alsaseq_tstamp_get_type"
            c:symbol-prefix="tstamp">
      <source-position filename="../src/seq/tstamp.h" line="18"/>
      <field name="tstamp" writable="1">
        <type name="gpointer" c:type="snd_seq_timestamp"/>
      </field>
      ...
    </record>
    ...
```

Request URL   : https://github.com/alsa-project/alsa-gobject/pull/17
Patch URL     : https://github.com/alsa-project/alsa-gobject/pull/17.patch
Repository URL: https://github.com/alsa-project/alsa-gobject

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-13  7:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1586762099508881092-webhooks-bot@alsa-project.org>
2020-04-13  7:15 ` alsa-gobject: seq: tstamp: use wrapper structure instead of union GitHub pull_request - opened

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).