about a patch

Matthias Kretz kretz at kde.org
Tue Nov 25 14:57:59 CET 2008


On Tuesday 25 November 2008 14:28:01 Thierry Bastian wrote:
> Ok so let's say we go for Empty by default, which I agree makes sense.
>
> Then you can:
> mediaObject->setCurrentSource(MediaSource());

Yes, which should be treated as the application doing something wrong (not 
fatal, though), whether we want to handle it the same as MediaSource::Empty 
I'm not sure about yet.

> or
>
> mediaObject->setCurrentSource(MediaSource::Empty);

There's no MediaObject::setCurrentSource(MediaSource::Type) function and no 
MediaSource(MediaSource::Type) ctor atm.

> I still don't see the need for
>
> mediaObject->setCurrentSource(MediaSource::empty());

We need to either add
MediaSource::MediaSource(Type)
or
static MediaSource MediaSource::empty()

I'd rather add the latter than the former because e.g.
mediaObject->setCurrentSource(MediaSource::Disc);
would then be possible but doesn't make any sense. I do agree that 
mediaObject->setCurrentSource(MediaSource::Empty);
is more intuitive than
mediaObject->setCurrentSource(MediaSource::empty());

So it's a trade-off between making the API foolproof and making it intuitive. 
:(

-- 
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/



More information about the Phonon-backends mailing list