Re: API problem with the new GdkPixbufAnimation used with progressive loaders



> > > 2. Make the GTimeVals relative instead of absolute. The "time
> > > already elapsed" is passed to _get_iter, and the "time elapsed since
> > > last advance" is passed to _advance.
> >
> > I don't understand this I don't think.
> > 
> 
> If an application author wants to start the animation 0.5 seconds from the start, and play at double speed, he'd do this (g_timeout_add complications removed):
> 
> GTimeVal gtv = {0, 500000};
> iter = gdk_pixbuf_animation_get_iter (anim, &gtv);
> 
> while (1) {
> result = gdk_pixbuf_animation_iter_get_delay_time (iter);
> usleep (result * 1000 / 2);
> 
> gtv.usec = result * 1000;
> gdk_pixbuf_animation_iter_advance (iter, &gtv);
> }
> 
> This way, if the iterator has waited for the animation to load up, it can properly do what the app wants. It probably makes things easier on the app programmers too. I think this is the best option.

Oops, this screws frame skipping too.

What we really need is to get rid of the 2nd argument to _advance and have a function to set the animation playing speed instead. I imagine that would be much easier to work with for everyone. Would changing the api that way be acceptable?




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