Saturday, 29 March 2014

Update for 2014/03/29

So, I'm working on creating a music player daemon web front end that I can use from my phone, tablet, whatever, I am currently building it on top of a Raspberry Pi, however I've also ordered a BeagleBone Black to see what difference that makes.

While anyone could throw together a mpd server system on a Pi, I want a real system that responds in real time, complete with WebSockets support so that when one app/device makes the server do something, all clients will be updated.

I have decided to blog my progress and see where I can get, it helps to write all this stuff down.

I spent all last weekend learning Sockets.IO in Node.JS (my original implementation was in Python and used a LOT of polling) and getting the system on par with what I'd done in my Python interface.

I've now completely moved from Python/Django (it is a nice system, but WebSockets/Push Notifications were... Difficult and might very well have involved Node.JS anyway) and I'm already ahead of where I was.

That was last week, so what has happened since?

Along with learning how Node.JS works (module.exports, npm etc) I've been learning the various commands for MPD and creating a JavaScript library for interacting with the server.

I wanted a totally clean separation between the HTML (and other files a theme author might want to use) and the library. As such I developed an event driven library where theme authors will write call back functions to run when the server generates an event, this should allow full artistic freedom when building an interface.

So that's the big design which I am holding to, I have not yet designed a mechanism to implement changing of themes yet, but that will come (hell, since my library isn't complete the default theme isn't even fully developed yet).

What have I achieved so far?

So far, I've implemented five functions based upon the mpd 'setvol' command (up, down, mute, unmute and set), I've enabled data from the server to update part of the display, I've implemented pause, play, next, previous, repeat, shuffle.

I've also just finished implementing a means to get information on artists and albums stored in the MPD database for display in a to be designed user interface.

I'm also looking into cover art, using musicbrainz/coverart. I'm not sure how that works yet, but I'll get there I'm sure.

So I'll stop my rambling and get back to work. Once I'm close to getting the library stable enough to achieve everything MPD does I'll write up some API docs and release them for comment.


No comments:

Post a Comment