⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mp3descriptor.java

📁 项目描述: Fluid is a server daemon for streaming media. The latest release is built as an API for buil
💻 JAVA
字号:
package descriptors.mp3;import java.io.*;import descriptors.Descriptor;/** * A descriptor describing the MP3 media file using * the information found in the ID3 tag or parts * of the filename if no tag was found. * * @author Lars Samuelsson */public class MP3Descriptor implements Descriptor {    /**      * Creates an MP3Descriptor object.     */    public MP3Descriptor() {	super();    }    /**      * Required by the Descriptor interface.     *      * @param type A type     * @return     true if type is "mp3" or "mpeg3"     */    public boolean describes(String type) {	return type.equals("mp3") || type.equals("mpeg3");    }    /**     * Returns a description of the file.     *      * Will return the same information as the      * getCompleteName method in the ID3Tag.     *      * @return Artist and track if available     */    public String describe(Object obj) {	if(!(obj instanceof String))	    return null;	String filename = (String) obj;	ID3Tag tag = null;	try {	    tag = new ID3Tag(filename);	}	catch(IOException e) {	    return null;	}	if(tag == null) 	    return null;	return tag.getCompleteName();    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -