Archive for the ‘dev/dream’ Category

Morrigan’s CLI

Tuesday, 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 Project media player – first alpha release

Sunday, February 7th, 2010

While development is still in early days, now seems like a nice time to gather some preliminary feed back. Hopefully this should give people a feel for what I am aiming for. Also I would like to catch any really nasty show-stopping bugs ASAP.

I have draft entries about some of the ideas I want to explore with this project which I will try and finish and post in the next few days.

Known issues:
– The playback engine implementation currently packaged, while being truly cross-platform, is somewhat flaky and will randomly reject certain malformed files.
– On Ubuntu (and other linux?) it will fail to play anything if a flash object is loaded. This is an issue with the non-free linux flash player.

License:
Obviously this is an alpha build and is intended for testing only. It is likely to explode randomly at any time. I have not decided on which (open source) licence to release under, so for now this alpha build is supplied “as is” – use at your own risk. For now, I reserve copyright on any content that is copyrightable.
These downloads contain 3rd party libraries: sqlitejdbc, mp3SPI, vorbisSPI and of course the Rich Client Platform.

Feedback:
Any and all feedback is greatly welcomed, particularly if you find a bug! And if you are feeling super keen, I have just set up a bug track at my mantis server here.

Download links:
Windows x86 32bit
Linux x86 32bit
Mac Cocoa x86 (i can’t test this one, so no idea if it works)

More platforms available on request.

dev/dream – awakening

Sunday, February 7th, 2010

My week.. well 5 days of coding are basically over, so to begin this entry, here is a transcript of my white-board-wiki todo-list as it currently is. These are not in order – on the board the sections are in a sort of circle.

General:
– Logging. it needs some.
– Handlers – fix my crap handler impl (this is an RCP thing).
– Icons – get some decent ones (ATM i am reusing terra icons).

Playback:
– back / pause buttons, etc.
– support multiple external playback engines.
– extra play order modes.
– read meta data (mainly track length).

Library:
– Queries (these will be savable sub-views of libraries).
– Store entry paths relative to source directories? (just an idea, might help with portability)

Playlists:
– save meta data.
– differentiate between saving metadata and saving the list content.

Preferences:
– configure playback engines.
– etc…

Of course, this does not cover any of the remaining big items on my list such as media repositories, meta data syncing and tagging. The next big thing to do is to take advantage of my newly externalised playback engine interface and write a decent one that makes morrigan actually usable for my every day needs. I have fond some promising leads on using DirectShow in java will probably start with this one. I know it will be windows only, but at least then morrigan will begin to complete with terra for compatibility. This is important – once I can start using morrigan instead of terra, I will have hit a strong mile-stone. And once I am using it with anger, I should be able to start properly hardening the code bade.

If anyone is interested in beta-testing, I should have a decent build to play with in the next couple of days. I can also make the beta source available, if anyone is interested.

dev/dream – end of ‘session’ 1

Wednesday, February 3rd, 2010

Progress: I can add and remove files from a playlist and doubleclicking them plays that file… providing its a .wav. I tried copying across the playback code from musicman and it seems to work, until you give it a .mp3 and it throws a unknown format exception. *sigh* As soon as i have finished writing this i am stopping to eat dinner.

Since pictures tell far more, here is a sample UI screen shot:

Current issues:
– Can’t play mp3 (when it should).
– My implementation of “? extends AbstractHandler implements IHandler”‘s execute() is really nasty but I can’t workout how I am *supposed* to do it.
– Standard java logging seems to be colliding with RCP – the console handler does not work. Needs further investigation.

fortunately, only the first of these is blocking. If i can clear that, then i can move on and start implementing the library.

dev/dream morrigan development week off to a late start

Tuesday, February 2nd, 2010

I was supposed to start yesterday, but Quilage stole Saturday and then I went back to my parents for a couple of days to pick up my luggage that took 3 weeks to get from Geneva to Epsom. Thanks for that, Thompson Travel. But I digress…

Initial progress is slow, but that is somewhat expected. Some time taken by re-familiarising my self with RCP stuff, the code I wrote before some time ago. But that all makes sense now and I have nearly finished a very basic playlist editor. All that is left is to link in the methods I have to read and write playlist files to the right bits of RCP. Once this is done, I get to actually try and make it play files.

This is the first major hurdle. Java is not renowned for its media APIs. To work around the myriad of different ways of playing media, I plan to abstract out the actual playback engine so that it can be pluggable. This should also help with cross-platform support. If I am really lucky, I should be able to use DirectShow on Windows and GStreamer on Linux. As for OSX, that’s an SEP.

The first iteration will only be able to play mp3 files, and will use the very simple playback mechanism Tsuki Chama uses in MusicMan. I am lead to believe its cross-platform (I should probably test this) and will do for now as I start to design the playback abstraction layer.

I have planned my work for this week into 4 slightly vague user stories.

1. A user can add local files to a playlist and play them.

2. A user can maintain a library of local media.

3. A user can check media out from a remote media repository.

4. A user can sync metadata against a remote media repository.

I know these are a little vague, but as most of the design process is exploratory they are a sufficient guide for now. Also these clearly don’t cover all the features I want to add, this is just what I think I can do in a week :S. And obviously at the moment, I am still on story 1.

I have a strange flow-chart on a scrap of paper next to me that describes all the interactions I want in the system. Soon I will digitise it and discuss the ideas.