<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Guy Rutenberg &#187; Amarok</title>
	<atom:link href="http://www.guyrutenberg.com/tag/amarok/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.guyrutenberg.com</link>
	<description>Keeping track of what I do</description>
	<lastBuildDate>Wed, 16 Jun 2010 19:53:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using Amarok Generated Playlists (m3u) on Sansa Clip</title>
		<link>http://www.guyrutenberg.com/2009/07/11/using-amarok-generated-playlists-m3u-on-sansa-clip/</link>
		<comments>http://www.guyrutenberg.com/2009/07/11/using-amarok-generated-playlists-m3u-on-sansa-clip/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 18:23:39 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Amarok]]></category>
		<category><![CDATA[Sansa Clip]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=405</guid>
		<description><![CDATA[Few days ago, for the first time, I&#8217;ve created a playlist using Amarok for files on my Sansa Clip player. To my surprise (and disappointment) when I&#8217;ve unplugged my Sansa Clip and powered it, the playlist showed up empty, unlike playlists which originated in Windows. As I keep my music collection organized in Amarok, the [...]]]></description>
			<content:encoded><![CDATA[<p>Few days ago, for the first time, I&#8217;ve created a playlist using Amarok for files on my Sansa Clip player. To my surprise (and disappointment) when I&#8217;ve unplugged my Sansa Clip and powered it, the playlist showed up empty, unlike playlists which originated in Windows. As I keep my music collection organized in Amarok, the situation seemed to be very uncomfortable.</p>
<p>I&#8217;ve decided to compare one of the working playlist files and the &#8220;empty&#8221; Amarok generated playlist. Two things were noticeable:</p>
<ol>
<li>Amarok uses forward slashes, like in a Linux environment, and the working playlist used backward slashes.</li>
<li>The working playlist used relative paths without any prefix &#8211; directly beginning with the path. Amarok prefixed the relative paths with a dot-slash (./).</li>
</ol>
<p>After noticing those things I&#8217;ve modified my Amarok generated playlist to look like the Windows generated one, and voila, it worked. I tried going through Amarok&#8217;s configuration dialogs to find some option controlling the format of generated m3u playlists, but couldn&#8217;t find any (I&#8217;m using Amarok 1.4.10). So with my newly found wits I&#8217;ve looked for a way to make using the playlists easier. I&#8217;ve came up with the following one-liner:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;*.m3u&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> -I<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s/^\.\///;s/\//\\\\/g&quot;</span> <span style="color: #660033;">-i</span><span style="color: #ff0000;">''</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>The command should be run in the <code>MUSIC</code> directory of the Sansa Clip&#8217;s filesystem. It recursivey looks for m3u playlists and for each one strips any leading dot-slash and replaces forward slashes with backward ones. It can be used to easily convert all your playlists to the format understandable by Sansa Clip.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/07/11/using-amarok-generated-playlists-m3u-on-sansa-clip/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Amarok Sleep &#8211; Stop Playback After Specified Amount of Time</title>
		<link>http://www.guyrutenberg.com/2009/02/04/amarok-sleep-stop-playback-after-specified-amount-of-time/</link>
		<comments>http://www.guyrutenberg.com/2009/02/04/amarok-sleep-stop-playback-after-specified-amount-of-time/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 07:13:39 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Amarok]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=265</guid>
		<description><![CDATA[Amarok is my favourite music player. I like to listen to music when I go a sleep, but I don&#8217;t want the music to keep playing all night long. This is why I&#8217;ve added a sleep feature to radio.py. Unfortunately Amarok doesn&#8217;t have a built-in sleep functionality, but the Amarok developers left open door for [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://amarok.kde.org">Amarok</a> is my favourite music player. I like to listen to music when I go a sleep, but I don&#8217;t want the music to keep playing all night long. This is why I&#8217;ve added a sleep feature to <a href="/radiopy">radio.py</a>. Unfortunately Amarok doesn&#8217;t have a built-in sleep functionality, but the Amarok developers left open door for us to implement it with ease by means of interfaces allowing to control amarok from the command line.<br />
<span id="more-265"></span><br />
The first solution uses Amarok itself. The Amarok developers have provided means of controlling Amarok via the command-line. So we&#8217;ll combine this with the <code>sleep</code> command <code>sleep<code> command, and run the following in a console:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sleep 120m; amarok --stop</pre></div></div>

<p>This will cause Amarok to stop after 120 minutes. The <code>sleep</code> command takes a number and a suffix which can be one of s, m, h and d (for seconds, minutes, hours and days). You can use it to easily set the duration before the playback halts.</p>
<p>Another solution, a more general one, would be to use <a href="http://en.wikipedia.org/wiki/DCOP">DCOP</a>. Amarok provides a very extensive DCOP interface that allows to control most of its features, including of course stopping the playback. So we could also use</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sleep 1h; dcop amarok player stop</pre></div></div>

<p>To stop Amarok in one hour.</p>
<p>A little note about the last solution. This post is written for Amarok 1.4 and not 2.0 as I didn't switch yet to KDE 4. DCOP was replaced in KDE 4 by D-Bus and the last solution would probably not work. However you could probably easily adjust it to the new D-Bus interface.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/02/04/amarok-sleep-stop-playback-after-specified-amount-of-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.439 seconds -->
