📄 id3frames.java
字号:
/*
* MusicTag Copyright (C)2003,2004
*
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser
* General Public License as published by the Free Software Foundation; either version 2.1 of the License,
* or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with this library; if not,
* you can get a copy from http://www.opensource.org/licenses/lgpl-license.php or write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package com.hadeslee.audiotag.tag.id3;
import com.hadeslee.audiotag.tag.datatype.AbstractStringStringValuePair;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.TreeSet;
/**
* Subclasses Defines ID3 frames for their Tag Version
*
* Here we specify how frames are mapped between different Tag Versions
*
* @author Paul Taylor
* @version $Id: ID3Frames.java,v 1.12 2007/11/13 14:24:30 paultaylor Exp $
*/
public abstract class ID3Frames extends AbstractStringStringValuePair
{
/**
* Holds frames whereby multiple occurences are allowed
*/
protected TreeSet<String> multipleFrames = new TreeSet<String> ();
/**
* These frames should be lost if file changes
*/
protected TreeSet<String> discardIfFileAlteredFrames= new TreeSet<String> ();
/**
* These frames are part of the Official Specification for that Tag Version
*/
protected TreeSet<String> supportedFrames = new TreeSet<String> ();
/**
* These frames are extensions to the Specification for that Tag Version
*/
protected TreeSet<String> extensionFrames = new TreeSet<String> ();
/**
* These frames are Common , this is a loose term
*/
protected TreeSet<String> commonFrames = new TreeSet<String> ();
/**
* These frames are Binary
*/
protected TreeSet<String> binaryFrames = new TreeSet<String> ();
/**
* If file changes discard these frames
*/
public boolean isDiscardIfFileAltered(String frameID)
{
return discardIfFileAlteredFrames.contains(frameID);
}
/**
* Are multiple ocurrences of frame allowed
*/
public boolean isMultipleAllowed(String frameID)
{
return multipleFrames.contains(frameID);
}
/**
*
* @param frameID
* @return true if frames with this id are part of the specification
*/
public boolean isSupportedFrames(String frameID)
{
return supportedFrames.contains(frameID);
}
/**
*
* @param frameID
* @return true if frames with this id are considered common
*/
public boolean isCommon(String frameID)
{
return commonFrames.contains(frameID);
}
/**
*
* @param frameID
* @return true if frames with this id are binary (non textual data)
*/
public boolean isBinary(String frameID)
{
return binaryFrames.contains(frameID);
}
/**
*
* @param frameID
*
* @return true if frame is a known extension
*/
public boolean isExtensionFrames(String frameID)
{
return extensionFrames.contains(frameID);
}
/**
* Mapping from v22 to v23
*/
public static final Map<String,String> convertv22Tov23 = new LinkedHashMap<String,String>();
public static final Map<String,String> convertv23Tov22 = new LinkedHashMap<String,String>();
public static final Map<String,String> forcev22Tov23 = new LinkedHashMap<String,String>();
public static final Map<String,String> forcev23Tov22 = new LinkedHashMap<String,String>();
public static final Map<String,String> convertv23Tov24 = new LinkedHashMap<String,String>();
public static final Map<String,String> convertv24Tov23 = new LinkedHashMap<String,String>();
public static final Map<String,String> forcev23Tov24 = new LinkedHashMap<String,String>();
public static final Map<String,String> forcev24Tov23 = new LinkedHashMap<String,String>();
private static void loadID3v23ID3v24Mapping()
{
// Define the mapping from v23 to v24 only maps values where
// the v23 ID is not a v24 ID and where the translation from v23 to v24
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -