Phonon Five the Queues and the MediaObjects

Trever Fischer tdfischer at fedoraproject.org
Tue Jun 19 17:56:14 BST 2012


On Tue, 2012-06-19 at 14:26 +0200, Harald Sitter wrote:
> I just had a bit of an epiphany... the spooky aboutToFinish signal of
> the high and mighty MediaObject is actually more about the queue than
> the MediaObject (playback control of one source). Which then lead me
> to realize that the MediaObject features crappy OOP which leads to
> much confusing (e.g. if you look at amarok's code you will notice that
> it actually treats aboutToFinish as indicator for a track end, which
> is simply wrong really).
> 
> So, I was wondering.
> Considering we keep the MediaObject and graphing architecture, we
> perhaps should move the queuing components out of the MO and into an
> own Queue class. This would IMO make sense because as it is right now
> particularly the signals can be confusing without reading the
> documentation. For example if someone only looks at existing source
> code the names of the signals can be utterly misleading. Additionally
> of course the current situation seems hard to argue from an OOP
> perspective. On the one hand the MO is a control interface for the
> playback and at the same time you can manage sources that are not
> actually being played. So it is a player with integrated playlist...
> boohooo.
> 
> Additionally one gets to wonder whether the queue is actually needed.
> Does anyone know an application that uses it like a queue? Amarok for
> example really always ever queues one track for gapless playback, so
> for amarok the aboutToFinish for the better part is behaving as you
> would expect (it is emitted whenever the current source is done
> playing, so that amarok can push in a new song).
> 
> Questions are:
> a) do we need the queue?
Yes.
> b) should we split it into an own class?
Yes. It can be something sorta like the MediaController, where we attach
a Queue to a mediaobject. As you said, you should only use the MO to
control playback of a single file at a time. The Queue can be a super
simple playlist element for folks who don't want to write their own
playlist stuff. For bonus points, we can create a QAbstractItemModel
around it and pass it to a listview for instant player GUI.
> 
> HS
> 
> PS:
> Affected interfaces include:
> - clearQueue
> - enqueue
> - prefinishMark
> - queue
> - setPrefinishMark
> - setQueue
> - aboutToFinish
> - prefinishMarkREached
> _______________________________________________
> kde-multimedia mailing list
> kde-multimedia at kde.org
> https://mail.kde.org/mailman/listinfo/kde-multimedia



More information about the kde-multimedia mailing list