Sunday, July 02, 2006

Yay! Some fast progress now!

After resolving the kdelibs problems I started trying to improve the already (somehow) working ByteStream. One of the first things I wanted to do was to reconsider the way time reporting is done in the backend: even if NMM can sent time progrss events, the backend was using an internal timer to do time reporting. Talking to My mentors and to fub (Bernard) they all agreed that a nice thing to do would have been to use the NMM events to signal time progress. Well I was just looking at it and... done. It was indeed quite easy. And I think it could have been done even in an easier way!

In order to do it I:
Moved the callback functions from MediaObject to AbstreactMediaProducer (so they will be usefull in ByteStream too one day)
Added an Phonon::AudioPath::insertInto(NMM::GraphHandler) that inserts the AudioPath's branch into the GraphHandler. This is called from internal_addBranch in Phonon::AbstreactMediaProducer.
Made the Phonon::AudioOutput create a sink Node in the constructor (it will use info from kcm to decide the node type) and enabled setTimeProgress events from that node.
Made Phonon::AudioPath add its Phonon::AudioOutput's sink (already created) Node to the NMM::GraphHandler.

This changes make the backed architecture reflect the NMM::GraphHandler architecture better : Phonon::AudioOutput wraps a sink Node, Phonon::AudioPath wraps a brach in NMM::GraphHandler, and Phonon::AbstreactMediaProducer wraps the wole Phonon::AbstreactMediaProducer.

Thanks to this changes (that enable the sink node to send progrss events) it was easy to attach those events to callbacks in Phonon::AbstreactMediaProducer that report the event to KDE using QT signals.

No comments: