Archive for the ‘morrigan’ Category

Morrigan alpha 3 somewhat delayed

Wednesday, March 24th, 2010

My current dev build of Morrigan has a lot of new stuff compared to the a2 release. In theory it now matches all major functionality of terra and I have indeed now migrated to using Morrigan as my primary media player. And for the most part it is going well.

I would really like to now make another release, but I am hesitating for 2 reasons:
1. So far as I know, the only people who are going to test it use Linux, and the Linux build has a load of what I would class as really annoying defects, listed here.
2. I keep finding more bugs. Fixed 3 more tonight.

But it is working quite nicely on XP. So in light of point 2, I will keep using it myself and resist adding new features (I need a brake anyway) until I have gone a good length of time (5 days to a week) without finding any further serious defects. Then I will package up what ever I have and call it “alpha 3″, regardless of the known issues.

I guess this is how all software releases end up – its about know that none of your existing defects are blocking and that no new issues are arising.

Not that I really expect anyone else to really care about Morrigan, and I say this without sarcasm or remorse. This project was never intended to be any more that an opportunity for me to upgrade terra and get better at developing an actual product. Oh, and to prove to myself that I could do it. :D

When to deviate from conventions

Sunday, February 28th, 2010

When following conventions of working within a framework, it is import to know when to follow and when to deviate. As was once famously said, “Rules are there to make you think before you break them.”.

Previously I mused on the possibility of creating a fixed control bar across the top of Morrigan’s main window. This is, surprisingly, a completely supported feature of RCP and some experimentation this afternoon yielded this:

It is not wired up yet, but that should not take too long. I will also remove the menu bar and re-home the few unique commands it contains. The toolbar buttons that controlled lists will be moved to the top the list editors themselves. The video can then be shown in either a view, an editor or full screen (or as a last resort, at the right-hand end of the control bar).

Also Morrigan now has global hotkey support on both Windows and Linux. Well, on windows at least. Linux global hotkey support still has a fatal bug I have yet to solve.

GUI designs – frameworks and innovation without confusion?

Sunday, February 21st, 2010

Morrigan’s GUI as of today:

This weekend I have once again spent rather more time that planned working on Morrigan. Progress has mainly been in the area of playback and some GUI stuff. The big new feature is that video can now go full screen, and with terra you can chose which display this happens on.

The problem I am now up against is workout out where to put everything. In the world of RCP, the GUI is very definitively divided into discrete areas – Views and Editors. In Morrigan media lists (libraries and playlists) are editors and everything else are views. This all works quite nicely until we get to the player view.

A view has several key features:
- A main area.
- A caption bar across the top.
- A toolbar with icon buttons on it.
- A drop-down menu (click the little button circled in red below).

Some funky GUI logic allows the toolbar buttons to be moved into the tab area if there is space, otherwise they can end up sharing the same space as the caption bar. The drop-down menu is handy for hiding things… but that is just it. Its hidden. Placement of stuff is all rather flexible and with this power comes a world of GUI pain. While in theory views can be placed anywhere, some expectation of width is required as this dictates how many tool-bar icons you can get away with.

The layout shown in the screen shots here is my current best-attempt at coming up with a sane default layout. It works quite well… until you realise that I have dumped far too many options into the Player view drop-down menu.

Logic says I should pull some of them up onto the main tool-bar / menu-bar. This is indeed an option, but could cause confusion if I ever allow more than one Player view per window. This does not happen at the moment and I don’t see a huge demand for it, but so far I have been keeping this option open.

Another question is weather the video should be detached from the Player view into its own view / editor. (Import note here: Views and Editors can’t share the same “stack” of tabs – the Player view can’t be placed on top of playlists). The best way to arrange things will very much depend on the user’s screen size, so perhaps the best option is to allow all these and make it configurable? But I don’t want to cause too much confusion.

And I have not even begun to talk about the problem of placing the seek / progress bar. I could default the Player view to being long and thin along the top of the window, and arrange controls in it in a similar way to a more typical media player. RCP allows for views with no tab and which can’t be moved, so perhaps this would work here? But then were would the video go? In another view? Always in an editor? An editor that can’t be closed?

Here I have shown this along side the top of terra’s window.

One thing I always liked about terra’s interface was how I somehow managed to avoid too much GUI clutter. I am hoping that RCP will not force clutter upon Morrigan’s GUI.

I know text comments are no where near as powerful as standing round a black-board, but if reading this has given you some ideas, then any suggestions would be much appreciated.

Morrigan Alpha 2

Sunday, February 14th, 2010

For anyone interested, I have another (probably) stable build for Morrigan. Main new feature: DirectShow or GStreamer support, including video.

Well, There would be a Windows/DirectShow build, if it were not for the issues outlined my last post. Though if anyone wants a windows build with DirectShow, then please ask and I will rig something up :D.

But anyway, for anyone on Linux, this build should be a goodun.

morrigan.a2.linux.gtk.x86.zip

Known Issues:
- The list of file extensions used for library searching / open dialogue is hardcoded to what I can pay on windows. What can actually be played depends on the GStreamer codecs you have installed.
- On Ubuntu 9.10 I am seeing an issue where the video disappears (leaving an empty box) when the video panel is resized smaller. The video re-appears when the panel is made larger again (so just resize it pixel larger and that *should* fix it).
- On Ubuntu 8.10 playing wmv files sometimes crashes the whole thing with a segmentation fault error. Though I suspect this is a GStremer error. :p

JNI and media playback frameworks

Sunday, February 14th, 2010

In the last 2 days I have assembled 3 more playback engines for Morrigan, bring the count to a total of 4.

- SPI (as released before)
- Java Media Framework (JMF)
- DirectShow (native Windows)
- GStreamer (native Linux)

The addition of the 2 native plugins really does make Morrigan much more versatile. As DirectShow and GStreamer are the dominant frameworks on their respective platforms, Morrigan can now essentially play almost everything. This is cool because it means that CPU usage should be comparable to using any other media player on that OS.

While the GStreamer implementation fairly clean and even uses video-overlay to take advantage of hardware acceleration where available, my DirectShow plugin has an ugly skeleton hiding under the desk. To access DirectShow from java, I am using the DirectShow Java wrapper from http://www.humatic.de/htools/dsj.htm. This very functional library is implemented using JNI to talk to a .dll that it expects to be present on the Java Library-path.

I don’t know much about JNI, so the only supported method I know for getting .ddl files on the library-path is to specify them when launching the JVM. But I am using RCP and while it probably possible to do that, its really not a great approach. So this leaves me with the need to pull in the .dll onto the library-path at runtime. Turns out this is somewhat nastier than using Class Loaders, so after some research I ended up with the following monstrosity.


try {
clazz = ClassLoader.class;
Field field = clazz.getDeclaredField("sys_paths");
boolean accessible = field.isAccessible();
if (!accessible) field.setAccessible(true);
field.set(clazz, null);
} catch (Exception e) {
e.printStackTrace();
}
System.setProperty("java.library.path", "D:\\haku\\development\\eclipseWorkspace-java\\dsjtest\\lib");
System.load("D:\\haku\\development\\eclipseWorkspace-java\\dsjtest\\lib\\dsj.dll");

Hard-coded paths aside (this is easy to fix), this is really ugly. The use of reflection to modify the inner works of the ClassLoader is about as not supported as code gets. But at the moment I am out of other ideas…

So if you are reading this and understand this stuff, then please let me know the right way to do this! Thanks in advance.

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.