Archive for the 'kde' Category

MediaCenter again!

Hello everybody!
It’s been a loooong long time since my last post, i’m really sorry about it but university takes away so much time :/

But aaaanyway let’s talk about my GSoC.

Finally we have a working mediacenter, yayy!! =)

Let’s see the most important things i’ve implemented so far:

  • MediaCenter API: the API makes it possibleΒ  to have applets communicating each other. This way the player can inform the playback control applet about the current seek time, while the playlist updates the player’s queue. The API can of course be used to write new applets in the future πŸ™‚
  • Bypassing Phonon: due to the purposes of the MediaCenter, Phonon could not be used to handle the whole playing queue. The mediacenter, actually, is designed to be able to handle mixed queues containing different kind of media sources like audio files, optical discs, videos and pictures. Since Phonon only handles audio and video stuff i had to completely bypass the Phonon queue and create my own internally in the mediaplayer applet. I still have to think about moving this queue handling out of the specific mediaplayer applet moving it at the API level.
  • The playlist communicates with the player and keeps the queue up to date. Even though the playlist applet supports multiple playlist handling, i focused on the single playlist mode, so i still don’t know whether it’s already all-working-fine when switching through playlists :p. Anyway the multiple playlists behavior is disabled by default :p. The playlist applet supports cover fetching and manages all the supported media types: Audio, Video, Picture, Optical Discs.
  • The mediabrowser applet supports now folder navigation. We now have a browsing widget that allows actions like “go back”, “go next”, “go up”. The mediabrowser will soon support pluggable models. The first model i’ll work on as soon as possible will be a youtube-navigation model that will allow the user navigate through videos via the browser. The mediabrowser will show a list of available models at startup allowing the user choosing between local browsing and youtube browsing for example. The youtube dataengine is there already! πŸ™‚
  • The mediaplayer applet currently correctly switches between audio/video playing and picture showing. I still need to verify whether my code is enough light while showing pictures. The Xine backend of Phonon is still broken for the VideoWidget and this is disappointing :/. In addition to this i don’t like how the videos are rendered in the VideoWidget while it is hosted by a QGraphicsProxyWidget. The fullscreen mode of the mediaplayer applet is working but has no utility at the moment since we don’t have a dashboard that can go over it and show playback controls and stuff. By the way this issue has been currently “workarounded” with a specific shell i wrote for the mediacenter πŸ™‚
  • The Plasmediacenter Shell: this is a stand-alone application that can be freely used instead of putting the containment and the applets on your screen :). The Plasmediacenter can be set fullscreen so that also the playback controls still remain over the mediaplayer applet. Have a look atΒ  it πŸ™‚

Let’s have a look at some screenshot of the Plasmediacenter:




And that’s all folks! Stay tuned for the next updates!! πŸ™‚

P.S.; An icon is needed for the shell (/me stares at nuno ;).

Still alive!

Heyo people, it’s been a while since my last post. I’ve been really busy with my exams and unfortunately i’m still a little :/. Anyway i’m back to my GSoC and currently i’m playing with the API. Don’t remember whether i already mentioned about but i’m writing a simple API to allow writing new media applets in the future =). Today i’ll show you what i achieved so far with containment and handlers in supporting 2 new media applets I’ve just integrated:

As you might have noticed we now have the browser from the left (still), a playback control from the top and the playlist from the right. Still no playing stuff though :/. That’s because i have to finish the api even if i already have some basic one which allows the applets to communicate each other without DBus, at least in this particular containment. I’m looking forward to seeing spectrum analysis in Phonon so that maybe i’ll be able to integrate some nice effect and/or share it with amarok. Today probably i’ll start playing with the mediaplayer applet, i also have to make some performance test since i plan to have a fullscreen video widget.

We’ll see, stay tuned =)

Media Center quick update

I’ve just implemented the very first working version of the handlers i (together with notmart) chose to use for at least the media applets in the media containment. I like the effect and you can have a look at it as follows here. What you see is the leftmost part of the containment as you’ll get it on your screen. We chose to put the browser appearing from the left avoiding to clutter the desktop making it appearing only as user requests to show it by moving to the glowing side.

Enjoy πŸ™‚

Semantically back (from Nepomuk Coding Sprint)

And i’m back home here in Italy after a beautiful weekend with beautiful people. The Nepomuk Coding Sprint was a success and i really hope to enjoy it again. I just have to say that the trip was not as good as the stay there. The agency thought it was Fribourg in Switzerland and not the good one in Germay which is called Freiburg. The bad thing is, in fact, that in italian they are both called “Friburgo” :/. Anyway after re-calculating the trip and spending more times in train than in Germany we, me and Francesco, arrived there a bit late the 19th. Unfortunately, due to the mistake by the agency we had to leave on sunday early in the morning and so we fully enjoyed just 1,5 days instead of 3. But it was the most amazing 1,5 days that i’ve ever spent :P. I’d say thanks to Albert, Daniel, George, Lukas, Marcel, Mathieu, Peter, Sebastian Faubel from Gnome, Tobias, Tom and, last, but not least, to the friendly host Sebastian Trueg which took care of all of us both in staying there and programming xD.

I learned much about Nepomuk, it’s really a great technology and people should be aware of its possibilities. I had the chance to work on Raptor together with Lukas and Francesco staying near each other (even on the same laptop :P) and we implemented some basic stuff for the real purposes Raptor was designed for. But i won’t talk about the details in this post.

I just want to share with you some photos i took there πŸ˜›



Some raptor tests with nepomuk πŸ™‚

Albert, Lukas, Me

Albert, Lukas, Me

Saturday night in a pub: from the left Albert, Lukas and me.

Francesco is hungry

Francesco is hungry

At some point we got so hungry that we started drawing food on our own xD

Some of us programming

Some of us programming

That’s it guys, Sebastian is a great host, and i hope to see you again soon. Unfortunately i won’t go to Akademy due to university :(.


The GSoC official period started and i’m back again to the Media Center. Today i’ll show you a one-night-coded engine πŸ˜› After notmart’s suggestion (great mentor, great) i got a pretty nice working version of a YouTubeEngine!! πŸ™‚ You can easily use it to query YouTube for videos. Try the following queries for example πŸ˜› (and thank sebas for the query suggestions!)

asian backstreet boys

asian backstreet boys

numa numa guy

numa numa guy

Remember to prepend “query/” to your queries as from the screenshots. Each source will have a key for each video id found. And with each id you’ll be able to retrieve a Plasma::DataEngine::Data containing video informations accessible through the keys specified in the docs (title, comment, keywords). I’ll add new keys asap but it’s already pretty nice and working. I need to do more checking stuff on the queries though.

Aaanyway, enjoy!


Get your cover!

Just a quicknote about the last feature i’ve worked on today: a CoverFetcher DataEngine πŸ™‚

Simply query your cover doing coverFetcherEngine->query(“ArtistName|AlbumName”); and a source will be added to represent the cover. Each cover will be represented by a source of the dataengine. Additionally, for each source, you can find more than one cover categorized with the keys: “small”, “medium”, “large”, “extralarge” according to the different cover size fetched.

The playlist applet already takes advantage of this.. get your cover!


P.S.: the magic behind the engine is the api. I hopeΒ  to be respecting their license.. I’ll add a Credit file mentioning them as soon as possible to the repository.

2nd P.S.: thanks to lfranchi for pointing me to

3rd P.S.: thanks to notmart and pinotree for the hints about the xml parsing

Cheers devs! πŸ™‚

Adventures in MediaCenter land

Heyo people!

Things are taking shape just nicely here in MediaCenter land =)

First of all: things have movedβ„’: this means that if you have checked out playground before 26th of April you should `make uninstall` and checkout it back from the MediaCenterComponents folder i’ve created under playground/base/plasma. This is just because the MediaCenterComponents won’t be a single application but a mix of all our powerful Plasma capabilities: engines, applets, new dashboard and so on.. in addition to a complete DBus interface.

DBus stuff:

As mentioned in my previous post MediaCenterComponents is intended to have a full featured DBus interface in order to allow intercommunication among media applications. That’s why i focused on extending the PlaylistEngine interface with more methods than the last time i talked about it. Now we have methods like:

  • void addToPlaylist(const QString &playlistName, QStringList files);
  • void addToPlaylist(const QString &playlistName, const QString &file);
  • QStringList availablePlaylists();
  • QStringList filesInPlaylist(const QString &playlistName);
  • void removeFromPlaylist(const QString &playlistName, QStringList files);
  • void removeFromPlaylist(const QString &playlistName, const QString &file);
  • void removePlaylist(const QString &playlistName);
  • void setCurrentPlaylist(const QString &playlistName);

While most of them do simply what their name says, some need a more deep explanation. The method availablePlaylists() simply does what Plasma::DataEngine::sources() do (remember that each playlist is a source) but skips the currentPlaylist source. That’s because currentPlaylist is just an helper but i’ll talk about this some lines next. The method removePlaylist, instead, removes a source from the engine. And finally, setCurrentPlaylist simply informs the world about the current playlist to play. You don’t want to play many playlists at the same time, right? πŸ™‚

The MPRIS specification

My near plans are to make everything compliant with the MPRIS specification so i have to keep this in mind while implementing the whole DBus interface. The first little problem i had to challenge with was the fact that MPRIS assumes only a playlist: the current tracklist. So i had to meet this limitation just using the method setCurrentPlaylist. This will help me acting as a wrapper around the playlist chosen by the user. The org.freedesktop.PlasmaMediaCenter /TrackList will just see the currentPlaylist and i won’t just get crazy with it.. Just as easy i think πŸ˜›

And that’s why i decided to skip the currentPlaylist source in the availablePlaylists() method still leaving it in the sources though. After all it’s still a source, a plain copy of the chosen playlist. The different thing is that, unlike the other sources, this one won’t get saved in the config. At least it’ll be saved as lastUsedPlaylist but i haven’t implemented it yet.


Even if we have a DBus interface Marco suggested me that using DBus over the same common ground is a bit overkill. So he pointed me to Plasma::Service. And that’s what i did, for now simply making the setCurrent method available via the Playlist Plasma::Service. setCurrent is available for each source and simply does setCurrentPlaylist(source). As you may imagine calling setCurrentPlaylist(currentPlaylist) simply does nothing.

I must say that implementing a Plasma::Service was not that difficult but unfortunately it has no docs and i had to look at nowplaying code. The KConfig stuff initially caught me unprepared but i managed to do it :P. I plan to write docs about it soon since it is a really powerful technology for Plasmaβ„’ πŸ™‚


And now that the invisible stuff is almost done it’s the time for the applet stuff. I managed to write a simple and really ugly applet just to test how the interaction with the engine goes and it seems to already be fine. I made use of TagLib to retrieve tracks info so TagLib is a required dependency for PlasmaMediaCenter. Not that bad since we have it in kdesupport :P.

Take the screenshot!


Please, suggest me a nice icon for this ugly applet (/me stares at Nuno xD). Of course i plan to make it nice appealing keeping in mind that the MediaCenter would be accessed through remote control (thanks Marco for pointing this out πŸ™‚

Unfortunately now nothing plays so you have to wait a little more πŸ˜›

Aaanyway that’s it for today

Stay tuned and see you! πŸ™‚