<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Binary Elysium &#187; amarok</title>
	<atom:link href="http://www.binaryelysium.com/blog/tag/amarok/feed/rss2/" rel="self" type="application/rss+xml" />
	<link>http://www.binaryelysium.com/blog</link>
	<description>No Ordinary Hotel</description>
	<pubDate>Thu, 06 Nov 2008 04:38:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Amarok &#038; NPR :: 13 Years of News Media Now Available at Your Fingertips</title>
		<link>http://www.binaryelysium.com/blog/2008/11/05/amarok-and-npr/</link>
		<comments>http://www.binaryelysium.com/blog/2008/11/05/amarok-and-npr/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 04:21:21 +0000</pubDate>
		<dc:creator>Casey</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[amarok]]></category>

		<category><![CDATA[npr]]></category>

		<guid isPermaLink="false">http://binaryelysium.com/blog/?p=49</guid>
		<description><![CDATA[Earlier this summer I had noticed that National Public Radio (NPR) launched a brand new open API based on open source technologies. My initial reaction was at best skeptical. I assumed any sort of &#8220;API&#8221; released by a major media outlet would turn out to be nothing more than a few customizable RSS feeds. If [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier this summer I had noticed that National Public Radio (<a href="http://www.npr.org" title="NPR.org">NPR</a>) launched a brand new <a href="http://www.npr.org/blogs/inside/2008/07/npr_api_is_live_on_nprorg.html" title="NPR API Announcement">open API</a> based on open source technologies. My initial reaction was at best skeptical. I assumed any sort of &#8220;API&#8221; released by a major media outlet would turn out to be nothing more than a few customizable RSS feeds. If the company was particularly progressive the RSS feeds might include full articles, rather than the neutered one-sentence teasers you find in <a href="http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml" title="NYT's neutered feed">all</a> <a href="http://www.foxnews.com/xmlfeed/rss/0,4313,0,00.rss" title="Fox News' neutered feed">the</a> <a href="http://feeds.cbsnews.com/CBSNewsMain" title="CBS' neutered feed">big</a> <a href="http://rss.cnn.com/rss/cnn_topstories.rss" title="CNN's neutered feed">name&#8217;s</a> syndicated content.</p>
<p>I couldn&#8217;t have been more mistaken. NPR&#8217;s API is no small potatoes. Just take a look at the comprehensive <a href="http://www.npr.org/api/queryGenerator.php" title="NPR API Query Generator">Query Generator</a> to get an inkling of the types of complex queries you can create. Looking at the Query Generator also sheds some light on the content you can retrieve using the API. The <a href="http://www.npr.org/api/index.php" title="NPR API Overview">API&#8217;s main page</a> says the API exposes the <em>entire</em> NPR archive of content starting from the launch of the NPR website in 1995. Just how big is this archive? Over 250,000 stories including text, images, video, and audio! </p>
<p>This quote from the article announcing the API caught my eye immediately:</p>
<blockquote><p>
There were quite a few questions that we addressed when developing the API, but one thing that was not really in question was the need to open as much of our content as possible.<sup>1</sup>
</p></blockquote>
<p>This isn&#8217;t the first open media API. BBC was the first to offer a public open access API, however BBC&#8217;s API is restricted to the content from the past 7-days. Seven days! That&#8217;s nothing compared to the (approx.) 4748 days - and counting - that NPR&#8217;s API offers. NPR and the BBC are two large companies leading the technological shift towards open and free information.</p>
<p>But that&#8217;s only half the story. </p>
<p>After discovering this fantastic API I had to do something with it, and the new service architecture in <a href="http://www.amarok.kde.org">Amarok 2</a> provided the perfect platform to build a NPR mashup. That was several months ago, and at the time the scripting API in Amarok was still being flesh out (Thanks to <a href="http://amarok.kde.org/en/aggregator/sources/16" title="Peter's Amarok syndicated blog">Peter</a>). On Monday I noticed the BBC scriptable service <a href="http://amarok.kde.org/blog/archives/826-There-is-a-BBC-in-my-Amarok.html" title="There is a BBC in my Amarok">Nikolaj had created</a> for Amarok 2. I happened to have several hours of free time, so I cooked up a similar service for NPR:</p>
<p><a href="http://www.binaryelysium.com/images/Amarok_npr2.png"><img width='400' height='239' style="border: 0px;" src="http://www.binaryelysium.com/images/Amarok_npr2_thumb.png" /><a/><a href="http://www.binaryelysium.com/images/Amarok_npr3.png"><img width='400' height='239' style="border: 0px;" src="http://www.binaryelysium.com/images/Amarok_npr3_thumb.png" /></a><a href="http://www.binaryelysium.com/images/Amarok_npr1.png"<img width='400' height='239' style="border: 0px;" src="http://www.binaryelysium.com/images/Amarok_npr1_thumb.png" /></a></p>
<p>You can get it at <a href="http://www.kde-apps.org/content/show.php?content=92543" title="kde-apps NPR Service">kde-apps</a> or via the &#8220;Get More Scripts&#8221; button in Amarok 2&#8217;s Script Manager.</p>
<p>There is definitely room for improvement and in fact here are a few things I plan to do with it:</p>
<ul>
<li>Display more than 20 stories under a category</li>
<li>Sort content by date</li>
<li>Support searching</li>
<li>Display the full articles, with images, in the context view</li>
</ul>
<p>Major props and thanks go out to the entire NPR technical team and all the contributors who made API a reality.</p>
<ol class="footnotes"><li id="footnote_0_49" class="footnote"> <a href="http://www.npr.org/blogs/inside/2008/07/npr_api_is_live_on_nprorg.html" title="NPR API is Live on NPR.org">NPR API is Live on NPR.org</a></li></ol>]]></content:encoded>
			<wfw:commentRss>http://www.binaryelysium.com/blog/2008/11/05/amarok-and-npr/feed/</wfw:commentRss>
		</item>
		<item>
		<title>GSoC Wrap Up</title>
		<link>http://www.binaryelysium.com/blog/2008/09/18/gsoc-wrap-up/</link>
		<comments>http://www.binaryelysium.com/blog/2008/09/18/gsoc-wrap-up/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 14:33:40 +0000</pubDate>
		<dc:creator>Casey</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[amarok]]></category>

		<category><![CDATA[gsoc]]></category>

		<category><![CDATA[mp3tunes]]></category>

		<guid isPermaLink="false">http://binaryelysium.com/blog/?p=40</guid>
		<description><![CDATA[If there was a blogger award for &#8220;Most likely to make timely posts&#8221;, then in no possible world would I even be considered for the award. I could list some excuses that sound legit in my head, but the real reason I don&#8217;t feel motivated to post often (or on time) is because I&#8217;d rather [...]]]></description>
			<content:encoded><![CDATA[<p>If there was a blogger award for &#8220;Most likely to make timely posts&#8221;, then in no possible world would I even be considered for the award. I could list some <acronym title="School">excuses</acronym> <acronym title="Travel">that</acronym> <acronym title="Life">sound</acronym> <acronym title="Moving In">legit</acronym> in my head, but the real reason I don&#8217;t feel motivated to post often (or on time) is because I&#8217;d rather spend that time in Google Reader reading everyone else&#8217;s exciting content (that was not sarcastic).</p>
<p>So, lets see&#8230; last time I posted I was en route to Akademy 2008 (the KDE developers conference). That was July 30th, now, a month and a half later I am back from Europe (which was amazing), GSoC is over (sad), and class has started (jury&#8217;s still out).</p>
<p><strong>Current Status of the MP3tunes Amarok Service</strong></p>
<p>The Good (Works)</p>
<ul>
<li>Browsing &#038; Streaming</li>
<li>Querymaker is as functional as possible with the current API</li>
<li>Manual Downloading from MP3tunes to Local Collection</li>
<li>Manual Uploading from any Collection to MP3tunes</li>
</ul>
<p>The Bad (Doesn&#8217;t work)</p>
<ul>
<li>AutoSync - 80%- <em>The code is there, however there are problems with the daemon not receiving signals from the MP3tunes&#8217; servers</em></li>
<li>MP3tunes playlists support - 0%- <em>Never got started on this</em></li>
</ul>
<p>The Ugly</p>
<p>There is one large issue I am still wrestling with. The details of the issue are complicated, but essentially it deals with the way Amarok handles remote tracks in playlists across sessions. Generally, remote tracks&#8217; metadata isn&#8217;t cached by Amarok for use between multiple sessions. So, if you add an mp3tunes track to a playlist in Amarok, then restart Amarok and try to play that playlist the mp3tunes track is blank. Now, there exists a method for retrieving that metadata, however it was originally implemented synchronously. When you are retrieving metadata for any significant number of tracks (10+) synchronously, and each one of those retreivals is an HTTP Get request you end up blocking the GUI thread. At Akademy I hacked a way to do this asynchronously, but it is a really nasty hack. I&#8217;ve got code on my computer that implements this feature correctly, but it has the nasty habit of crashing Amarok every so often.</p>
<p>Between classes, marching band, homework, and other responsibilities I&#8217;m working on getting this ironed out and committed. Hopefully this will happen before the 2.0 release, because right now using MP3tunes in Amarok across sessions is slow and annoying.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.binaryelysium.com/blog/2008/09/18/gsoc-wrap-up/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I&#8217;m Leaving on a Jet Plane&#8230;</title>
		<link>http://www.binaryelysium.com/blog/2008/07/30/leaving-on-a-jet-plane/</link>
		<comments>http://www.binaryelysium.com/blog/2008/07/30/leaving-on-a-jet-plane/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 22:14:10 +0000</pubDate>
		<dc:creator>Casey</dc:creator>
		
		<category><![CDATA[Life]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[amarok]]></category>

		<category><![CDATA[gsoc]]></category>

		<guid isPermaLink="false">http://binaryelysium.com/blog/?p=35</guid>
		<description><![CDATA[The ball has been dropped by me - dropped hard - during the past several weeks. First, I was stumped for a week and a half by the glib+qt fiasco, then my development machine&#8217;s hard drive shuffled off the mortal coil. Replacing it took a solid week, and when it finally arrived I installed Gentoo. [...]]]></description>
			<content:encoded><![CDATA[<p>The ball has been dropped by me - dropped hard - during the past several weeks. First, I was stumped for a week and a half by the glib+qt fiasco, then my development machine&#8217;s hard drive shuffled off the mortal coil. Replacing it took a solid week, and when it finally arrived I installed Gentoo. Two days later, the finally install completes as I&#8217;m frantically throwing my life&#8217;s possessions into a car:</p>
<ul>
<li>clothes</li>
<li>2 laptops</li>
<li>1 Target desk (retail $50)</li>
<li>assorted books</li>
<li>1 blow-up air mattress</li>
</ul>
<p>Fast forward through seven hours of me hurtling down the interstate at not-so-safe velocities, and here I am, pardoning my recent idleness as my flight to Paris boards at gate D32. Not accomplishing much over the past several weeks suddenly doesn&#8217;t seem so bad: I&#8217;m going to Europe! There is a week long hack-a-thon at Akademy; I&#8217;ll catch up then.</p>
<p><a href="http://akademy.kde.org"><img alt="Im Going to Akademy" src="http://blog.lydiapintscher.de/wp-content/igta2008.png" title="Im Going to Akademy" width="320" height="178" /></a></p>
<p>A bientôt!</p>
<p><embed src="http://www.seeqpod.net/cache/seeqpodSlimlineEmbed.swf" wmode="transparent" width="300" height="80" type="application/x-shockwave-flash" flashvars="domain=http://www.seeqpod.com&#038;playlistXMLPath=http://www.seeqpod.com/api/music/getPlaylist?playlist_id=f3ea4fd4e8"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://www.binaryelysium.com/blog/2008/07/30/leaving-on-a-jet-plane/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Another GSoC Mini Report</title>
		<link>http://www.binaryelysium.com/blog/2008/07/17/another-gsoc-mini-report/</link>
		<comments>http://www.binaryelysium.com/blog/2008/07/17/another-gsoc-mini-report/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 21:42:17 +0000</pubDate>
		<dc:creator>Casey</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[amarok]]></category>

		<category><![CDATA[gsoc]]></category>

		<category><![CDATA[mp3tunes]]></category>

		<guid isPermaLink="false">http://binaryelysium.com/blog/?p=33</guid>
		<description><![CDATA[I&#8217;ve been slacking on the update reports over the past two weeks, because I&#8217;m holding out for the exciting post where I say &#8220;MP3tunes AutoSync is working! Huzzah!&#8221; Sadly, this report isn&#8217;t that one.
For the past week I&#8217;ve been banging my head against the wall of glib, QtEventLoop, and QThreads. I have quite a headache [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been slacking on the update reports over the past two weeks, because I&#8217;m holding out for the exciting post where I say &#8220;MP3tunes AutoSync is working! Huzzah!&#8221; Sadly, this report isn&#8217;t that one.</p>
<p>For the past week I&#8217;ve been banging my head against the wall of glib, QtEventLoop, and QThreads. I have quite a headache to say the least, but yesterday thanks to <a href="http://amarok.kde.org/blog/categories/18-freespirit">my mentor</a> and <a href="http://www.monroe.nu/">Ian</a>, both Amarok developers, my head actually broke through that wall. Literally. GLIB, and Qt are kowtowing at my feet swearing oaths of fealty. They have promised to work together and let me get back to doing fun things, like code new features.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.binaryelysium.com/blog/2008/07/17/another-gsoc-mini-report/feed/</wfw:commentRss>
		</item>
		<item>
		<title>GSoC Mini Report</title>
		<link>http://www.binaryelysium.com/blog/2008/07/08/gsoc-mini-repor/</link>
		<comments>http://www.binaryelysium.com/blog/2008/07/08/gsoc-mini-repor/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 08:17:35 +0000</pubDate>
		<dc:creator>Casey</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[amarok]]></category>

		<category><![CDATA[gsoc]]></category>

		<category><![CDATA[mp3tunes]]></category>

		<guid isPermaLink="false">http://binaryelysium.com/blog/?p=32</guid>
		<description><![CDATA[Some non-Summer-of-Code related business popped up over the weekend, to take care of which required a slight road-trip. As such, I haven&#8217;t had much time to work on my project, however I&#8217;m heading back home today and I plan to get the code I have chilling in my local branch pushed to the main subversion [...]]]></description>
			<content:encoded><![CDATA[<p>Some non-Summer-of-Code related business popped up over the weekend, to take care of which required a slight road-trip. As such, I haven&#8217;t had much time to work on <a href="http://binaryelysium.com/blog/2008/04/05/google-summer-of-code-one-intro-with-a-side-order-of-awesome/">my project</a>, however I&#8217;m heading back home today and I plan to get the code I have chilling in my local branch pushed to the main subversion repository.</p>
<p>Surprisingly, bulleted lists seem to be the most concise means to list progress [/sarcasm]</p>
<ul>
<li>Still working on Harmony integration.</li>
<li>Harmony authentication is working (Thanks Lateralus from MP3tunes!).</li>
<li>The daemon is receiving notification updates.</li>
<li>Notification processing is what I&#8217;m working on now.</li>
</ul>
<p>While looking at my last couple reports about harmony, I realized that the information is somewhat  dry. I think this is because harmony is a highly technical, behind the scenes feature, and, also, often it is difficult to inject excitement into mundane programming updates. The humdrum is slightly symbolic of harmony. You will enable it once and forget about it as it silently keeps your music collection synced.</p>
<p>Related posts: <a href="http://binaryelysium.com/blog/2008/07/02/gsoc-report-week-5/">GSoC Report Week 5: Harmonizing Amarok</a>, <a href="http://binaryelysium.com/blog/2008/06/20/one-small-step-for-amarok/">One small step for Amarok…</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.binaryelysium.com/blog/2008/07/08/gsoc-mini-repor/feed/</wfw:commentRss>
		</item>
		<item>
		<title>GSoC Report Week 5: Harmonizing Amarok</title>
		<link>http://www.binaryelysium.com/blog/2008/07/02/gsoc-report-week-5/</link>
		<comments>http://www.binaryelysium.com/blog/2008/07/02/gsoc-report-week-5/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 08:21:10 +0000</pubDate>
		<dc:creator>Casey</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[amarok]]></category>

		<category><![CDATA[gsoc]]></category>

		<category><![CDATA[mp3tunes]]></category>

		<guid isPermaLink="false">http://binaryelysium.com/blog/?p=31</guid>
		<description><![CDATA[Project: MP3tunes + Amarok Integration
Total Commits: 106 Weekly Commits: 26
Past 7 Days
I usually aim to post these reports on Monday, but I&#8217;m usually wrapping up a final commit or two on Monday night so I wait till Tuesday to post the report. Well now it&#8217;s 3:30 on Wednesday morning and I&#8217;m just starting. My last [...]]]></description>
			<content:encoded><![CDATA[<h4>Project: <a href="http://www.mp3tunes.com">MP3tunes</a> + <a href="http://www.amarok.kde.org">Amarok</a> Integration</h4>
<p><span style="font-size:8pt">Total Commits: <a href="http://kollide.net:8060/changelog/~author=link/Amarok" title="All my Amarok commits">106</a> Weekly Commits: 26</span><br />
<h4><a name="past">Past 7 Days</a></h4>
<p>I usually aim to post these reports on Monday, but I&#8217;m usually wrapping up a final commit or two on Monday night so I wait till Tuesday to post the report. Well now it&#8217;s 3:30 on Wednesday morning and I&#8217;m just starting. My last commit for &#8220;this week&#8221; was, oh, about 30 seconds ago.</p>
<p>During the last 7 days I:</p>
<ul>
<li>Patched libmp3tunes to support track fetching based off a filekey.</li>
<li>Used the aforementioned patch in Amarok to enable saving of MP3tunes tracks to playlists.</li>
<li>Made the MP3tunes Service &#8220;Lazy Load&#8221; upon Amarok&#8217;s start-up.</li>
<li>Fixed misc non-mp3tunes related Amarok bugs.</li>
<li>Added libmp3tunes::Harmony to the source tree.</li>
<li>Created a harmony daemon that runs asynchronously within Amarok.</li>
</ul>
<p>As usual you can see a list of my most recent commits via my <a href="http://kollide.net:8060/changelog/~author=link/Amarok">fisheye</a> page.</p>
<p><strong>What the heck is this Harmony nonsense?</strong></p>
<p>Harmony, itself, is a subset of libmp3tunes that provides an api for receiving event notifications from the MP3tunes servers. Essentially, what it boils down to is harmony enables the MP3tunes servers to notify Amarok when a user&#8217;s Locker has been changed. This will allow Amarok to assess the changes and perform an appropriate action (e.g., download a new track). </p>
<p>Suppose Jenni buys a song from <a href="http://www.eclassical.com/">eClassical</a> and has it loaded directly to her locker. When this happens her Amarok will receive a notification: <em>&#8220;Hey Amarok, Jenni just had a track added to her locker.&#8221;</em> At which point Amarok will seamlessly download the track to Jenni&#8217;s local collection.<br />
<h4><a name="upcoming">Upcoming 7 Days</a></h4>
<p>Pretty cool right? Sure is, there&#8217;s just one caveat: it&#8217;s not working yet. Getting harmony to play nice with Amarok was a challenge that took a couple days, but as of this morning harmony is running in Amarok.</p>
<p>By this time next week I plan to have harmony fully integrated with Amarok, so the above scenario can actually take place. Even though the feature freeze that was announced for Amarok 2.0 technically doesn&#8217;t include me, I will still be taking some time to polish all the work I&#8217;ve done since May.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.binaryelysium.com/blog/2008/07/02/gsoc-report-week-5/feed/</wfw:commentRss>
		</item>
		<item>
		<title>GSoC Report Week 4</title>
		<link>http://www.binaryelysium.com/blog/2008/06/24/gsoc-report-week-4/</link>
		<comments>http://www.binaryelysium.com/blog/2008/06/24/gsoc-report-week-4/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 20:23:38 +0000</pubDate>
		<dc:creator>Casey</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[amarok]]></category>

		<category><![CDATA[gsoc]]></category>

		<category><![CDATA[mp3tunes]]></category>

		<guid isPermaLink="false">http://binaryelysium.com/blog/?p=30</guid>
		<description><![CDATA[Project: MP3tunes + Amarok Integration
Total Commits: 84 Weekly Commits: 36
Past 7 Days
Starting these posts with &#8220;It was another busy week..&#8221; is starting to get boring; I&#8217;ll cook up something more exciting for next week.
In case you missed it, in the past seven days history has been made. I&#8217;ll let that stand in as the bulk [...]]]></description>
			<content:encoded><![CDATA[<h4>Project: <a href="http://www.mp3tunes.com">MP3tunes</a> + <a href="http://www.amarok.kde.org">Amarok</a> Integration</h4>
<p><span style="font-size:8pt">Total Commits: <a href="http://kollide.net:8060/changelog/~author=link/Amarok" title="All my Amarok commits">84</a> Weekly Commits: 36</span><br />
<h4><a name="past">Past 7 Days</a></h4>
<p>Starting these posts with &#8220;It was another busy week..&#8221; is starting to get boring; I&#8217;ll cook up something more exciting for next week.</p>
<p>In case you missed it, in the past seven days <a href="http://binaryelysium.com/blog/2008/06/20/one-small-step-for-amarok/">history has been made</a>. I&#8217;ll let that stand in as the bulk of my weekly report, but a few worthwhile things have occurred since then that deserve a mention.</p>
<p>Remote Track Upload - You can now sideload tracks to your MP3tunes collection from remote sources in Amarok. What the heck is sideload and what remote sources you ask? Sideload is a feature of the MP3tunes API that allows for server-to-server transfers. This means you can give your Locker a URL to a track, and it will automatically be downloaded into your Locker. Currently Amarok sports three services with remote collections that are sideloadable to MP3tunes: Ampache, Magnatune, and Jamendo. This method of transferring is generally very fast, because the transfer bypasses your slow internet connection.</p>
<p>Upload Progress Bar - When you upload (or sideload) tracks to MP3tunes there is now a simple status bar to let you know how far along in the process you are. </p>
<p>Non-Supported Track Filtering - This one is simple: If you try and upload a file-type that MP3tunes doesn&#8217;t support, Amarok will tell you and stop that track from being transferred.<br />
<h4><a name="upcoming">Upcoming 7 Days</a></h4>
<ul>
<li>Work on allowing MP3tunes tracks to persist after a restart.</li>
<li>Flesh out the synchronization system: what it&#8217;s going to do, and how it&#8217;s going to do it.</li>
<li>Design any UI widgets needed for the syncing system</li>
</ul>
<p>The first one will be simple, in fact I plan to code it up after writing this report. These second and third tasks, however, signify that I&#8217;m moving into the last stage of the project. According to my original proposal I am ahead by a week, so I&#8217;ll be using this week as extra time to plan and get a jump-start on the synchronization framework.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.binaryelysium.com/blog/2008/06/24/gsoc-report-week-4/feed/</wfw:commentRss>
		</item>
		<item>
		<title>One small step for Amarok&#8230;</title>
		<link>http://www.binaryelysium.com/blog/2008/06/20/one-small-step-for-amarok/</link>
		<comments>http://www.binaryelysium.com/blog/2008/06/20/one-small-step-for-amarok/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 12:07:34 +0000</pubDate>
		<dc:creator>Casey</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[amarok]]></category>

		<category><![CDATA[gsoc]]></category>

		<category><![CDATA[mp3tunes]]></category>

		<guid isPermaLink="false">http://binaryelysium.com/blog/?p=27</guid>
		<description><![CDATA[I&#8217;m very excited to announce that the first Amarok->Cloud transfer has taken place. Just moments ago, for the first time ever (as far as I&#8217;m aware), a track was sent up into the Cloud from a desktop media player, escaping the local collection prison. This track shed the chains of limited accessibility, and is no [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m very excited to announce that the first Amarok->Cloud transfer has taken place. Just moments ago, for the first time ever (as far as I&#8217;m aware), a track was sent up into the Cloud from a desktop media player, escaping the local collection prison. This track shed the chains of limited accessibility, and is no longer doomed to obscurity, lost in an sql database in my home directory.</p>
<p>This lucky track happened to be <a href="http://www.last.fm/music/Brad+Sucks/_/Making+Me+Nervous" title="Making Me Nervous">Making Me Nervous</a> by <a href="http://www.magnatune.com/artists/brad_sucks" title="Brad Sucks">Brad Sucks</a> available over at the great indie music label <a href="http://www.magnatune.com" title="Magnatune: Independent Music">Magnatune</a>.</p>
<div style="width: 220; text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="220" height="15" ><param name="allowScriptAccess" value="sameDomain"/><param name="movie" value="http://embed.magnatune.com/img/magnatune_player_embedded_single.swf?playlist_url=http://embed.magnatune.com/artists/albums/bradsucks-dontknow/hifi.xspf&#038;autoload=true&#038;autoplay=&#038;playlist_title=I%20Dont%20Know%20What%20Im%20Doing%20:%20Brad%20Sucks"/><param name="quality" value="high"/><param name="bgcolor" value="#E6E6E6"/><embed src="http://embed.magnatune.com/img/magnatune_player_embedded_single.swf?playlist_url=http://embed.magnatune.com/artists/albums/bradsucks-dontknow/hifi.xspf&#038;autoload=true&#038;autoplay=&#038;playlist_title=I%20Dont%20Know%20What%20Im%20Doing%20:%20Brad%20Sucks" quality="high" bgcolor="#E6E6E6" name="xspf_player" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="center" height="15" width="220"></embed></object><FONT FACE="Verdana, Arial, utopia, sans-serif" SIZE="1" COLOR="#000000"><br /><a href="http://magnatune.com/artists/albums/bradsucks-dontknow"><b>I Dont Know What Im Doing</b></a> by <a href="http://magnatune.com/artists/brad_sucks"><b>Brad Sucks</b></a></font></div>
<p>Early this morning I <a href="http://kollide.net:8060/changelog/~author=link/Amarok/?cs=15470">committed</a> the last bit of code that allows you to upload tracks to your <a href="http://www.mp3tunes.com/">MP3tunes Locker</a> from Amarok. Amarok is the first client, besides the official client, to allow you to do such a thing. One of the great things about this feature is it&#8217;s seamless integration in the UI.</p>
<p><a href='http://binaryelysium.com/images/amarokCopyToMp3tunes.png'>Click for the full view<br />
<img src="http://binaryelysium.com/blog/wp-content/uploads/2008/06/amarokcopytomp3tunes-300x170.png" alt="Amarok 2: Copy to Mp3tunes" title="Amarok 2: Copy to Mp3tunes" width="300" height="170" class="aligncenter size-medium wp-image-28" /></a></p>
<p>After a short upload I go check the MP3tunes Web Player<br />
<a href='http://binaryelysium.com/images/mp3tunesBrad.png'><img src="http://binaryelysium.com/blog/wp-content/uploads/2008/06/mp3tunesbrad-300x229.png" alt="Listening to Brad Sucks via MP3tunes" title="Listening to Brad Sucks via MP3tunes" width="300" height="229" class="alignnone size-medium wp-image-29" /></a></p>
<p>From this point I can listen to the track on my phone, on my squeezebox, or any other <a href="http://www.mp3tunes.com/partner/cb/partnerlist">MP3tunes supported devices</a>.</p>
<p>Of course there are some caveats, but I aim to fix these over the next several days:</p>
<ul>
<li>No upload progress information.</li>
<li>No error handling when you attempt to upload a filetype mp3tunes doesn&#8217;t support.</li>
<li>It&#8217;s not possible to upload non-local content (say from magnatune or ampache)</li>
</ul>
<p>Don&#8217;t start thinking that things are winding down; uploading and downloading are only one small part of the show. The end goal is <em>fully automated bi-directional syncing</em> between Amarok and MP3tunes with 100% support for the MP3tunes API.</p>
<p>What exactly does this entail? </p>
<ol>
<li>I foresee a &#8220;keep in sync with MP3tunes&#8221; checkbox for each playlist in the Amarok playlist browser, so you can add/remove tracks from your favorite playlists and thoughtlessly have access to them on any MP3tunes enabled device. </li>
<li>Imagine clicking &#8220;Purchase&#8221; at an online music store (like <a href="http://www.eclassical.com/">eclassical</a>) and having the tracks instantly available in Amarok and anywhere else you have access to your locker.</li>
<li>Your friend beams you a track from his Android phone to your Android phone while you are out on the town, and when you get home the track is all ready in your local Amarok collection,  added to your smart playlists ready to jam.</li>
<li>You subscribe to an awesome podcast using Amarok&#8217;s built in podcast directory, and seconds after a new episode is released it&#8217;s available on your wifi enabled portable player (or phone)  </li>
</ol>
<p>And it all started today.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.binaryelysium.com/blog/2008/06/20/one-small-step-for-amarok/feed/</wfw:commentRss>
		</item>
		<item>
		<title>GSoC Report Week 3: Tanstaafl</title>
		<link>http://www.binaryelysium.com/blog/2008/06/17/gsoc-report-week-3-tanstaafl/</link>
		<comments>http://www.binaryelysium.com/blog/2008/06/17/gsoc-report-week-3-tanstaafl/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 20:16:03 +0000</pubDate>
		<dc:creator>Casey</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[amarok]]></category>

		<category><![CDATA[gsoc]]></category>

		<guid isPermaLink="false">http://binaryelysium.com/blog/?p=26</guid>
		<description><![CDATA[Project: MP3tunes + Amarok Integration
Total Commits: 51 Weekly Commits: 12
Past 7 Days
It was another productive week in #amarok with over 150 commits! In the 12 of those that were mine I managed to do several things.

Added elegant session handling to the MP3tunes service
Fixed the collection search box, so you can filter your MP3tunes Locker.
Enabled Copy [...]]]></description>
			<content:encoded><![CDATA[<h4>Project: <a href="http://www.mp3tunes.com">MP3tunes</a> + <a href="http://www.amarok.kde.org">Amarok</a> Integration</h4>
<p><span style="font-size:8pt">Total Commits: <a href="http://kollide.net:8060/changelog/~author=link/Amarok" title="All my Amarok commits">51</a> Weekly Commits: 12</span><br />
<h4><a name="past">Past 7 Days</a></h4>
<p>It was another productive week in #amarok with over 150 commits! In the 12 of those that were mine I managed to do several things.</p>
<ul>
<li>Added elegant session handling to the MP3tunes service</li>
<li>Fixed the collection search box, so you can filter your MP3tunes Locker.</li>
<li>Enabled Copy To Collection functionality, so you can now copy (read: download) mp3tunes tracks to some other collection!</li>
</ul>
<p>Of course, implementing those items wasn&#8217;t as simple as it sounds, but the features are essential and basic.</p>
<p>The search box (filtering) could use some improvement as currently it only filters via the artist field, but that is a limitation of the MP3tunes API. When I say it<br />
<em>&#8220;only filters via the artist field&#8221;</em> I mean that it only matches against artists, so searching for a particular track name will not work. To fully support the filtering feature the MP3tunes API would need to allow you to do something like get a list of artists based on a partial track name in a single request. That is just one example, and yes, I could workaround it by doing multiple queries, however that would slow the entire operation significantly. Users expect the search fields in Amarok to be snappy, not take ~5 seconds per. token they supply. It is certainly not a showstopper, and it functions well enough for now, but hopefully MP3tunes will be open to expanding their API later on down the rode. To be fair I have never come across a web API that supported that sort of complex searching. The <a href="http://ampache.org" title="Ampache!">Ampache</a> service in Amarok suffers from the same lack of functionality.</p>
<p><em>Interjection: Major props to my GSoC mentor, <a href="http://amarok.kde.org/blog/categories/18-freespirit">Nikolaj</a>, for attempting to explain various parts of Amarok&#8217;s innards to me, not only once, but the several times it took to get the concepts through my thick skull. Also, he&#8217;s helped me track down several childish mistakes I&#8217;ve made when I was at my wits end trying to locate them. I can&#8217;t thank him enough. Hands down he&#8217;s the best GSoC mentor. </em></p>
<p>With the addition of &#8220;Copy to Collection&#8221; Amarok has taken a large step towards being fully integrated with MP3tunes. Up till this week all you could do was browse and stream your MP3tunes Locker. That is fine and dandy, but you could do that from the MP3tunes <a href="http://www.binaryelysium.com/images/mp3tunesPlayer.png">web player</a>, their <a href="http://mp3tunes/com/m">mobile player</a>, <a href="http://www.mp3tunes.com/cb/screenshots/" title="MP3tunes Screenshots">your PS3</a>, or any other number of their <a href="http://www.mp3tunes.com/partner/cb/partnerlist" title="mp3tunes devices">supported devices</a>. However, none of those options allow you to seamlessly download and organize your stored music into your local music collection at the click of a button.  </p>
<p>There is one shortcoming that needs to be addressed at some point before I&#8217;m satisfied: there is no progress indicator of any kind when you download tracks. The only way to see if tracks are being downloaded after you press Go is to watch the destination directory for changes. Thankfully this affects all collections you can &#8220;copy to/from&#8221;, not just MP3tunes, so perhaps someone else will feel inclined to whip up a progress indicator. There&#8217;s no such thing as a free lunch.<br />
<h4><a name="upcoming">Upcoming 7 Days:</a></h4>
<p>I have one big goal this week:</p>
<ul>
<li>Add MP3tunes Upload features</li>
</ul>
<p>By Monday next week, you will be able to do Copy tracks from your local collection, Ampache collection, and the <a href="http://www.magnatune.com" title="www.magnatune.com">Magnatune</a> database, to your MP3tunes locker.</p>
<p><img src='http://www.binaryelysium.com/images/amarokCopyToCollection.png' alt='Copy to Collection' class='aligncenter' /></p>
<p>There is quite a bit of work to be done before this can happen, but I will spare you the gritty implementation details until next week after I&#8217;ve committed the code where my mouth is (?).</p>
<p>Of course my weekly predictions wouldn&#8217;t be complete without a task to fall back on if I happen to complete the aforementioned task in a Ballmer-Fueled rage. After upload is in place there is only one major item left: Syncing. I need to break &#8220;Syncing&#8221; into manageable actionables (quite a term, eh?) and then lay out some mid-level designs for the process. Later on during the week I will dedicate an entire post to this topic.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.binaryelysium.com/blog/2008/06/17/gsoc-report-week-3-tanstaafl/feed/</wfw:commentRss>
		</item>
		<item>
		<title>GSoC Report Week 2: libmp3tunes goodness</title>
		<link>http://www.binaryelysium.com/blog/2008/06/10/gsoc-report-week-2-libmp3tunes-goodness/</link>
		<comments>http://www.binaryelysium.com/blog/2008/06/10/gsoc-report-week-2-libmp3tunes-goodness/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 16:31:32 +0000</pubDate>
		<dc:creator>Casey</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[amarok]]></category>

		<category><![CDATA[gsoc]]></category>

		<guid isPermaLink="false">http://binaryelysium.com/blog/?p=24</guid>
		<description><![CDATA[Project: MP3tunes + Amarok Integration
Total Commits: 35 Weekly Commits: 15
Past 7 Days
This was a busy week. I migrated the existing MP3tunes service in Amarok 2 from making REST calls and parsing XML manually to use libmp3tunes. I created an object oriented encapsulation framework in C++ for libmp3tunes, which is written entirely in c. This means [...]]]></description>
			<content:encoded><![CDATA[<h4>Project: <a href="http://www.mp3tunes.com">MP3tunes</a> + <a href="http://www.amarok.kde.org">Amarok</a> Integration</h4>
<p><span style="font-size:8pt">Total Commits: <a href="http://kollide.net:8060/changelog/~author=link/Amarok" title="All my Amarok commits">35</a> Weekly Commits: 15</span><br />
<h4><a name="past">Past 7 Days</a></h4>
<p>This was a busy week. I migrated the existing MP3tunes service in Amarok 2 from making REST calls and parsing XML manually to use libmp3tunes. I created an object oriented encapsulation framework in C++ for libmp3tunes, which is written entirely in c. This means instead of mucking about crafting http queries and worrying about parsing data from XML one can manipulate the Locker in an OO fasion. Here&#8217;s a little snippet of how libmp3tunes saves work.</p>
<p>Without libmp3tunes if you wanted to fetch a list of artists this is what it would look like:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code"><pre class="cpp cpp" style="font-family:monospace;">    QString urlString <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;http://ws.mp3tunes.com/api/v1/lockerData?sid=&lt;SESSION_ID&gt;&amp;partner_token=&lt;PARTNER_TOKEN&gt;&amp;output=xml&amp;type=artist&quot;</span>;
&nbsp;
    urlString <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;http://ws.mp3tunes.com/api/v1/lockerSearch?output=xml&amp;sid=&lt;SESSION_ID&gt;&amp;partner_token=&lt;PARTNER_TOKEN&gt;&amp;type=artist&amp;s=&quot;</span> <span style="color: #000040;">+</span> m_artistFilter;
&nbsp;
    urlString.<span style="color: #007788;">replace</span><span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">&quot;&lt;SESSION_ID&gt;&quot;</span>, m_sessionId<span style="color: #008000;">&#41;</span>;
    urlString.<span style="color: #007788;">replace</span><span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">&quot;&lt;PARTNER_TOKEN&gt;&quot;</span>, CENSORED<span style="color: #008000;">&#41;</span>;
&nbsp;
    debug<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;url: &quot;</span> <span style="color: #000080;">&lt;&lt;</span> urlString;
&nbsp;
    m_storedTransferJob <span style="color: #000080;">=</span>  KIO<span style="color: #008080;">::</span><span style="color: #007788;">storedGet</span><span style="color: #008000;">&#40;</span>  KUrl<span style="color: #008000;">&#40;</span> urlString <span style="color: #008000;">&#41;</span>, KIO<span style="color: #008080;">::</span><span style="color: #007788;">NoReload</span>, KIO<span style="color: #008080;">::</span><span style="color: #007788;">HideProgressInfo</span> <span style="color: #008000;">&#41;</span>;
        connect<span style="color: #008000;">&#40;</span> m_storedTransferJob, <span style="color: #0000ff;">SIGNAL</span><span style="color: #008000;">&#40;</span> result<span style="color: #008000;">&#40;</span> KJob <span style="color: #000040;">*</span> <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span>
            , <span style="color: #0000dd;">this</span>, SLOT<span style="color: #008000;">&#40;</span> artistDownloadComplete<span style="color: #008000;">&#40;</span> KJob <span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span>;
&nbsp;
    ArtistList artists;
&nbsp;
     <span style="color: #666666;">//so lets figure out what we got here:</span>
    QDomDocument doc<span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">&quot;reply&quot;</span> <span style="color: #008000;">&#41;</span>;
    doc.<span style="color: #007788;">setContent</span><span style="color: #008000;">&#40;</span> m_storedTransferJob<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>data<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span>;
    QDomElement root <span style="color: #000080;">=</span> doc.<span style="color: #007788;">firstChildElement</span><span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">&quot;mp3tunes&quot;</span> <span style="color: #008000;">&#41;</span>;
    root <span style="color: #000080;">=</span> root.<span style="color: #007788;">firstChildElement</span><span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">&quot;artistList&quot;</span> <span style="color: #008000;">&#41;</span>;
&nbsp;
    QDomNode n <span style="color: #000080;">=</span> root.<span style="color: #007788;">firstChild</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>;
    <span style="color: #0000ff;">while</span><span style="color: #008000;">&#40;</span> <span style="color: #000040;">!</span>n.<span style="color: #007788;">isNull</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        QDomElement e <span style="color: #000080;">=</span> n.<span style="color: #007788;">toElement</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>; <span style="color: #666666;">// try to convert the node to an element.</span>
&nbsp;
        QDomElement element <span style="color: #000080;">=</span> n.<span style="color: #007788;">firstChildElement</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;artistName&quot;</span><span style="color: #008000;">&#41;</span>;
        ServiceArtist <span style="color: #000040;">*</span> artist <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> ServiceArtist<span style="color: #008000;">&#40;</span> element.<span style="color: #007788;">text</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span>;
&nbsp;
        element <span style="color: #000080;">=</span> n.<span style="color: #007788;">firstChildElement</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;artistId&quot;</span><span style="color: #008000;">&#41;</span>;
        artist<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>setId<span style="color: #008000;">&#40;</span> element.<span style="color: #007788;">text</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>.<span style="color: #007788;">toInt</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span>;
&nbsp;
        ArtistPtr artistPtr<span style="color: #008000;">&#40;</span> artist <span style="color: #008000;">&#41;</span>;
&nbsp;
        artists.<span style="color: #007788;">push_back</span><span style="color: #008000;">&#40;</span> artistPtr <span style="color: #008000;">&#41;</span>;
&nbsp;
        m_collection<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>acquireWriteLock<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>;
        m_collection<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>addArtist<span style="color: #008000;">&#40;</span> artistPtr <span style="color: #008000;">&#41;</span>;
        m_collection<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>releaseLock<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>;
&nbsp;
        n <span style="color: #000080;">=</span> n.<span style="color: #007788;">nextSibling</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>;
    <span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>With libmp3tunes it looks like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="cpp cpp" style="font-family:monospace;">    Mp3tunesArtistFetcher <span style="color: #000040;">*</span> artistFetcher <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> Mp3tunesArtistFetcher<span style="color: #008000;">&#40;</span> m_locker <span style="color: #008000;">&#41;</span>;
    connect<span style="color: #008000;">&#40;</span> artistFetcher, <span style="color: #0000ff;">SIGNAL</span><span style="color: #008000;">&#40;</span> artistsFetched<span style="color: #008000;">&#40;</span> QList<span style="color: #000080;">&lt;</span>Mp3tunesLockerArtist<span style="color: #000080;">&gt;</span> <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span>, <span style="color: #0000dd;">this</span>, SLOT<span style="color: #008000;">&#40;</span> artistDownloadComplete<span style="color: #008000;">&#40;</span> QList<span style="color: #000080;">&lt;</span>Mp3tunesLockerArtist<span style="color: #000080;">&gt;</span> <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span>;
&nbsp;
    ThreadWeaver<span style="color: #008080;">::</span><span style="color: #007788;">Weaver</span><span style="color: #008080;">::</span><span style="color: #007788;">instance</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>enqueue<span style="color: #008000;">&#40;</span> artistFetcher <span style="color: #008000;">&#41;</span>;
&nbsp;
    ArtistList artists;
&nbsp;
    foreach<span style="color: #008000;">&#40;</span>Mp3tunesLockerArtist artist, artistList<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
        ServiceArtist <span style="color: #000040;">*</span> serviceArtist <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> ServiceArtist<span style="color: #008000;">&#40;</span> artist.<span style="color: #007788;">artistName</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span>;
&nbsp;
        serviceArtist<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>setId<span style="color: #008000;">&#40;</span> artist.<span style="color: #007788;">artistId</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span>;
&nbsp;
        ArtistPtr artistPtr<span style="color: #008000;">&#40;</span> serviceArtist <span style="color: #008000;">&#41;</span>;
&nbsp;
        artists.<span style="color: #007788;">push_back</span><span style="color: #008000;">&#40;</span> artistPtr <span style="color: #008000;">&#41;</span>;
&nbsp;
        m_collection<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>acquireWriteLock<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>;
        m_collection<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>addArtist<span style="color: #008000;">&#40;</span> artistPtr <span style="color: #008000;">&#41;</span>;
        m_collection<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>releaseLock<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>;
&nbsp;
    <span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Both of those code samples produce this:</p>
<p><img src='http://binaryelysium.com/images/amarokMp3tunesCollectionBrowser.png' alt='MP3tunes Collection Browser' class='aligncenter' /></p>
<p>Notice that instead of looping through XML and ripping out data, I was able to call getter methods to retrieve the same data. Of course the XML parsing has only been moved to libmp3tunes, but by hiding the MP3tunes API implementation from Amarok it creates more maintainable code.</p>
<p>If none of that made much sense, no worries, the important bit to grasp is that libmp3tunes does these important things:</p>
<ul>
<li>Encapsulates the MP3tunes API so it is separate from the rest of Amarok.</li>
<li>Provides an Object Oriented interface to the mp3tunes API. Creating a new session is as easy as  Mp3TunesLocker locker = new Mp3tunesLocker();
<li>Ensures Amarok is officially supported by mp3tunes as long as they support libmp3tunes.</li>
</ul>
<h4><a name="upcoming">Upcoming 7 Days:</a></h4>
<p>There are a few libmp3tunes shortcomings. One is the lack of a means to detect when a session has expired. Each MP3tunes API request requires a valid session (except of course the initial session-establishing request), and each session times out eventually. When using MP3tunes in Amarok it will be important to elegantly handle session timeouts, for the user does not care about sessions or timeouts. When the user clicks play on an artist they expect it to play, while currently, if the session has timed out Amarok doesn&#8217;t do anything. This week I will patch libmp3tunes to support detection of timed out sessions. </p>
<p>Another goal for this week is to fix the search box, so it actually searches.</p>
<p><img src='http://www.binaryelysium.com/images/amarokMp3tunesSearch.png' alt='MP3tunes Collection Search' class='aligncenter' /></p>
<p>Also, if you right click on an artist in the MP3tunes collection browser you get a &#8220;Copy to Collection&#8221; option. At the moment it doesn&#8217;t do anything. After this week is over, hopefully, selecting the &#8220;Copy to Collection&#8221; option will let you do just that.</p>
<p><img src='http://www.binaryelysium.com/images/amarokCopyToCollection.png' alt='Copy to Collection' class='aligncenter' /><br />
<h4><a name="roadblocks">Foreseeable Roadblocks:</a></h4>
<p><a href="http://binaryelysium.com/blog/2008/06/02/gsoc-report-week-1/#roadblocks">Last week&#8217;s</a> roadblock still stands. In the next few weeks I&#8217;ll be getting closer to the time when I will need to implement that syncing part of libmp3tunes into Amarok. The licensing issue won&#8217;t stop me from developing it on my own workstation of course, but it will have to be resolved before I can commit that part of library or code that implements it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.binaryelysium.com/blog/2008/06/10/gsoc-report-week-2-libmp3tunes-goodness/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
