Video effects

Thierry Bastian thierry.bastian at trolltech.com
Fri Jul 13 13:53:24 CEST 2007


To me it's more obvious that you can't have an effect if you can't build an
object representing it.

But I don't like the factory pattern too much either.

Thierry

-----Original Message-----
From: Matthias Kretz [mailto:kretz at kde.org] 
Sent: vendredi 13 juillet 2007 13:46
To: phonon-backends at kde.org
Subject: Re: Video effects

On Friday 13 July 2007, Thierry Bastian wrote:
> The problem is still the same: we can't easily have a common base of 
> effects. So adding a GaussianBlurEffect class would not make sense out 
> of the Quicktime world.
>
> Thinking loud: Maybe a factory could do that job?

That's why I was rather conservative with the specialized effect classes I
defined. I've only added a class if I had a valid use case for an
application that needs the class.

How would a factory help? All it would change API wise is from:
GaussianBlurEffect *e = new GaussianBlurEffect(parent); if (e->isValid()) {
    ...
}

to:
GaussianBlurEffect *e = new Factory::create(GaussianBlurEffect, parent); if
(e) {
    ...
}

or:
Effect *e = new Factory::create(GaussianBlurEffect, parent); if (e) {
    ...
}

--
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/
MatthiasKretz at gmx.net, kretz at kde.org,
Matthias.Kretz at urz.uni-heidelberg.de



More information about the Phonon-backends mailing list