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 :P

Raptor

Raptor

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 :( .

Rating your medias

Heyo everybody! :)

Just 2 days before attending the Nepomuk sprint i found some time to play with the amazing features it offers. Just few lines of code and the rating stuff is now available for my MediaBrowser. When using Nepomuk::Resource in your app remember to do Nepomuk::ResourceManager::instance()->init()  otherwirse your Nepomuk::Resource might make your app crashing :P (thanks Lukas for the hint).

The implementation is still young but i really plan to add a model to the MediaBrowser in order to only browse among rated medias so that statistics will be easy to do and stuff like “Most Rated Videos” will be available also for your local collection.

But now enjoy the vid. Still sorry for the low quality but youtube is not wide-videos-friendly ;)

As you may have noticed the Grid mode needs lots of polishing and i have to find a nice way in order to not overcrowd the view. In addition to this i should start better following nuno’s mockups :)

And now cheers and looking forward to meeting all of you joining the Nepomuk sprint!

Browsing your medias

And finally i’m back blogging again. It has been a busy period the last two weeks. University elections and exams (the latter didn’t go so well :/ ) took away my time. Fortunately the great guidance by notmart and aseigo helped me defining my work in the incoming days. Currently i’m focusing on something i just talked about in the past but never showed you something. Today you have the chance to see the high work in progress status of something i’m getting excited about: the mediabrowser applet! :)

You’ll find lots of similarities with your beloved folderview but this applet has the aim to help you browsing only media contents and interact together with other media applets such as the mediaplayer, the playlist, the playback controls and so on. I’ve had an interesting meeting with notmart and aseigo and we defined some guidelines to follow while developing this kind of applets (media applets). I’ll soon start the development of the MediaContainment which will handle your media applets in order to give you a great experience while listening to your favourite music or watching your favourite action movie :)

But now just have a look!

Sorry for the low video quality :)

Things to do are still a lot but stuff is taking into shape. The browser already supports both grid and list view and i like the hover effect which makes use of an animated item. Differently from folderview we decided to use a QGW for each item. I know you could say this is too heavy but it’s still fast enough. Anyway i’ll try to optimize it trying to just allocate the visible items (which is hard enough especially with the grid view). Everything you see is available under playground/base/plasma/MediaCenterComponents so you can already give it a try.

The local file browsing is only one of the possible browsing mode that the browser will allow  (currently it only allows local browsing though). As some of you may already have noticed i wrote a quick dataengine capable of looking for videos from YouTube. The mediabrowser will make use of dataengines in order to allow the so called “Remote Browsing” (better names suggestions are welcome :) . Using Remote Browsing you’ll be able to look for your favourite Youtube videos just browsing through them in the same way you do for your local medias. Mediabrowser will let you choose the browsing mode you want and then will change his contents to fit your needs. The Remote Browsing, for example, will show you a line edit for searches, an engine chooser (not only YouTube is in my mind) and then the results will be shown like your local files: a nice thumbnail together with video information (length, title, author…).

Ok that’s it for today, i just need to study also :/

Hope you’ll like my work :)

Cu and cheers!

PlasmaTube

The GSoC official period started and i’m back again to the Media Center. Today i’ll show you a one-night-coded engine :P 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 :P (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!

Cheers

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!

playlistappletcovers

P.S.: the magic behind the engine is the last.fm 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 last.fm

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 :P

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.

Plasma::Service

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™ :)

PlaylistApplet

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!

playlistapplet

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 :P

Aaanyway that’s it for today

Stay tuned and see you! :)

Smells like Summer of Code…

Heyo people,

Long time you don’t hear from me.. =)

So, this is really a funny month for me it seems. As already announced in my previous post i started a C++/KDE course at my university (as professor =) and i’m having fun with it. There are students really really interesting in understanding how KDE development works. I hope to be fitting well the purposes of the course.

Aaaanyway i’m really really happy to join GSoC this year. It’s the first year i attend it and i’m very excited about it!

In addition to this today Sebastian sent me an email stating that fundings for the nepomuk sprint have been accepted and i’ll finally meet some of you in real life at this amazing meeting!! =) Looking forward to meeting the nice persons you are!

As you may have noticed from the title this post is about my GSoC proposal. You can read about it here.
A very big thanks goes to Marco which is taking/has taken care of my proposal and of me as a brother =)

I really hope to be able to use this huge project as my thesis this year, but, who knows… :)

Anyway,  now some code-speaking for your code-hunger: just to let things start softly i put my hands over the Plasma::DataEngines programming and, in the last 2 days, i managed to hack on a PlaylistEngine which is capable of storing your playlists and managing them. So simple and so useful for my GSoC intents since i’m gonna implement the Playlist Applet ASAP. The engine is shipped together with a DBus interface and you can already try it using qdbus/qdbusviewer to interact with it and start building your playlistS. The plural form is because it may handle more than only one playlist. Each source of the engine is a playlist and you can populate them at your will. The relevant DBus method are:

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

addToPlaylist simply adds a list of files to the playlist named playlistName. Of course, if the playlist does not exist it will be created. The second method is, of course, a convenience function. The third method simply returns the list of populated playlists. And finally the last one returns the files under the playlist playlistName. As you may notice no removal methods are still present. But i’ll add them asap.

This is how the engine gets displayed by our friendly plasmaengineexplorer. Even if the Key field is always “media file”, i think i’ll use it to specify whether the file is audio/video/picture and whatever has media content. In fact the playlist is intended to be used as Media Center component, so any media component would be accepted :P

playlistengine

What i find really nice of it is that it already can automatically update the playlist when the files listed in get deleted from the harddisk. :) Of course the playlists already get saved on your hd using KConfig, so playlistenginerc is what you want to manually edit your playlists.

The code currently stays under playground/base/plasma/dataengines/playlist so, if you have time give it a try! :)

That’s it for today.. I’ll keep you up-to-date about the development.

Lemme know your opinions, suggestions.. :)

Cheers devs!!

Teaching KDE

DISCLAIMER: We know KDE is wider concept than simply application development but in this post i’m gonna talk about development related issues :)

INTRODUCTION: I suppose we all might agree with the fact that the most solid pillar of the Open Source World is the idea that every little piece of code might be an helpful reading for other developers in increasing their knowledge. This means that sharing knowledge is our strength. I really don’t want to argue against other form of softwares, i’m just underlining the strength of our personal form of software belief  (second disclaimer :P ). As many of you may already know i’m a student of Computer Science Engineering at the Politecnico of Bari here in Italy. I’m not very happy of how *they* teach most of the subjects we study in the courses and most of my sadness is due to the way they teach (or try to teach) us programming languages. Nearly two years ago i passed my C++ exam but all we learnt was how to create simple command line-apps that we might have easily written in C. I’ve always dreamt about a C++ exam where the teacher picks a piece of KDE code as example and uses it to teach us all the funny things of developing an application, advanced C++ tricks and so on. I know i still have the “Software Development Engineering” exam at the 2nd specialistic degree (don’t really know how to say that in english) but i’m sure *they* won’t teach us developing applications starting from a real successful example from the Open Source World.

THE IDEA: So, an idea came to my mind. I proposed to some friends the idea of building up a C++/Qt-KDE course open to every one interested in it. We have students associations that help us fight for our rights and realize self-managed courses like the one i proposed. The idea was accepted and really lots of student signed up!! This makes me really proud and happy since i have the chance to teach something i learnt (and continue learning) developing in KDE.

THE COURSE: The course will be of 10 lessons, 2 hours each. Students are supposed to have C++ basis since i’d like to deep start with the real development. Most of our courses at the university are just about theory (this is one of the big problems of italian universities: too much theory, really poor practice); so i’d like to help them make practice. I talked to two of them and their expectations about the course are just these: design and develop an application, practically!! Put their hands on the code, fight against build errors, optimize code and so on.. The stuff we do almost every day with KDE xD. So i’d like to use the 10 lessons to design and develop a real simple KDE application discussing the designing problem with them lesson by lesson. This way, after the course, they will be able to continue taking care of their little baby maybe making it grow as much as having the opportunity to publish it on KDE-apps.org maybe :D

YOUR HELP: And now let’s come to the real goal of this post :D . I haven’t yet decided what application they’re gonna develop with my help. It just came to my mind the idea of a simple Text Editing Application but maybe you have nicer ideas. Of course keep in mind that most of them don’t even have ever touched Qt/kdelibs/cmake. I’d start from the techbase tutorials to help them write a basic KDE application and then start with the real development. In addition to this i was looking for a live distro that ships at least KDE 4.2 with cmake kdelibs-dev and kwrite to help those students without Linux on their PCs (i think i’ll force all of them installing it :)

So please, lemme know your ideas, suggestions, insults and whatever.. everything but spam is appreciated xD

Cheers!!

Just one more idea (add widget stuff)

mock

Ok first of all i’m really sorry for my poor mockup skills, i did my best but i’m just crappy at drawing with pc :)

And now the explanation..

This is my crazy idea for the “add widget”-stuff. Don’t really know if it is user friendly, nice and whatever, it just came to my mind before going to bed so i decided to put it down and show to you, folks :) .

So, how is it supposed to work? Let’s go step by step:

  1. The user keeps a modifier pressed (e.g. ctrl+alt+whatever)
  2. The plus icon appears on the desktop at the cursor position
  3. The user clicks the plus icon
  4. That mockup stuff appears
  5. Categories are shown, the user navigates using keyboards to scroll items. NOTE: The number of visible items != the number of available items. Aka scrolling items through the right makes the last item on the right disappear and a new item on the left appear. Instead of categories this stuff can show favorites plasmoids as default or whatever you think it’s better ;-)
  6. The user finds the plasmoid he was looking for (either navigating the categories or typing the plasmoid name)
  7. The user just clicks the plasmoid icon and it’ll be added exactly at the plus-icon position.

That’s it i think. Feel free to ignore this post or ask question or even insult me xD

P.S.: s/plasmoid/the name you like most for your plasma widgets/

Cheers dear devs!

Next Page »