Sunday, July 14, 2013

Trysts with my GSoC Project- PART I

THIS BLOG ENTRY IS ALL ABOUT MY WORK IN THE PAST MONTH AS A PART OF MY GOOGLE SUMMER OF CODE PROJECT TO IMPROVE AND ENHANCE THE POWERFUL KDE APPLICATION -- PLASMA MEDIA CENTER .



Just to reiterate for the new readers, Plasma Media Center is an innovative step in redefining the user experience where media - such as photos, videos, songs etc. are combined in one KDE application. Users can view pictures, watch movies and listen to their favourite sound tracks all at one common place.




My initial few commits in the plasma-mediacenter repository involved implementing minor features and removing existing bugs in the application.



Certainly, I would write about my very first patch for plasma-mediacenter which solved. This couple line patch gave the user an option to DELETE THE ITEMS ON THE MEDIA PLAYLIST WITHOUT STOPPING THE CURRENTLY PLAYING MEDIA. I also changed the text style of playlist items to Sunken and enabled "-" option in front of every item by simply REMOVING A QML CODE LINE in PlaylistDelegate.qml file :



visible: listViewItem.ListView.isCurrentItem



It worked as intended and was pushed into the main repository of plasma-mediacenter by my co-mentor Shantanu Tushar as I didnt had master commit rights back then. It was a good feeling to produce a patch, though small, which got integrated in the main repository of the software ready to be used by millions of people !!



Next few patches were dedicated to enhance keyboard navigation in the Picasa backend of the PMC(Plasma Media Center). Earlier, Picasa Album login in the PMC didnt support keyboard navigation. First thing which I implemented in this was to ENABLE THE ENTER KEY TO LOGIN WHEN THE USERNAME AND PASSWORD CREDENTIALS ARE ENTERED. The thought behind this was that almost everyone after entering the password liked to press the ENTER key in order to log-in . So PMC not offering this feature was a concern.So here is my patch which I created then in order to accomplish this :

After this, what I thought was to extend the keyboard navigation functionality in the Picasa backend by implementing in the existing qml code. This was a small patch which enabled the PMC user to use TAB Key to navigate in the login credentials in the Picasa backend Login screen. Details of this patch can be viewed here:

Both of these patches were committed and pushed into the main repository, before which I was given the KDE Commit/Developer Rights with the help of my GSoC mentor Sinny. It was great to ship the working patches into the main repository of PMC.



Snapshot of the KDE Reviewboard



There were more small hacks on PMC source code , few of them unsuccessful also but well that is the beauty of open-source software development.Even if your code is not in its best state , you can keep hacking it, learn and get it perfect ! For example, a very small patch was merged in the repository which enabled the user to press ESCAPE key to go back one level in the PMC Filesystem browser. Basically , right from our start,our intention is to make PMC application fully keyboard navigable.This was one small step in this aim .



After this, with the help of my mentors, I worked onwhich in a nutshell demanded a way out to go back to the main media being played with a single click when the user is on PMC Homescreen.



HOMESCREEN



Media Player



So after a short discussion it was decided to use the empty space on PMC Homescreen to add this feature that when media is being played in the background of the homescreen , if the user clicks anywhere in the empty screen , the mediaplayer / slideshow/musicplayer opens up as shown in the above picture.

The details of the patch are here :

I used the concept of QML SIGNALS AND SLOTS and QML MOUSE EVENTS to implement this feature.



Snapshot of the REVISION history in the KDE Projects PMC Repository.



After a couple of more small patches which includes a minor feature to considerably . This was an attempt to improve the readability of other items on screen when we browse the filesystem while watching a video for instance.



After this, I worked on relatively a bigger thing than solving bugs and adding small features. We now wanted to revamp the entire filesystem browser and change the way PMC file-browser worked earlier. For this, it was important to understand Qt Model/View Architecture and Programming. Learning it was extremely enjoyable and before hacking on plasma-mediacenter source-code, I even made a smallDesktop File Explorer in process of learning which is uploaded on Github :

Leaving the coding details, in short, the look of the file browser was changed. This particular task gave me immense confidence in my project. I dealt with C++ models (LocalPlaces and LocalFiles) and QML Views to be precise. The concept of abstraction and inheritance also came handy while implementing the instances of the LocalPlaces Model in the code.I also got to learn a bit more about CMake files during this time.

Here is the detail ::



#plasma IRC Snapshot of master branch commit



Picture Shot Comparison of PMC FileSystem Browser homepage before and after this patch------



Earlier HOME contents were by default shown and left side panel was used to browse directories



Now more dynamic and easier Drive browsing capability of PMC is there. User can easily browse through directories etc.



After a , I recently started working on an implementation of a STACK DATA-STRUCTURE to enhance the navigation flow in PMC. This was an awesome suggestion by my co-mentor Shantanu.

So, I implemented a stack to store the browsing URLs and thus ensure that the user can select another drive by coming to the PLACE MODEL screen on pressing escape/back required number of times. Further, earlier on clicking BROWSE Pics/Music/Videos , PMC took us to the last browsing folder but now we get back to the PLACE MODEL screen on clicking it which is more convenient for the user as he/she has all the options again to browse whatever drive they want to.QStack Library was used.

The details of the diff patch can be viewed here:

I am completely enjoying my work and challenges that usually come with it. It has been an awesome learning opportunity for me till now and I hope it continues to be a knowledge-enriching journey throughout the project. It is always a great joy to work with extremely supportive mentors KSINNY and SHAAN7 as they are popularly known on IRCs and also the KDE Community. It has been a nice exposure so far for me and I look forward to hack on PMC even more to make it better.

The release of the beta version of the Plasma Media Center is up soon , probably in less than a week. It would be great if the readers then can test and report bugs to solve.

I will try and keep updating about the progress of my work in this GSoC project ! Signing off for now...
Full Post

No comments:

Post a Comment