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

Re: [Vala] Some basic problems with gstreamer



On Wed, April 23, 2008 15:47, Klaus Rotter wrote:
> Phil Housley wrote:
>> Vala will use the data argument of a callback registering function to
>> pass a "this" pointer, it's that which allows you to use an instance
>> method as a callback.  If you run valac with the --save-temps argument
>> you can see the C code that is produced, which is pretty useful for
>> checking if you know a C API as well.
>
> Hm... I think defining the callbacks inside the class (at least my way)
> isn't useful. I moved it outside (just like a global C function) and
> it worked better.
>
> Isn't there a way to define the callbacks inside my class?

Create a class where you can store your pipeline as a field, then move the
printPosition method to that class, as instance method without any
parameters. Then do something like Timeout.add (200, foo.printPosition);
where foo is an instance to the new class.

Juerg



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