2 * DemosceneMusic - AudioCodecFilter.java - Copyright © 2012 David Roden
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package net.pterodactylus.demoscenemusic.utils;
20 import java.util.HashMap;
24 * Helper for audio codec descriptions.
26 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
28 public class AudioCodecs {
30 /** Descriptions for audio codecs. */
31 public static final Map<String, AudioCodecDescription> codecDescriptions = new HashMap<String, AudioCodecDescription>();
34 codecDescriptions.put("mp3", new AudioCodecDescription("MPEG 1 Layer 3", "MP3", true, false));
35 codecDescriptions.put("vorbis", new AudioCodecDescription("Ogg Vorbis", "Vorbis", true, false));
36 codecDescriptions.put("aac", new AudioCodecDescription("Advanced Audio Coding", "AAC", true, false));
37 codecDescriptions.put("flac", new AudioCodecDescription("Free Lossless Audio Codec", "FLAC", true, true));
38 codecDescriptions.put("WAV", new AudioCodecDescription("Waveform Audio", "WAV", true, true));
39 codecDescriptions.put("mod", new AudioCodecDescription("Module", "MOD", false, true));
43 * Bundles descriptions for various audio codecs. For simplicity reasons,
44 * file formats such as MOD, IT, or SID are also treated as audio codecs
45 * even though they are not.
47 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
49 public final static class AudioCodecDescription {
51 /** The full name of the codec. */
52 public final String name;
54 /** The short name of the codec. */
55 public final String shortName;
57 /** Whether this is a streaming codec. */
58 public final boolean streaming;
60 /** Whether this codec is lossless. */
61 public final boolean lossless;
64 * Creates a new audio codec description.
67 * The full name of the codec
69 * The short name of the codec
71 * {@code true} if the codec is a streaming audio codec,
72 * {@code false} otherwise
74 * {@code true} if the codec is a lossless audio codec,
75 * {@code false} otherwise
77 AudioCodecDescription(String name, String shortName, boolean streaming, boolean lossless) {
79 this.shortName = shortName;
80 this.streaming = streaming;
81 this.lossless = lossless;