GNOME Bugzilla – Bug 576777
Bindings for Jack Audio Connection Kit
Last modified: 2018-05-22 13:19:37 UTC
I am adding this bug request to submit the work I've done on the jack bindings. Unfortunately automatic generation creates unfriendly c-style bindings, and I couldn't find a way to fix that with metadata alone. Therefore, these bindings were written by hand.
Created attachment 131386 [details] bindings for jack
Thanks for the bindings. Can you please update the patch with an appropriate copyright/license header?
Created attachment 132357 [details] bindings for jack Added copyright header Fixed return types of some methods
Created attachment 164702 [details] updated bindings added array_length=false where needed; fixed some more memory-related bugs
Created attachment 164924 [details] updated bindings Harry Van Haaren removed compiler warnings (replaced weak with unowned, etc.).
Thanks for the bindings. They look pretty good, but I did notice a few issues which I would like to resolve before distributing them with Vala: There are a number of issues with spacing, but that's not really a big deal... I also notice that several enums use CamelCase instead of uppercase with underscores. I think it would be better to convert to the Vala style (will require CCode cname attributes). GThread* is not the same as pthread_t, but AFAIK pthread_t is not currently bound. Either the pthread API needs to be bound so you can use pthread_t or those methods need to be removed. You should use uint8[] for binary data, not char[]. RingBuffer.buf has [CCode (array_length = false)]. I'm not familiar with the jack API, but wouldn't it be appropriate to use one of those other fields (e.g., size)? The annotation for that would be [CCode (array_length_cname = "size", array_length_type = "size_t")]. Several functions which do not return arrays, but have an array argument, have a [CCode (array_length = false)] on the method... You probably want to put them on the argument instead. I believe Position.padding should be a fixed-length array (of length 7). The sytax for that is public int32 padding[7];
According to someone from IRC, RingBuffer also requires a [CCode (cheader_filename = "jack/ringbuffer.h")]
Created attachment 173937 [details] updated bindings
This new version of the bindings addresses all the issues mentioned in the two comments above. Note that, because the application I wrote the binding for is currently undergoing heavy refactoring, I was not able to test this new version (apart from being able to compile it). Also, most spacing issues should be fixed now. One question about twp functions in jack/midiport.h: jack_midi_data_t* jack_midi_event_reserve (void *port_buffer, jack_nframes_t time, size_t data_size); int jack_midi_event_write (void *port_buffer, jack_nframes_t time, const jack_midi_data_t *data, size_t data_size); I am passing "data" as a pointer, do you think is there a way to pass it as an array instead? (See lines 285-286 in jack.vapi).
What's the status of jack.vapi? Is it ready for inclusion now?
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/29.