• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TagField类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jaudiotagger.tag.TagField的典型用法代码示例。如果您正苦于以下问题:Java TagField类的具体用法?Java TagField怎么用?Java TagField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TagField类属于org.jaudiotagger.tag包,在下文中一共展示了TagField类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: copyTag

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
/**
 * copy existing tag into a nice new ID3v24Tag tag
 * 
 * @throws FieldDataInvalidException
 */
private static ID3v24Tag copyTag(Tag tag) throws FieldDataInvalidException {
   final ID3v24Tag ret = new ID3v24Tag();
   Iterator<TagField> iter = null;
   try {
      iter = tag.getFields();
   } catch (final UnsupportedOperationException e) {
      // seems like some old tag types don't support iteration
      return null;
   }
   while (iter.hasNext()) {
      final TagField tagField = iter.next();
      ret.setField(tagField);
   }
   return ret;
}
 
开发者ID:teverett,项目名称:musicbrainztagger,代码行数:21,代码来源:ID3.java


示例2: addFields

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
private void addFields(ParserResultItem result, Tag tag, FieldKey fieldKey,
		ParserFieldEnum parserField) {
	List<TagField> list = tag.getFields(fieldKey);
	if (list != null && list.size() > 0) {
		for (TagField field : list)
			result.addField(parserField, field);
		return;
	}
	String f = tag.getFirst(fieldKey);
	if (f == null)
		return;
	f = f.trim();
	if (f.length() == 0)
		return;
	result.addField(parserField, f);
}
 
开发者ID:jaeksoft,项目名称:opensearchserver,代码行数:17,代码来源:AudioParser.java


示例3: setupTag

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
private FlacTag setupTag(String[] idNames, String[] idValues) throws FieldDataInvalidException {
  assert (idNames.length == idValues.length);

  FlacTag tag = new FlacTag();

  Iterator<TagField> it = tag.getFields();
  while (it.hasNext()) {
    TagField f = it.next();
    tag.deleteField(f.getId());
  }

  for (int i = 0; i < idNames.length; i++) {
    tag.addField(new VorbisCommentTagField(idNames[i], idValues[i]));
  }

  return tag;
}
 
开发者ID:fhuberts,项目名称:musicTreePrograms,代码行数:18,代码来源:TestFlacTagConverter.java


示例4: copyContent

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
@Override
public void copyContent(TagField field)
{
    if (field instanceof Mp4TagReverseDnsField)
    {
        this.issuer = ((Mp4TagReverseDnsField) field).getIssuer();
        this.descriptor = ((Mp4TagReverseDnsField) field).getDescriptor();
        this.content = ((Mp4TagReverseDnsField) field).getContent();
    }
}
 
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:11,代码来源:Mp4TagReverseDnsField.java


示例5: copyContent

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
public void copyContent(TagField field)
{
    if (field instanceof Mp4TagTextNumberField)
    {
        this.content = ((Mp4TagTextNumberField) field).getContent();
        this.numbers = ((Mp4TagTextNumberField) field).getNumbers();
    }
}
 
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:9,代码来源:Mp4TagTextNumberField.java


示例6: copyContent

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
public void copyContent(TagField field)
{
    if (field instanceof Mp4TagBinaryField)
    {
        this.dataBytes = ((Mp4TagBinaryField) field).getData();
        this.isBinary = field.isBinary();
    }
}
 
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:9,代码来源:Mp4TagBinaryField.java


示例7: copyContent

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
@Override
public void copyContent(TagField field)
{
    if (field instanceof Mp4TagTextField)
    {
        this.content = ((Mp4TagTextField) field).getContent();
    }
}
 
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:9,代码来源:Mp4TagTextField.java


示例8: copyContent

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
@Override
public void copyContent(TagField field)
{
    if (field instanceof TagTextField)
    {
        this.content = ((TagTextField) field).getContent();
    }
}
 
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:9,代码来源:VorbisCommentTagField.java


示例9: compare

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
public int compare(TagField field1, TagField field2) {
    WavInfoIdentifier code1 = WavInfoIdentifier.getByByFieldKey(FieldKey.valueOf(field1.getId()));
    WavInfoIdentifier code2 = WavInfoIdentifier.getByByFieldKey(FieldKey.valueOf(field2.getId()));
    int order1 = Integer.MAX_VALUE;
    int order2 = Integer.MAX_VALUE;
    if (code1 != null) {
        order1 = code1.getPreferredWriteOrder();
    }
    if (code2 != null) {
        order2 = code2.getPreferredWriteOrder();
    }
    return order1 - order2;
}
 
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:14,代码来源:WavTagWriter.java


示例10: copyContent

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
public void copyContent(TagField field) {
    if (field instanceof Mp4TagReverseDnsField) {
        this.issuer = ((Mp4TagReverseDnsField) field).getIssuer();
        this.descriptor = ((Mp4TagReverseDnsField) field).getDescriptor();
        this.content = ((Mp4TagReverseDnsField) field).getContent();
    }
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:8,代码来源:Mp4TagReverseDnsField.java


示例11: convert

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
/**
 * Convert tagdata to rawdata ready for writing to file
 *
 * @param tag
 * @param padding
 * @return
 * @throws UnsupportedEncodingException
 */
//TODO padding parameter currently ignored
public ByteBuffer convert(Tag tag, int padding) throws UnsupportedEncodingException {
    try {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();

        //Vendor
        String vendorString = ((VorbisCommentTag) tag).getVendor();
        int vendorLength = Utils.getUTF8Bytes(vendorString).length;
        baos.write(Utils.getSizeLEInt32(vendorLength));
        baos.write(Utils.getUTF8Bytes(vendorString));

        //User Comment List
        int listLength = tag.getFieldCount() - 1; //Remove Vendor from count         
        baos.write(Utils.getSizeLEInt32(listLength));

        //Add metadata raw content
        Iterator<TagField> it = tag.getFields();
        while (it.hasNext()) {
            TagField frame = it.next();
            if (frame.getId().equals(VorbisCommentFieldKey.VENDOR.getFieldName())) {
                //this is always stored above so ignore                    
            } else {
                baos.write(frame.getRawContent());
            }
        }

        //Put into ByteBuffer
        ByteBuffer buf = ByteBuffer.wrap(baos.toByteArray());
        buf.rewind();
        return buf;
    } catch (IOException ioe) {
        //Should never happen as not writing to file at this point
        throw new RuntimeException(ioe);
    }
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:44,代码来源:VorbisCommentCreator.java


示例12: copyContent

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
@Override
public void copyContent(TagField field) {
    if (field instanceof Mp4TagReverseDnsField) {
        this.issuer = ((Mp4TagReverseDnsField) field).getIssuer();
        this.descriptor = ((Mp4TagReverseDnsField) field).getDescriptor();
        this.content = ((Mp4TagReverseDnsField) field).getContent();
    }
}
 
开发者ID:Old-Geek,项目名称:Musique,代码行数:9,代码来源:Mp4TagReverseDnsField.java


示例13: convert

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
public ByteBuffer convert(Tag tag, int padding) throws UnsupportedEncodingException {
    try {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();

        //Vendor
        String vendorString = ((VorbisCommentTag) tag).getVendor();
        int vendorLength = vendorString.getBytes(UTF_8).length;
        baos.write(Utils.getSizeLEInt32(vendorLength));
        baos.write(vendorString.getBytes(UTF_8));

        //User Comment List
        int listLength = tag.getFieldCount() - 1; //Remove Vendor from count         
        baos.write(Utils.getSizeLEInt32(listLength));

        //Add metadata raw content
        Iterator<TagField> it = tag.getFields();
        while (it.hasNext()) {
            TagField frame = it.next();
            if (frame.getId().equals(VorbisCommentFieldKey.VENDOR.getFieldName())) {
                //this is always stored above so ignore                    
            } else {
                baos.write(frame.getRawContent());
            }
        }

        //Put into ByteBuffer
        ByteBuffer buf = ByteBuffer.wrap(baos.toByteArray());
        buf.rewind();
        return buf;
    } catch (IOException ioe) {
        //Should never happen as not writing to file at this point
        throw new RuntimeException(ioe);
    }
}
 
开发者ID:Old-Geek,项目名称:Musique,代码行数:35,代码来源:VorbisCommentCreator.java


示例14: getFirstField

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
public TagField getFirstField(FieldKey genericKey) throws KeyNotFoundException
{
    if (genericKey == null)
    {
        throw new KeyNotFoundException();
    }

    else
    {
        return id3Tag.getFirstField(genericKey);            
    }
}
 
开发者ID:Dynious,项目名称:SoundsCool,代码行数:13,代码来源:AiffTag.java


示例15: copyContent

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
public void copyContent(TagField field)
{
    if (field instanceof Mp4TagReverseDnsField)
    {
        this.issuer = ((Mp4TagReverseDnsField) field).getIssuer();
        this.descriptor = ((Mp4TagReverseDnsField) field).getDescriptor();
        this.content = ((Mp4TagReverseDnsField) field).getContent();
    }
}
 
开发者ID:Dynious,项目名称:SoundsCool,代码行数:10,代码来源:Mp4TagReverseDnsField.java


示例16: copyContent

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
public void copyContent(TagField field)
{
    if (field instanceof Mp4TagTextField)
    {
        this.content = ((Mp4TagTextField) field).getContent();
    }
}
 
开发者ID:Dynious,项目名称:SoundsCool,代码行数:8,代码来源:Mp4TagTextField.java


示例17: copyContent

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
/**
 * @see TagField#copyContent(TagField)
 */
public void copyContent(TagField field)
{
    if (field instanceof TagTextField)
    {
        this.content = ((TagTextField) field).getContent();
    }
}
 
开发者ID:Dynious,项目名称:SoundsCool,代码行数:11,代码来源:VorbisCommentTagField.java


示例18: copyContent

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
/**
 * (overridden)
 *
 * @see org.jaudiotagger.tag.TagField#copyContent(org.jaudiotagger.tag.TagField)
 */
public void copyContent(TagField field)
{
    if (field instanceof TagTextField)
    {
        this.content = ((TagTextField) field).getContent();
    }
}
 
开发者ID:Dynious,项目名称:SoundsCool,代码行数:13,代码来源:AiffTag.java


示例19: getInformationFromList

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
/**
 * This method gathers all information from list and store in single string.
 * 
 * @param informationList
 *            The list with information.
 * @return The single string with information from the list.
 */
@SuppressWarnings("unused")
private static String getInformationFromList(List<TagField> informationList) {
    String information = "";

    for (Object object : safe(informationList)) {
        information += object.toString() + " ";
    }

    return information;
}
 
开发者ID:M4GiK,项目名称:audio-search,代码行数:18,代码来源:JSONBuilder.java


示例20: concatenateTagFields

import org.jaudiotagger.tag.TagField; //导入依赖的package包/类
/**
 * <p>
 * Concatenate a number of field values into a string.
 * </p>
 * 
 * @param fieldValues a list with the field values
 * @param defaultValue the default value for the field
 * @return the value of the field, or the default value when fieldValues is
 *         null or empty
 * @see #concatenateTagValues(List, String)
 */
public static String concatenateTagFields(List<TagField> fieldValues, String defaultValue) {
  if ((fieldValues == null) || (fieldValues.size() == 0)) {
    return defaultValue;
  }

  List<String> values = new ArrayList<>(fieldValues.size());
  for (TagField tagField : fieldValues) {
    values.add(tagField.toString());
  }

  return concatenateTagValues(values, defaultValue);
}
 
开发者ID:fhuberts,项目名称:musicTreePrograms,代码行数:24,代码来源:TagUtils.java



注:本文中的org.jaudiotagger.tag.TagField类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JAXBContextImpl类代码示例发布时间:2022-05-22
下一篇:
Java GzipOutputFilter类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap