BU-CS673/bubolo — pull request #141 by ChristopherCanfield (2014-03-14 21:23:51+00:00)
Title: Canfield-Staging -> production (Audio System)

This request includes the implementation of our Audio system. Using the system is very simple.

Code to play a sound effect:

Audio.play(Sfx.EXPLOSION);
Audio.setSoundEffectVolume(75); // 75% volume.
Audio.play(Sfx.TANK_HIT);

Code to start and stop the music:

Audio.startMusic();
Audio.setMusicVolume(25); // 25% volume.
Audio.stopMusic();

The first song in the music list is always the first one to play. After that, the songs play randomly (a song will not play twice in a row). I thought this was a nice compromise between giving us full control of the play list order vs making the music order more interesting for the user.

A few notes on the implementation:
- The list of sound effects was taken from the minutes of our 3/8/2014 meeting: https://groups.google.com/forum/#!topic/metcs673game/8PnNM5Cjsp0
- I've added sound effects for testing. All of them are either mute or just a simple 8 bit sound. Hopefully all of these will be changed in the future.
- There are 21 unit tests as well as 1 audio integration test
- The startStopMusic() test works when run alone, but fails when run with the other systems. The issue seems to be very similar to the graphics issues I ran into: it generally either complains that the audio system isn't ready, or that multiple OpenAL contexts can't be created. startMusic() works properly in the audio integration test. I'll continue to look into fixing this, so it can be run with everything, but since it passes on its own and works in the integration test, I'd like to leave this as-is for now.
- Everything is within the audio package. This is because I needed to make many methods and constructors package private, to ensure that people don't use the audio system incorrectly. Other subsystems will only ever directly use two classes: Audio and Sfx (see above).
- I don't really like the capitalized constants naming convention (it's a hold-over from C macros), but that's what our standards specify, so I used that convention in the Sfx class.
- I also removed the AllGraphicsTests test suite, which hasn't been needed since I've resolved the graphics unit test problems

[This post was formatted for GitHub, rather than for email]