Re: [Vala] canberra.vapi
- From: Frederik <scumm_fredo gmx net>
- To: vala-list <vala-list gnome org>
- Subject: Re: [Vala] canberra.vapi
- Date: Fri, 10 Jul 2009 19:07:03 +0200
Michael 'Mickey' Lauer wrote:
This binding is for libcanberra, a sound event library.
Seehttp://0pointer.de/lennart/projects/libcanberra/ for more information.
The bindings should be relatively straightforward, the only thing I'm not
satisfied with is the way of creating a canberra context and proplist: Since
libcanberra has no way to return a newly constructed handle, I had to bind
this as reference. Therefore right now you have to use it like that:
Canberra.Proplist p = null;
Canberra.Proplist.create( &p );
(which I find a bit ugly).
Hi,
just mark them as out parameters, and the destroy() functions are free
functions:
[Compact]
[CCode (cname = "ca_proplist", free_function = "ca_proplist_destroy")]
public class Proplist {
public static int create( out Proplist p );
// public Error destroy(); // not needed anymore
// ...
}
[Compact]
[CCode (cname = "ca_context", free_function = "ca_context_destroy")]
public class Context {
public static Error create( out Context context );
// public Error destroy(); // not needed anymore
// ...
}
Usage:
Canberra.Context c;
Canberra.Context.create (out c);
Best Regards,
Frederik
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]