package net.kopeph.ld31;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import ddf.minim.AudioPlayer;
import ddf.minim.Minim;


/**
 * Filename strings are used as keys for clips.
 *
 * @author alexg
 */
public class AudioManager {
	public static final int
		VOL_MUSIC  = 0,
		VOL_GAME   = 1,
		VOL_LENGTH = 2;

	private final Minim minim = new Minim(LD31.getContext());
	private Map<String, AudioPlayer> files = new HashMap<>();
	private List<List<String>> volumeClasses = new ArrayList<>(VOL_LENGTH);

	public AudioManager() {
		for (int i = 0; i < VOL_LENGTH; i++)
			volumeClasses.add(new ArrayList<>());
	}

	public void load(String filename, int volumeClass) {
		files.put(filename, minim.loadFile(filename));
		volumeClasses.get(volumeClass).add(filename);
	}

	public void play(String filename, boolean loop) {
		files.get(filename).play();
		if (loop)
			files.get(filename).loop();
	}
	public void pause(String filename) {
		files.get(filename).pause();
	}
	public void stop(String filename) {
		files.get(filename).pause();
		files.get(filename).rewind();
	}

	public void setVolume(int volumeClass, float volume) {
		for (String filename : volumeClasses.get(volumeClass))
			files.get(filename).setVolume(volume);
	}
}

@@ -303,17 +303,37 @@
 inal int
+ //Volume Categories
 %0A
-
 %09%09VOL_MU
@@ -377,16 +377,58 @@
 GTH = 2;
+ //here for setting the proper length only
 %0A%0A%09priva
@@ -718,24 +718,80 @@
 t%3C%3E());%0A%09%7D%0A%0A
+%09/**%0A%09 * @param volumeClass possible values: VOL_*%0A%09 */%0A
 %09public void
@@ -1232,24 +1232,80 @@
 wind();%0A%09%7D%0A%0A
+%09/**%0A%09 * @param volumeClass possible values: VOL_*%0A%09 */%0A
 %09public void

Add just enough documentation to get by for now