Monday, 29 July 2013

GSoC - Week 6

Hey :)
I'm Anmol, and this is the report for week 6 of my work on revamping Amarok's scripting interface. This week has been mostly been about polishing existing functionality and documenting code.

A major problem I faced this week was with the KPluginSelector widget and the KNewStuff plugin installation. KDELibs provides a DownloadDialog for easy downloading of plugins from, and uses a .knsregistry file for storing a list of files installed as part of the plugin, used by the download dialog when uninstalling files.

But annoyingly,  these installation, removal and updation methods don't seem to be exposed in any way besides the download dialog, which explains  the way we handle updation in Amarok. ( Which also means that uninstallation via the download dialog of scripts updated through amarok will leave behind newly introduced files ). The KPluginSelector, likewise, is pretty inflexible.

So what I ended up settling on is re-creating our KPluginSelector [derivative] everytime the scripts are modified, with some other workarounds to keep everything sane, like having to sort entries before insertion and having to keep a map of script names to their indices in the KPluginSelector.

For the uninstall, instead of parsing the knsregistry file, I'm just recursively deleting the script's base folder in amarok/scripts/, so here's hoping nobody bundles multiple scripts into one folder, atleast until this is improved.

Another problem was the deprecation framework- I couldn't detect an object call. For example, Amarok.Collection is now deprecated, and Amarok.CollectionManager should be used instead ( though we could possibly just keep both indefinitely ), so I had to be able to detect it. I needed dynamic getters, and fortunately stumbled upon Object.defineProperty introduced in ECMAScript5.
So I subclassed QScriptEngine and introduced a setDeprecatedProperty function:
So with this, most of what remains of my revamp are the actual APIs I am to  expose, and I still have to explore SMOKE! Hopefully I can automate those interfaces instead of having to manually write a bunch of wrappers, there are better things to do for Amarok :)


  1. Hi there. Just wanted to say big thank you to your contributions to the Amarok music player (my favorite one). And I would like to ask you 2 things. First, for scripts that load and stream internet radio stations, is it possible to add album art (either downloading it from their website, if they allow it, or making it custom and loading it from script's folder) ? And second, is there a chance of implementing some kind of .cue sheets splitter for Amarok or does that have something to do with licencing or codecs ? It's not hard to split them manually with Flacon, but it would be nice to have that already built in, like foobar2000, because Amarok is the most complete music player I know of. Keep up the good work.

  2. It's
    About the album art, yes- you can set a coverurl in the streamitem.
    This link may help:

    And for the cue files- unfortunately, no. Amarok has rather limited cue support. Though you can use other tools.
    Mamarok suggested avconv-
    Btw, you can always create a qprocess in qtscript and call an external binary- though that might limit portability.

  3. This is Anmol's blog and a lot of very important concepts has discussed in this website especially related to GSoC. I don't have any idea about it before come this website. However, I try to get custom thesis writing service but yes i like the approach which author of this site adopted while publishing this post.

  4. provides authentic IT Certification exams preparation material guaranteed to make you pass in the first attempt. Download instant free demo & begin preparation.

  5. SAMOT is trying to diversify its product line along with traditional automotive. The company is purchasing new kinds of CNC machines for making decrease quantity, more advanced components for the commercial sector and electric cars. The company launched its second program, devoted to press brake operation, about two years Duvet Covers ago. Like within the machining program, the three ranges of press brake operator classifications observe that chef metaphor. A Level I press brake operator can produce conventional, easy components. They know about bend deductions and bend allowances, along with the fundamentals of air forming, like how the radius types as a percentage of the die opening.