[vlc-devel] commit: stats-change variable for statistics/ removing stats timer from qt4 interface (Ilkka Ollakka )

Pierre d'Herbemont pdherbemont at free.fr
Mon Oct 13 14:49:56 CEST 2008

On Mon, Oct 13, 2008 at 9:42 AM, Laurent Aimar <fenrir at via.ecp.fr> wrote:
> Current vlc event is not really usable and should be redisigned before
> using it elsewhere.

Actually it superset variables, so I don't see why it is not usable.

>> Yet, variables shouldn't be used in that case and we should move to
>> event.
>  Why ? (I am not against changing it)s
>  Because designing a new API without having in mind what are the downsides/issues
> of the old one is the best way to do the same errors.

> The "variable" event way has:
> - easy (un)registration.


> - easy without ABI break extension.

Easy to fix. Only valid complaint.

> - automatic way to get the value associated to an event (in the event callback but
> also outside it which is really important, and without duplicated code).

No, this is wrong. We don't need such thing. The duplicated code would
be very light, and current design is ugly. It mixes up control and
model, and this is why we are easily caught in callback loops and so.
Writting an accessor and a setter is easy, and 5 line max with all the
flexibility we need, that involves lazy fetching and such.

> - uniformized value transport.

And non flexible value transport as well. Current vlc event is not
associated to a single variable, which is way better IMO.

> - transport of the emiter object.


> The downsides I see:
> - hard(impossible) to transport coherent multitple values for a complex event.
> - event callback in the emiter thread.
> - not easy to find which events are available (but that's a documentation issue)

It is not. It's a design issue. that leads to:

- non static event checking.

This is the worse part. Easy typo, easy
I-don't-know-what-I-do-on-what-object mistake.

What I am saying is that the API, is that we are in a way better
situation with events. And fixing this is easy, if you want.

We want to get rid of variables, let's do that gradually. Let's remove
the dependancy as we go on.


More information about the vlc-devel mailing list