Get audio codec description if audio/codec property is requested.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 28 Jul 2012 22:16:09 +0000 (00:16 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 28 Jul 2012 22:16:09 +0000 (00:16 +0200)
src/main/java/net/pterodactylus/demoscenemusic/template/PropertiesAccessor.java

index 4e9bf5b..6294117 100644 (file)
@@ -19,6 +19,7 @@ package net.pterodactylus.demoscenemusic.template;
 
 import net.pterodactylus.demoscenemusic.data.Base;
 import net.pterodactylus.demoscenemusic.data.Properties;
+import net.pterodactylus.demoscenemusic.utils.AudioCodecs;
 import net.pterodactylus.util.template.Accessor;
 import net.pterodactylus.util.template.TemplateContext;
 
@@ -41,6 +42,9 @@ public class PropertiesAccessor implements Accessor {
        @Override
        public Object get(TemplateContext templateContext, Object object, String member) {
                Properties properties = (Properties) object;
+               if ("audio/codec".equals(member)) {
+                       return AudioCodecs.codecDescriptions.get(properties.get(member));
+               }
                return properties.get(member);
        }