Tag: Amarok

Amarok REST API

January 1, 2009 » Geek

I’ve been working on the guts of a REST API for Amarok though PHP and DCOP. Thought I’d share my JSON format because I’m proud of it. Also because I’m bound to lose the format file sooner or later.

There are two basic things you can do with Amarok: take an action and ask for information. So that’s how I broke it down, action and info blocks in every request.

Rather than codify it in any formal way I’m just going to show examples.

Action – Toggle play/pause condition
Request

Response

Action – Play and set the equalizer
Request

Response

Info – Get playing track album name
Request

Response

Info – Get playing track album name, artist and title.
Request

Response

Both – Go to next track, get that track artist.
Note: I have decided that when both action and info are present they will alternate execution starting on action (i.e. action 0 then info 0 then action 1 and so on.) Thus we will probably want to create a NOP at some point.
Request

Response

Making DCOP work with Apache and PHP

January 1, 2009 » Geek

I’ve been working on a design for a web technology based media frame (think digital photo frame that you can program). I have my hardware ducks in a row (ripped apart a laptop, rewired some buttons and flipped the screen around) and now I’m working on software. I put together a reasonable frame work and then decided to add some integration with Amarok. That got hairy fast.

I found a PHP5 DCOP library but no explanation on how to get it to work. Google got me to the point where I knew it was an environment variable thing (the command line dcop has to have access to an X display since DCOP uses X’s ICE protocol to do it’s thing). Unfortunately trying to set the DISPLAY in the exec call doesn’t work, never found out why. Neither did the next 100 things I tried.

Skipping past all that anger and frustration that brought me to a solution, and here it is.

BEWARE this isn’t really a safe way to run a server. If you want to do this, be sure that it is on a machine that can’t harm the rest of your network or files. If you know a better way or some tips on locking things down, please share!

This is all done assuming a Debian machine base.

1)
Make a full-fledged but restricted user. They must have an KDE login, and X must be running with them logged in. Let’s call our user notagoodidea for this example.
2)
Make apache2 run as your user by editing /etc/apache2/envvars

3)
Edit your run script to launch Apache with the DISPLAY variable set, so edit /etc/init.d/apache2 which will probably break on updates and makes me cringe.

4)
Restart everything and test it out.

It isn’t pretty but it gets the job done.

Amarok Just Gets Cooler

February 22, 2007 » Geek

It’s all in the details man. All of it. Okay not all of it, but a whole huge honkin lot of it.

I had added some Relient K albums to my playlist, but I wanted them higher in the list (right under Run Kid Run) so I selected and dragged them upwards. What did my eyes behold? Something I didn’t expect. I stuck the cover art from the albums right there next to the cursor.

How cool is that?

Now, I don’t know if this essentially useless feature is in any other music program, but it’s got me dragging stuff around and making little collages out of cover art.

You can click through for a full-desktop screenie if you really want to.

Amarok Dragging Album Art

Tags:

Amarok 1.4.2

August 31, 2006 » Geek

I just updated my install of Amarok, which is possibly the greatest music player / jukebox ever. I’d heard alot about the new version, most of it being about the new native capability to play last.fm radio streams without any hacks.

I have to say, I like the new version, it’s gotten a bit of a facelift and somethings have changed. I like the fact that your collection has alphabetic dividers, it makes it easier to find artists.

The site claims that it has added support for MTP devices, but I haven’t hooked my precious Zen MicroPhoto up to it yet. Anyway, just putting up a post recommending the new Amarok.