Morrigan on Android

December 22nd, 2010

In an idle moment in a spot of vacation leading up to Christmas and while everyone else does battle with The Snow, I though I would knock up a prototype Android app to work with my media player Morrigan. A couple of days later (don’t worry, I did remember to sleep) I have a something that is working rather better than previously expected. Actually building this app was only 60% Android development. The other 40% was beating Morrigan’s HTTP interfaces into shape – a worthwhile exercise as they are looking much more robust now (though there is still more functionality to add). Screen shots below:

In order, the 5 screens are:
1) Home screen – server list. Use the + button to add new servers. Long-hold servers to get a delete option.
2) Server screen – lists the artefacts on that server. First it lists players (there is usually only one, but can have more) followed by media databases.
3) Player view – get to by clicking a player item on the server screen. Should be self-explanatory. The search button allows you to search the DB currently being played from.
4) Media list view – shows some details about a specific database and the results of the last query.
5) Clicking a media item brings up a prompt to either play the item or add it to the queue.

It is purely a remote-control at the moment, but hopefully soon it will also you to pull media files to the phone, manage them there, and sync meta-data back to the server again. My current object is to get the mobile interface usable to the point that a head-less Morrigan can be run without too much command-line-for-everything faf.

No download-links yet as everything is still changing on daily basis as I add new function. But if anyone does want to have a play, please let me know and I will be happy to hook you up with working builds… and a development environment if desired :).

Morrigan on GitHub

November 30th, 2010

I have finally settled on using GitHub to manage Morrigan’s source code long term and to that end have begun to get properly acquainted with using git for development. I have always liked git’s approach to managing code and my first experience with GitHub’s support staff sold me on it – supported ticket resolved and closed in 7 minutes flat.

Moving Morrigan’s code from SVN to git is fairly straight forward. The more interesting challenge is going to be moving from private source to public source. I am going to licence the code under Apache 2 licence (this plays best with my employers’ interests) and I would like to be sure that the first copy of the code to hit the public is correctly marked, attributed etc. This means the fun of adding headers to all code files… but that’s ok as I already have a script for that.

I also want to come up with a clean method of separating my code from the binary dependencies it depends on.

As I am figuring this out I am initially only going to put one simple bundle on GitHub – once everything is cool the rest will follow. The initial bundle is just a crappy eclipse-ui-calender thing I wrote as a port of the app I was using on Windows before I moved to Linux. Its not as good but uses the same data files. Its really very crap. _._;;

The GitHub project can be found here:

Morrigan α5

October 18th, 2010

So its been aages since the last ‘release’ and since the codebase has been stable for a week and I have not encountered any issues while using it myself, I thought I might as well make another drop. Also it helps that when I tell people about this project, that there is a nice recent release for them to play with.

Much code has changed during this period with the most important new feature being the new DB structure which supports having both music/videos and pictures in the same DB (MMDB = Mixed Media Data Base), significantly simplifying both the UI and the backend-end. At lot else changed in the 416 revisions that occurred between releases, but since no one really used the previous release, listing the changes seems somewhat pointless*. Suffices to say that is version is at the very least a lot less buggy.

Builds for all 3 platforms can be found on the Morrigan project page.

Any issues, please let me know.

( * Note to self: remember to keep a nice “changes” list for next time. )

Morrigan’s CLI

September 7th, 2010

One really handy feature of OSGi is the ability to supplement the OSGi console with extra commands. This is particularly useful for creating very quick test/debug interfaces for each of you OSGi bundles. The console is only shown to the user when the OSGi environment is started from the CLI and and “-console” parameter is specified, so for general usage this can be left neatly hidden. So when things start to go a astray, you can just dive in and start poking around to see what is going on. In more advanced setups, the console can be tunnelled to a port and accessed via telnet or ssh.

As part of the headless version Morrigan, I have now added a handy CLI interface for testing / configuring it – essential until all this functionality makes it in to the WUI. Below is a summary of all the currently supported commands (copied form the help text).

For now I have grouped all the commands under a top-level command of ‘mn’ (short commands are easier to type). I am still working on this and trying to decide the best command structure, so suggestions are very welcome!

As an initially usability test, try and guess what all of these do. :D

mn media
mn media create <dbname>
mn media add <dir> <q1>
mn media scan <q1>
mn media <q1>
mn media <q1> <q2>
mn players
mn player 0
mn player 0 play
mn player 0 play <q1>
mn player 0 play <q1> <q2>
mn player 0 queue
mn player 0 queue <q1>
mn player 0 queue <q1> <q2>
mn player 0 queue clear
mn player 0 pause
mn player 0 stop
mn player 0 next
mn player 0 order <order>
mn play
mn play <q1>
mn play <q1> <q2>
mn queue
mn queue <q1>
mn queue <q1> <q2>
mn pause
mn stop
mn next
NOTE 1: <q1> = list, <q2> = item in <q1>.
NOTE 2: Only omit player ID when there is only one player.

I will be posting a build of the headless version in the next couple of days for general testing.

Morrigan α4

June 15th, 2010

Its been ages since α3 and during that time much has changed. Not a huge number of new features but there are, I feel, some significant improvements in the quality of the code base (I have done quite a lot of refactoring, debugging and optimising).

The most notable new feature is that there is now an embedded Jetty server. This provides two things: 1) a web UI to remote control Morrigan and 2) REST-like APIs for other apps to interact with. Also this server can be started on a headless server.

The existing web UI (WUI) is very primitive and is mostly a proof of concept. Once this is more detailed the headless mode will make a lot more sense. I hope to persuade a far better web developer than I to design that part. The WUI is also very hackable as the whole thing is contained in a .war file in the app’s root directory.

The REST-like API are also quite primitive, but the API for listing libraries and retrieving their content is quite functional. My initial proof that it works is that you can now use the Morrigan UI to browse the content of a library located on a remote machine. You can’t do anything with the list of tracks yet other than look at it, but this will improve soon. The server can send the media files, its just that I have not consumed this function yet.

Oh and aside for the web-server stuff, there are numerous other improvements and fixes. :)

As usual, builds for all 3 platforms can be found on the Morrigan project page.

A note for Mac users: The only java-compatible playback engine I know of that works on Mac is JMF, and so for now I am packing this with the mac build. To get it to play anything other than wav files, you may have to:
1) Install JMF on your system.
2) Build a custom JMF jar and feed it to Morrigan (put it in the engines dir). I had to do this on my XP box.
Feel free to ask if you need help with this.