Re: [Vala] canberra.vapi

Michael 'Mickey' Lauer wrote:
This binding is for libcanberra, a sound event library. 
See 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).


just mark them as out parameters, and the destroy() functions are free

 [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
 // ...

 [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
 // ...


 Canberra.Context c;
 Canberra.Context.create (out c);

Best Regards,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]