I’ve now got RPGAM building and running for PC and Mac in Eclipse. The key is to use Eclipse’s User Libraries to define what libraries the build needs on each OS.
Still some things to iron out with Java Web Start, but hopefully that shouldn’t prove too difficult.
QuickTime definitely seems to perform better than JMF, but it’s sort of an odd requirement/install. You can to choose Custom Install for QuickTime and make sure you check off “QuickTime For Java”. Ideally the app should install everything it needs, but I don’t know if it’s possible (or legal) to do.
I guess I’ll also have to figure out some way to detect if JMF or QuickTime is available and let the user select which they want to use based on what’s available.
I’m debating wether I should start getting a basic RCP framework going and trying to get the program working inside of it. There are still a lot of basic things I need to finish up (like drag and drop) but I guess it doesn’t really make a difference where I get that working…
Finally, CVSDude is working out well so far. I haven’t had any problems using it. I’m still using a free account since I don’t need more space than what it provides at the moment.
So tonight I tried out the QuickTime version of the audio engine on the Mac and it works! Now the main thing holding back a Mac version is how funky SWT/JFace is on the Mac.
Maybe once the app is using RCP things will be happy. Though I can only assume it’s something I’m doing wrong since Eclipse uses SWT/JFace and looks fine. Only time (and lots of coding) will tell.
I’ve also been struggling a bit with getting some sort of version control going. I installed CVSNT on my laptop and it works fine, for the laptop. For some reason the Mac can’t access it. And I tried to set up CVS on the Mac, but it doesn’t seem to want to work at all. I toyed briefly with setting up a SourceForge account, but I’m still not sure I want this to be an Open Source project. The two reasons beings 1) I don’t know if want to sell and 2) I’m not quite ready to have people looking at my code.
So I caved and decided to look for a CVS hosting service. After checking out a few sites I decided to give CVSDude a try. They have a free account that gets you 2MB, which is plenty right now for this project. My account was set up in about 5 minutes and I’m already accessing it from both the Mac and the PC. Now my next challenge is to get both a Mac and PC version building from the same source. The main problem right now is that the two OSes have their support libraries in different places.
One of the requirements I decided on back in the day is that RPGAM should support both MP3 and WAV audio formats - the two most common audio formats. People will no doubtedly be ripping CDs to MP3, but a lot of games provide sound effects and even some tracks in the WAV format. I’d also like to get the program running on a Mac since Java is supposed to be cross-platform and all.
Java comes with an audio library, but it doesn’t support MP3. Java Media Framework does, so I decided to go with that instead. There isn’t a “native” installer for JMF for Mac like there is for Windows and I’ve yet to get it working correctly. So I decided to take a look at QuickTime for Java just to see how easy it would be to implement. I’m happy to say that it was damn easy! I still need to flesh out the rest of the QuickTime version of the Audio Engine, but I was able to get the basics working in about 20 minutes. An example in the SDK definitely helped out and I’d like to think that my foresight to abstract out the AudioEngine played a part it getting it plugged in so quickly ![]()
I still need to actually make it work on the Mac (only tried it on Windows so far), but I don’t expect any big problems. It also actually seems to respond a little better than JMF…
It would also be a bonus if the app worked on Linux, which means, if the QuickTime thing works out, I won’t be abbandoning JMF. It would simply be an option in the app as to which Audio Engine you’d want to use, depending on which is available on your system.
Sometimes it’s good to not bring the laptop on the train and just think about coding. I’ve been wondering how to keep track of the length of the audio files that RPGAM uses. It’s something that the user shouldn’t have to worry about and shouldn’t interfere with their use of the program.
The solution I came up with works something like this: Aliases keep track of when they were last updated. They also keep track of their length. I start a thread which loops through all the Aliases in the Playlists and Palettes. I check the last modifcation date of the file each alias points to and, if it’s greater than the Alias’s last update timestamp, I get the audio file’s length and update the data in the Alias.
Right now I only do that when the Adventure is loaded, but it should also happen whenever a new Alias is added. The update also alters your Adventure (since it’s storing the length along with the alias), so you need to save your Adventure for the updates to be permanent. Otherwise the process will happen the next time you open that Adventure. There’s a bit more checking I need to do during the process, but for the most part it works.

