Add the code of the codec to its description.
[demoscenemusic.git] / src / main / java / net / pterodactylus / demoscenemusic / utils / AudioCodecs.java
index baa4e92..f09e79f 100644 (file)
@@ -31,12 +31,13 @@ public class AudioCodecs {
        public static final Map<String, AudioCodecDescription> codecDescriptions = new HashMap<String, AudioCodecDescription>();
 
        static {
-               codecDescriptions.put("mp3", new AudioCodecDescription("MPEG 1 Layer 3", "MP3", true, false));
-               codecDescriptions.put("vorbis", new AudioCodecDescription("Ogg Vorbis", "Vorbis", true, false));
-               codecDescriptions.put("aac", new AudioCodecDescription("Advanced Audio Coding", "AAC", true, false));
-               codecDescriptions.put("flac", new AudioCodecDescription("Free Lossless Audio Codec", "FLAC", true, true));
-               codecDescriptions.put("WAV", new AudioCodecDescription("Waveform Audio", "WAV", true, true));
-               codecDescriptions.put("mod", new AudioCodecDescription("Module", "MOD", false, true));
+               codecDescriptions.put("mp3", new AudioCodecDescription("mp3", "MPEG 1 Layer 3", "MP3", "audio/mpeg", true, false));
+               codecDescriptions.put("vorbis", new AudioCodecDescription("vorbis", "Ogg Vorbis", "Vorbis", "audio/vorbis", true, false));
+               codecDescriptions.put("aac", new AudioCodecDescription("aac", "Advanced Audio Coding", "AAC", "audio/x-aac", true, false));
+               codecDescriptions.put("flac", new AudioCodecDescription("flac", "Free Lossless Audio Codec", "FLAC", "audio/ogg", true, true));
+               codecDescriptions.put("wav", new AudioCodecDescription("wav", "Waveform Audio", "WAV", "audio/vnc.wave", true, true));
+               codecDescriptions.put("mod", new AudioCodecDescription("mod", "Module", "MOD", "audio/mod", false, true));
+               codecDescriptions.put("ft2", new AudioCodecDescription("ft2", "FastTracker II Module", "XM", "audio/xm", false, true));
        }
 
        /**
@@ -48,12 +49,18 @@ public class AudioCodecs {
         */
        public final static class AudioCodecDescription {
 
+               /** The code of this codec. */
+               public final String code;
+
                /** The full name of the codec. */
                public final String name;
 
                /** The short name of the codec. */
                public final String shortName;
 
+               /** The MIME type. */
+               public final String mimeType;
+
                /** Whether this is a streaming codec. */
                public final boolean streaming;
 
@@ -63,10 +70,14 @@ public class AudioCodecs {
                /**
                 * Creates a new audio codec description.
                 *
+                * @param code
+                *            The code of the codec
                 * @param name
                 *            The full name of the codec
                 * @param shortName
                 *            The short name of the codec
+                * @param mimeType
+                *            The MIME type of the audio codec
                 * @param streaming
                 *            {@code true} if the codec is a streaming audio codec,
                 *            {@code false} otherwise
@@ -74,9 +85,11 @@ public class AudioCodecs {
                 *            {@code true} if the codec is a lossless audio codec,
                 *            {@code false} otherwise
                 */
-               AudioCodecDescription(String name, String shortName, boolean streaming, boolean lossless) {
+               AudioCodecDescription(String code, String name, String shortName, String mimeType, boolean streaming, boolean lossless) {
+                       this.code = code;
                        this.name = name;
                        this.shortName = shortName;
+                       this.mimeType = mimeType;
                        this.streaming = streaming;
                        this.lossless = lossless;
                }