Things are moving along fairly well. We had a big storm here in the northeast, so I’ve been inside doing lots of programming:
- Scenes are now sorted alphabetically in the list
- Cues can be moved up and down in the playlist
- Playlists now support List Mode and Loop Mode and can be changed via menus or the GUI (needs some more work)
- Cleaned up the menus
- Scene List and Cue List now have popup context menus
- Added a Next button to easily get to the next song - it acts differently based on your List Mode and Loop Mode settings
- Refactored a number of pieces of code
There’s still a bunch of functionality I want to add and bugs I need to squash, but the major ones are:
- Application doesn’t really stop when you exit it
- Moving Cues up and down screws up Manual List Mode
- Popup menus for List/Loop Mode pops up at 0,0
- Add Song window doesn’t remember the last directory you were at
- New Adventure, Open Adventure, Close Adventure should stop the current song from playing.
I need to fix up this site and give a better description of the application so Google will start picking up on it ![]()
I also want to start doing some “field testing” - actually setting up some playlists and testing it out at a few sessions.
Did some more work tonight that makes the test version a little more usable:
- Double-clicking a scene now triggers it to start
- You can rename Cues
- Active Scene and Cues are marked with an asterik (for now)
- Converted the Cue list to a table that displays each Cue’s name and path
- When a song is done the app goes on to the next one (currently only implementing Random mode)
- Tweaked up the title bar of the app to follow the current adventure, scene and cue that’s active
Here’s a look at it:
I think at this point I could bring it to games and actually make use of it as a simple playlist tool.
So I’ve known for a while that my app has some memory problems - leaks and what not. My friend Chris pointed me to this nifty Java Profiler that plugs into Eclipse: YourKit
The main problem lies in the JMF Player and it’s associated GUI components. One problem was me not throwing away the unused component when I loaded a new song. I dealt with that and saw my memory usage go down tons.
JMF provides a Player Bean I should look into that lets you switch to different files without creating a new player.
After a little more persistence and Googling I was able to get the native libraries for both SWT and JMF to load seamlessly. They key points (these are very Windows specific):
- JAR up your DLLs and references them in the JNLP file: <resources os=”Windows”><nativelib href=”nativelibs.jar”/></resources>
- Load the native libraries manually in your Java app: System.loadLibrary(”jmutil”); System.loadLibrary(”jmdaud”); System.loadLibrary(”swt-win32-3063″);
- Make sure they’re in order. In my case jmutil needs to be loaded before jmdaud.
An additional resource that was helpful: Java Forums - Marc’s Web Start Kamasutra
All in all, Java Web Start is VERY nice.
The process of building, exporting and signing JARs was getting tiresome. Apparently ANT can help with that, so I’ll eventually be looking into that as well.
Whilst thinking about how I’d go about having people install my app I completely forgot about Java Web Start.
- Java Web Start Guide
- A nice walk-through of how to put everything together.
- Unofficial Java Web Start/JNLP FAQ
- Which answers the question Can I use native libraries for my apps? AND provides some sample Java code.
So I still need to do a little more work handling the native libraries (for SWT and JMF) before the install will really work seamlessly. Part of that process is figuring out the DLLs that JMF requires. That would allow me to package JMF as part as the app and not require a seperate download and install for it.
Oof! My post titles are getting painful!
On the train ride in this morning I figured out which File and Adventure menu items need to be disabled/enabled at various states of the application. Tonight I implemented that and some other basic behavior like renaming the adventure, renaming scenes, and the logic behind New, Open and Save.
Just as a quick test, I decided to see if it would run on another computer and, after a bit of fussing around, I got it to work. That got me wondering about how people would go about installing this app. The best bet would be a simple setup.exe that you run that does the majority of the work. A quick Google search led me to Inno Setup which is free! It works so well and is so simple to use that I will definitely be making a donation to the creator.
Another thing I wanted to quickly get in was a way to control the songs once they started playing. It’s going to take some time and effort to create an SWT version of the player GUI, so for now I’m using AWT/Swing inside of SWT/JFace. I followed the example on this page: Eclipse Cookbook Excerpt - Cooking with Eclipse, Part 2
I fall asleep last night re-reading about Object Serialization in O’Reilly’s Learning Java and tonight I quickly added the ability to save and open adventure files in my stripped down test app. Waddya know, it works!
There’s a bunch of logic I need to figure out regarding the File menu of the app. It seems to me that that is such a common thing to be dealt with that there should be a few common approaches to it, no? I’m not quite sure what to search for to try and find it though.
And no, I have no idea what the title of this post is supposed to mean
So the current plan is to make a stripped down version of the app so I can focus on learning how to deal with some of the more common challenges in developing an application: saving/loading data, UI response to user action, a consistent and intuitive UI.
Hopefully this will also results in some kind of test program to distribute to get feedback on whatever install process I come up with.
One thing I realize is necessary is coming up with an SWT/JFace component for the audio player. JMF has a default one, but it’s based on Swing. Fortunatley they have sample code showing you how to do just that: JMF: Code Sample - Custom Player GUI
Tonight was spent cleaning up my Eclipse projects - deleting old unused stuff, renaming some projects, trying to fix depedencies between a few…
I’m having a problem right now where I’m trying to use a class from another project inside my RCP project. I’ve tried several different approaches to try and get my RCP project to see the JAR that contains the external class, but no such luck. The only way I can actually get it to work is if I copy the external JAR into the project folder for the RCP project. That’s a pain if I ever updated that external JAR.
As much as I love the look of SWT/JFace, the one that was missing was the MDI interface that Swing has (Desktops). I want the user to be able to move and resize the 3 main pieces of the application (Audio Explorer, Libraries and Adventures).
Fortunately Eclipse comes to the rescue.


