Phonon Five the Queues and the MediaObjects

Harald Sitter sitter at kde.org
Tue Jun 19 13:26:42 BST 2012


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?
b) should we split it into an own class?

HS

PS:
Affected interfaces include:
- clearQueue
- enqueue
- prefinishMark
- queue
- setPrefinishMark
- setQueue
- aboutToFinish
- prefinishMarkREached



More information about the kde-multimedia mailing list