本文整理汇总了Java中org.jaudiotagger.tag.datatype.DataTypes类的典型用法代码示例。如果您正苦于以下问题:Java DataTypes类的具体用法?Java DataTypes怎么用?Java DataTypes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataTypes类属于org.jaudiotagger.tag.datatype包,在下文中一共展示了DataTypes类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: removeTimingCode
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
/**
* Removes timestamps at a given time with the given types.
*
* @param timestamp timestamp
* @param types types
* @return {@code true}, if any timestamps were removed
*/
public boolean removeTimingCode(final long timestamp, final int... types)
{
// before we can remove anything, we have to resolve relative 0-timestamps
// otherwise we might remove the anchor a relative timestamp relies on
resolveRelativeTimestamps();
final Set<Integer> typeSet = toSet(types);
final List<EventTimingCode> codes = (List<EventTimingCode>)getObjectValue(DataTypes.OBJ_TIMED_EVENT_LIST);
boolean removed = false;
for (final ListIterator<EventTimingCode> iterator = codes.listIterator(); iterator.hasNext(); )
{
final EventTimingCode code = iterator.next();
if (timestamp == code.getTimestamp() && typeSet.contains(code.getType()))
{
iterator.remove();
removed = true;
}
if (timestamp > code.getTimestamp())
{
break;
}
}
return removed;
}
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:31,代码来源:FrameBodyETCO.java
示例2: createField
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public TagField createField(Artwork artwork) throws FieldDataInvalidException {
AbstractID3v2Frame frame = createFrame(getFrameAndSubIdFromGenericKey(FieldKey.COVER_ART).getFrameId());
FrameBodyPIC body = (FrameBodyPIC) frame.getBody();
if (!artwork.isLinked()) {
body.setObjectValue(DataTypes.OBJ_PICTURE_DATA, artwork.getBinaryData());
body.setObjectValue(DataTypes.OBJ_PICTURE_TYPE, artwork.getPictureType());
body.setObjectValue(DataTypes.OBJ_IMAGE_FORMAT, ImageFormats.getFormatForMimeType(artwork.getMimeType()));
body.setObjectValue(DataTypes.OBJ_DESCRIPTION, "");
return frame;
} else {
try {
body.setObjectValue(DataTypes.OBJ_PICTURE_DATA, artwork.getImageUrl().getBytes("ISO-8859-1"));
} catch (UnsupportedEncodingException uoe) {
throw new RuntimeException(uoe.getMessage());
}
body.setObjectValue(DataTypes.OBJ_PICTURE_TYPE, artwork.getPictureType());
body.setObjectValue(DataTypes.OBJ_IMAGE_FORMAT, FrameBodyAPIC.IMAGE_IS_URL);
body.setObjectValue(DataTypes.OBJ_DESCRIPTION, "");
return frame;
}
}
开发者ID:openaudible,项目名称:openaudible,代码行数:25,代码来源:ID3v22Tag.java
示例3: createField
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
public TagField createField(Artwork artwork) throws FieldDataInvalidException {
AbstractID3v2Frame frame = createFrame(getFrameAndSubIdFromGenericKey(FieldKey.COVER_ART).getFrameId());
FrameBodyAPIC body = (FrameBodyAPIC) frame.getBody();
if (!artwork.isLinked()) {
body.setObjectValue(DataTypes.OBJ_PICTURE_DATA, artwork.getBinaryData());
body.setObjectValue(DataTypes.OBJ_PICTURE_TYPE, artwork.getPictureType());
body.setObjectValue(DataTypes.OBJ_MIME_TYPE, artwork.getMimeType());
body.setObjectValue(DataTypes.OBJ_DESCRIPTION, "");
return frame;
} else {
try {
body.setObjectValue(DataTypes.OBJ_PICTURE_DATA, artwork.getImageUrl().getBytes("ISO-8859-1"));
} catch (UnsupportedEncodingException uoe) {
throw new RuntimeException(uoe.getMessage());
}
body.setObjectValue(DataTypes.OBJ_PICTURE_TYPE, artwork.getPictureType());
body.setObjectValue(DataTypes.OBJ_MIME_TYPE, FrameBodyAPIC.IMAGE_IS_URL);
body.setObjectValue(DataTypes.OBJ_DESCRIPTION, "");
return frame;
}
}
开发者ID:openaudible,项目名称:openaudible,代码行数:22,代码来源:ID3v24Tag.java
示例4: addTimingCode
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
/**
* Adds a timing code for each given type.
*
* @param timestamp timestamp
* @param types types
*/
public void addTimingCode(final long timestamp, final int... types)
{
final List<EventTimingCode> codes = (List<EventTimingCode>)getObjectValue(DataTypes.OBJ_TIMED_EVENT_LIST);
long lastTimestamp = 0;
int insertIndex = 0;
if (!codes.isEmpty() && codes.get(0).getTimestamp() <= timestamp)
{
for (final EventTimingCode code : codes)
{
final long translatedTimestamp = code.getTimestamp() == 0 ? lastTimestamp : code.getTimestamp();
if (timestamp < translatedTimestamp)
{
break;
}
insertIndex++;
lastTimestamp = translatedTimestamp;
}
}
for (final int type : types) {
codes.add(insertIndex, new EventTimingCode(DataTypes.OBJ_TIMED_EVENT, this, type, timestamp));
insertIndex++; // preserve order of types
}
}
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:30,代码来源:FrameBodyETCO.java
示例5: createArtworkField
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
public TagField createArtworkField(byte[] data, String mimeType)
{
AbstractID3v2Frame frame = createFrame(getFrameAndSubIdFromGenericKey(FieldKey.COVER_ART).getFrameId());
FrameBodyPIC body = (FrameBodyPIC) frame.getBody();
body.setObjectValue(DataTypes.OBJ_PICTURE_DATA, data);
body.setObjectValue(DataTypes.OBJ_PICTURE_TYPE, PictureTypes.DEFAULT_ID);
body.setObjectValue(DataTypes.OBJ_IMAGE_FORMAT, ImageFormats.getFormatForMimeType(mimeType));
body.setObjectValue(DataTypes.OBJ_DESCRIPTION, "");
return frame;
}
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:11,代码来源:ID3v22Tag.java
示例6: setupObjectList
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
/**
*
*/
protected void setupObjectList() {
objectList.add(new StringNullTerminated(DataTypes.OBJ_OWNER, this));
objectList.add(new NumberFixedLength(DataTypes.OBJ_PREVIEW_START, this, 2));
objectList.add(new NumberFixedLength(DataTypes.OBJ_PREVIEW_LENGTH, this, 2));
objectList.add(new ByteArraySizeTerminated(DataTypes.OBJ_ENCRYPTION_INFO, this));
}
开发者ID:openaudible,项目名称:openaudible,代码行数:10,代码来源:FrameBodyAENC.java
示例7: write
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
/**
* Because TXXX frames also have a text encoded description we need to check this as well. *
*/
public void write(ByteArrayOutputStream tagBuffer) {
//Ensure valid for type
setTextEncoding(ID3TextEncodingConversion.getTextEncoding(getHeader(), getTextEncoding()));
//Ensure valid for description
if (!((TextEncodedStringNullTerminated) getObject(DataTypes.OBJ_DESCRIPTION)).canBeEncoded()) {
this.setTextEncoding(ID3TextEncodingConversion.getUnicodeTextEncoding(getHeader()));
}
super.write(tagBuffer);
}
开发者ID:openaudible,项目名称:openaudible,代码行数:14,代码来源:FrameBodyTXXX.java
示例8: FrameBodyTDRC
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
/**
* When converting v3 TDAT to v4 TDRC frame
* @param body
*/
public FrameBodyTDRC(FrameBodyTDAT body)
{
originalID = ID3v23Frames.FRAME_ID_V3_TDAT;
date = body.getText();
setMonthOnly(body.isMonthOnly());
setObjectValue(DataTypes.OBJ_TEXT_ENCODING, TextEncoding.ISO_8859_1);
setObjectValue(DataTypes.OBJ_TEXT, getFormattedText());
}
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:13,代码来源:FrameBodyTDRC.java
示例9: setupObjectList
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
/**
*
*/
protected void setupObjectList()
{
objectList.add(new NumberFixedLength(DataTypes.OBJ_BUFFER_SIZE, this, BUFFER_FIELD_SIZE));
objectList.add(new BooleanByte(DataTypes.OBJ_EMBED_FLAG, this, (byte) EMBED_FLAG_BIT_POSITION));
objectList.add(new NumberFixedLength(DataTypes.OBJ_OFFSET, this, OFFSET_FIELD_SIZE));
}
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:10,代码来源:FrameBodyRBUF.java
示例10: setTimestampFormat
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
/**
* Sets the timestamp format.
*
* @param timestampFormat 1 for MPEG frames or 2 for milliseconds
* @see #getTimestampFormat()
*/
public void setTimestampFormat(final int timestampFormat)
{
if (EventTimingTimestampTypes.getInstanceOf().getValueForId(timestampFormat) == null)
{
throw new IllegalArgumentException("Timestamp format must be 1 or 2 (ID3v2.4, 4.5): " + timestampFormat);
}
setObjectValue(DataTypes.OBJ_TIME_STAMP_FORMAT, timestampFormat);
}
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:15,代码来源:FrameBodyETCO.java
示例11: write
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
/**
* Because have a text encoding we need to check the data values do not contain characters that cannot be encoded in
* current encoding before we write data. If they do change the encoding.
*/
public void write(ByteArrayOutputStream tagBuffer) {
if (!((PairedTextEncodedStringNullTerminated) getObject(DataTypes.OBJ_TEXT)).canBeEncoded()) {
this.setTextEncoding(TextEncoding.UTF_16);
}
super.write(tagBuffer);
}
开发者ID:openaudible,项目名称:openaudible,代码行数:11,代码来源:FrameBodyTIPL.java
示例12: setupObjectList
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
/**
*
*/
protected void setupObjectList()
{
objectList.add(new StringNullTerminated(DataTypes.OBJ_OWNER, this));
objectList.add(new StringNullTerminated(DataTypes.OBJ_DESCRIPTION, this));
objectList.add(new ByteArraySizeTerminated(DataTypes.OBJ_ENCRYPTED_DATABLOCK, this));
}
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:10,代码来源:FrameBodyCRM.java
示例13: addPair
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
/**
* Add pair
*
* @param function
* @param name
*/
public void addPair(String function,String name)
{
PairedTextEncodedStringNullTerminated.ValuePairs value = ((PairedTextEncodedStringNullTerminated) getObject(DataTypes.OBJ_TEXT)).getValue();
value.add(function, name);
}
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:13,代码来源:AbstractFrameBodyPairs.java
示例14: write
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
/**
* Because have a text encoding we need to check the data values do not contain characters that cannot be encoded in
* current encoding before we write data. If they do change the encoding.
*/
public void write(ByteArrayOutputStream tagBuffer)
{
if (!((PairedTextEncodedStringNullTerminated) getObject(DataTypes.OBJ_TEXT)).canBeEncoded())
{
this.setTextEncoding(TextEncoding.UTF_16);
}
super.write(tagBuffer);
}
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:13,代码来源:AbstractFrameBodyPairs.java
示例15: createArtworkField
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
/**
* Create Artwork
*
* @param data
* @param mimeType of the image
* @return
* @see PictureTypes
*/
public TagField createArtworkField(byte[] data, String mimeType) {
AbstractID3v2Frame frame = createFrame(getFrameAndSubIdFromGenericKey(FieldKey.COVER_ART).getFrameId());
FrameBodyAPIC body = (FrameBodyAPIC) frame.getBody();
body.setObjectValue(DataTypes.OBJ_PICTURE_DATA, data);
body.setObjectValue(DataTypes.OBJ_PICTURE_TYPE, PictureTypes.DEFAULT_ID);
body.setObjectValue(DataTypes.OBJ_MIME_TYPE, mimeType);
body.setObjectValue(DataTypes.OBJ_DESCRIPTION, "");
return frame;
}
开发者ID:openaudible,项目名称:openaudible,代码行数:18,代码来源:ID3v24Tag.java
示例16: FrameBodyAENC
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
/**
* Creates a new FrameBodyAENC datatype.
*/
public FrameBodyAENC()
{
this.setObjectValue(DataTypes.OBJ_OWNER, "");
this.setObjectValue(DataTypes.OBJ_PREVIEW_START, (short) 0);
this.setObjectValue(DataTypes.OBJ_PREVIEW_LENGTH, (short) 0);
this.setObjectValue(DataTypes.OBJ_ENCRYPTION_INFO, new byte[0]);
}
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:11,代码来源:FrameBodyAENC.java
示例17: getText
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
public String getText() {
PairedTextEncodedStringNullTerminated text = (PairedTextEncodedStringNullTerminated) getObject(DataTypes.OBJ_TEXT);
StringBuilder sb = new StringBuilder();
int count = 1;
for (Pair entry : text.getValue().getMapping()) {
sb.append(entry.getKey() + '\0' + entry.getValue());
if (count != getNumberOfPairs()) {
sb.append('\0');
}
count++;
}
return sb.toString();
}
开发者ID:openaudible,项目名称:openaudible,代码行数:14,代码来源:FrameBodyIPLS.java
示例18: FrameBodyTXXX
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
/**
* Creates a new FrameBodyTXXX datatype.
*/
public FrameBodyTXXX() {
this.setObjectValue(DataTypes.OBJ_TEXT_ENCODING, TextEncoding.ISO_8859_1);
this.setObjectValue(DataTypes.OBJ_DESCRIPTION, "");
this.setObjectValue(DataTypes.OBJ_TEXT, "");
}
开发者ID:openaudible,项目名称:openaudible,代码行数:10,代码来源:FrameBodyTXXX.java
示例19: getGroupSymbol
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
/**
* @return
*/
public byte getGroupSymbol()
{
if (getObjectValue(DataTypes.OBJ_GROUP_SYMBOL) != null)
{
return (Byte) getObjectValue(DataTypes.OBJ_GROUP_SYMBOL);
}
else
{
return (byte) 0;
}
}
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:15,代码来源:FrameBodySIGN.java
示例20: getTextEncoding
import org.jaudiotagger.tag.datatype.DataTypes; //导入依赖的package包/类
/**
* Return the Text Encoding
*
* @return the text encoding used by this framebody
*/
public final byte getTextEncoding() {
AbstractDataType o = getObject(DataTypes.OBJ_TEXT_ENCODING);
if (o != null) {
Long encoding = (Long) (o.getValue());
return encoding.byteValue();
} else {
return TextEncoding.ISO_8859_1;
}
}
开发者ID:openaudible,项目名称:openaudible,代码行数:16,代码来源:AbstractTagFrameBody.java
注:本文中的org.jaudiotagger.tag.datatype.DataTypes类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论