[PATCH] KPlayObject fixes for asynchronous generation + patch for kaboodle

Matthias Welwarsky matze at stud.fbi.fh-darmstadt.de
Sat Aug 31 22:50:46 BST 2002


On Saturday 31 August 2002 22:59, Neil Stevens wrote:
> On Saturday August 31, 2002 06:42, Matthias Welwarsky wrote:
> > Even if the implementation is source and binary compatible, some
> > caveats:
> >
> > Don't call KPlayObject.object().isNull() if you want to test for a Null
> >  Playobject. Kaboodle uses this to find out if loading of the media file
> > worked. Call KPlayObject.isNull() instead. It will return "true" if the
> >  object is a proxy. In general, it should not be necessary to test for
> >  a Null playobject anyway.
>
> Please document this, if it's dangerous.
>
> > Don't rely on capabilities(), as the proxy object will return "0"
> >  capabilities if the real object is yet to be created.
>
> How is a user supposed to be able to know whether a playobject is seekable
> or pausable then?  This is a major regression.

Ok, I added a signal "playObjectCreated" to KPlayObject, so you can connect it 
and know when capabilities() are valid. This is also needed for noatun, as 
the effect stack must of course be connected _after_ the real playobject got 
created. Also note that, if the URL points to a local file, the PlayObject is 
generated the usual way so capabilities() are valid immediately. Streams are 
not seekable anyway so this is not really a problem. Pausable is admittedly a 
problem, though I'd not call it a "major regression". Just be sure not to 
cache the capabilities.

> > The proxy object will return Arts::posIdle as state(), even if you just
> > called "play". For Streams, it can take an indefinite amount of time
> > for the connection to be opened and the playing to start.
>
> This will seriously hurt the usability of apps like kaboodle, and is also a
> regression.

No, not really, in fact kaboodle does work happily with the changed 
KPlayObject. Noatun still needs some work, however. I'll try to figure that 
out and make a patch, or adapt KPlayObject so that it works. I'm not sure if 
I expressed it clear enough: The proxy object will relay all calls to the 
real playobject once it is created, so after a certain time, capabilities() 
as well as state() return the correct values. Just don't cache them.

regards,
	matze

-- 
Matthias Welwarsky
Fachschaft Informatik FH Darmstadt
Email: matze at stud.fbi.fh-darmstadt.de

"all software sucks equally, but some software is more equal"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
URL: <http://mail.kde.org/pipermail/kde-multimedia/attachments/20020831/46cc6461/attachment.sig>


More information about the kde-multimedia mailing list