当前位置: 首页>>代码示例>>Java>>正文


Java Artwork.isLinked方法代码示例

本文整理汇总了Java中org.jaudiotagger.tag.images.Artwork.isLinked方法的典型用法代码示例。如果您正苦于以下问题:Java Artwork.isLinked方法的具体用法?Java Artwork.isLinked怎么用?Java Artwork.isLinked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jaudiotagger.tag.images.Artwork的用法示例。


在下文中一共展示了Artwork.isLinked方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createMetadataBlockDataPicture

import org.jaudiotagger.tag.images.Artwork; //导入方法依赖的package包/类
/**
 * Create MetadataBlockPicture field, this is the preferred way of storing artwork in VorbisComment tag now but
 * has to be base encoded to be stored in VorbisComment
 *
 * @return MetadataBlockDataPicture
 */
private MetadataBlockDataPicture createMetadataBlockDataPicture(Artwork artwork) throws FieldDataInvalidException {
    if (artwork.isLinked()) {
        return new MetadataBlockDataPicture(
                Utils.getDefaultBytes(artwork.getImageUrl(), TextEncoding.CHARSET_ISO_8859_1),
                artwork.getPictureType(),
                MetadataBlockDataPicture.IMAGE_IS_URL,
                "",
                0,
                0,
                0,
                0);
    } else {
        if (!artwork.setImageFromData()) {
            throw new FieldDataInvalidException("Unable to create MetadataBlockDataPicture from buffered");
        }
        return new MetadataBlockDataPicture(artwork.getBinaryData(),
                artwork.getPictureType(),
                artwork.getMimeType(),
                artwork.getDescription(),
                artwork.getWidth(),
                artwork.getHeight(),
                0,
                0);
    }
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:32,代码来源:VorbisCommentTag.java

示例2: createField

import org.jaudiotagger.tag.images.Artwork; //导入方法依赖的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.images.Artwork; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
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,代码行数:25,代码来源:ID3v23Tag.java

示例4: createField

import org.jaudiotagger.tag.images.Artwork; //导入方法依赖的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

示例5: createMetadataBlockDataPicture

import org.jaudiotagger.tag.images.Artwork; //导入方法依赖的package包/类
private MetadataBlockDataPicture createMetadataBlockDataPicture(Artwork artwork) throws FieldDataInvalidException {
    if (artwork.isLinked()) {
        return new MetadataBlockDataPicture(
                artwork.getImageUrl().getBytes(StandardCharsets.ISO_8859_1),
                artwork.getPictureType(),
                MetadataBlockDataPicture.IMAGE_IS_URL,
                "",
                0,
                0,
                0,
                0);
    } else {
        if (!artwork.setImageFromData()) {
            throw new FieldDataInvalidException("Unable to create MetadataBlockDataPicture from buffered");
        }
        return new MetadataBlockDataPicture(artwork.getBinaryData(),
                artwork.getPictureType(),
                artwork.getMimeType(),
                artwork.getDescription(),
                artwork.getWidth(),
                artwork.getHeight(),
                0,
                0);
    }
}
 
开发者ID:Old-Geek,项目名称:Musique,代码行数:26,代码来源:VorbisCommentTag.java

示例6: createField

import org.jaudiotagger.tag.images.Artwork; //导入方法依赖的package包/类
public TagField createField(Artwork artwork) throws FieldDataInvalidException {
    if (artwork.isLinked()) {
        return new MetadataBlockDataPicture(
                artwork.getImageUrl().getBytes(StandardCharsets.ISO_8859_1),
                artwork.getPictureType(),
                MetadataBlockDataPicture.IMAGE_IS_URL,
                "",
                0,
                0,
                0,
                0);
    } else {
        if (!artwork.setImageFromData()) {
            throw new FieldDataInvalidException("Unable to createField buffered image from the image");
        }

        return new MetadataBlockDataPicture(artwork.getBinaryData(),
                artwork.getPictureType(),
                artwork.getMimeType(),
                artwork.getDescription(),
                artwork.getWidth(),
                artwork.getHeight(),
                0,
                0);
    }
}
 
开发者ID:Old-Geek,项目名称:Musique,代码行数:27,代码来源:FlacTag.java

示例7: createField

import org.jaudiotagger.tag.images.Artwork; //导入方法依赖的package包/类
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:Old-Geek,项目名称:Musique,代码行数:22,代码来源:ID3v22Tag.java

示例8: createMetadataBlockDataPicture

import org.jaudiotagger.tag.images.Artwork; //导入方法依赖的package包/类
/**
  * Create MetadataBlockPicture field, this is the preferred way of storing artwork in VorbisComment tag now but
  * has to be base encoded to be stored in VorbisComment
  *
  * @return MetadataBlockDataPicture
*/
 private MetadataBlockDataPicture createMetadataBlockDataPicture(Artwork artwork) throws FieldDataInvalidException
 {
     if(artwork.isLinked())
     {
         return new MetadataBlockDataPicture(
                 artwork.getImageUrl().getBytes(StandardCharsets.ISO_8859_1),
                 artwork.getPictureType(),
                 MetadataBlockDataPicture.IMAGE_IS_URL,
                 "",
                 0,
                 0,
                 0,
                 0);
     }
     else
     {
         if(!artwork.setImageFromData())
         {
             throw new FieldDataInvalidException("Unable to create MetadataBlockDataPicture from buffered");
         }
         return new MetadataBlockDataPicture(artwork.getBinaryData(),
                 artwork.getPictureType(),
                 artwork.getMimeType(),
                 artwork.getDescription(),
                 artwork.getWidth(),
                 artwork.getHeight(),
                 0,
                 0);
     }
 }
 
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:37,代码来源:VorbisCommentTag.java

示例9: createField

import org.jaudiotagger.tag.images.Artwork; //导入方法依赖的package包/类
/**
 * Create artwork field
 *
 * @return
 */
public TagField createField(Artwork artwork) throws FieldDataInvalidException
{
    if(artwork.isLinked())
    {
        return new MetadataBlockDataPicture(
                artwork.getImageUrl().getBytes(StandardCharsets.ISO_8859_1),
                artwork.getPictureType(),
                MetadataBlockDataPicture.IMAGE_IS_URL,
                "",
                0,
                0,
                0,
                0);
    }
    else
    {
        if(!artwork.setImageFromData())
        {
            throw new FieldDataInvalidException("Unable to createField buffered image from the image");
        }

        return new MetadataBlockDataPicture(artwork.getBinaryData(),
                artwork.getPictureType(),
                artwork.getMimeType(),
                artwork.getDescription(),
                artwork.getWidth(),
                artwork.getHeight(),
                0,
                0);
    }
}
 
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:37,代码来源:FlacTag.java

示例10: createField

import org.jaudiotagger.tag.images.Artwork; //导入方法依赖的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:GlennioTech,项目名称:MetadataEditor,代码行数:32,代码来源:ID3v22Tag.java

示例11: createField

import org.jaudiotagger.tag.images.Artwork; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */    
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:GlennioTech,项目名称:MetadataEditor,代码行数:32,代码来源:ID3v23Tag.java

示例12: createField

import org.jaudiotagger.tag.images.Artwork; //导入方法依赖的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:GlennioTech,项目名称:MetadataEditor,代码行数:29,代码来源:ID3v24Tag.java

示例13: createField

import org.jaudiotagger.tag.images.Artwork; //导入方法依赖的package包/类
/**
 * Create artwork field
 *
 * @return
 */
public TagField createField(Artwork artwork) throws FieldDataInvalidException {
    if (artwork.isLinked()) {
        return new MetadataBlockDataPicture(
                Utils.getDefaultBytes(artwork.getImageUrl(), TextEncoding.CHARSET_ISO_8859_1),
                artwork.getPictureType(),
                MetadataBlockDataPicture.IMAGE_IS_URL,
                "",
                0,
                0,
                0,
                0);
    } else {
        if (!artwork.setImageFromData()) {
            throw new FieldDataInvalidException("Unable to createField buffered image from the image");
        }

        return new MetadataBlockDataPicture(artwork.getBinaryData(),
                artwork.getPictureType(),
                artwork.getMimeType(),
                artwork.getDescription(),
                artwork.getWidth(),
                artwork.getHeight(),
                0,
                0);
    }
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:32,代码来源:FlacTag.java

示例14: embedArtwork

import org.jaudiotagger.tag.images.Artwork; //导入方法依赖的package包/类
/** If artwork is not saved directly on the tag in a file
 * and instead contains a url pointing to the image, attempt to
 * get the image and save it on the tag.
 * @param entry  Library file's equivalent to a track in iTunes. 
 */
public static void embedArtwork(Entry<String, Map> entry)
{	
	Tag tag = null;
	try
	{
		tag = Utils.getTagFromTrackEntry(entry);
		
		Artwork artwork = tag.getFirstArtwork();
		if(!artwork.isLinked())
		{
			return;
		}
			
		File file = new File(artwork.getImageUrl());
		tag.deleteArtworkField();
			
		StandardArtwork art = StandardArtwork.createArtworkFromFile(file);
		tag.addField(art);
		
		Utils.saveTagToFile(entry, tag);
		LOG.log(Level.FINE, "Sucessfully embedded artwork: " + tag.toString());
	}
	catch (IOException | TagException e)
	{
		LOG.log(Level.WARNING, "Failed to read/write artwork to file: " + tag.toString());
	}
	catch (StringIndexOutOfBoundsException ex)
	{
		// do nothing : bug w/ JAudioTagger, sometimes throws this ex
	}
}
 
开发者ID:Apophenic,项目名称:iD3,代码行数:37,代码来源:Functions.java

示例15: createMetadataBlockDataPicture

import org.jaudiotagger.tag.images.Artwork; //导入方法依赖的package包/类
/**
  * Create MetadataBlockPicture field, this is the preferred way of storing artwork in VorbisComment tag now but
  * has to be base encoded to be stored in VorbisComment
  *
  * @return MetadataBlockDataPicture
*/
 private MetadataBlockDataPicture createMetadataBlockDataPicture(Artwork artwork) throws FieldDataInvalidException
 {
     if(artwork.isLinked())
     {
          return new MetadataBlockDataPicture(
                 Utils.getDefaultBytes(artwork.getImageUrl(), TextEncoding.CHARSET_ISO_8859_1),
                 artwork.getPictureType(),
                 MetadataBlockDataPicture.IMAGE_IS_URL,
                 "",
                 0,
                 0,
                 0,
                 0);
     }
     else
     {
         if(!artwork.setImageFromData())
         {
             throw new FieldDataInvalidException("Unable to create MetadataBlockDataPicture from buffered");
         }
         return new MetadataBlockDataPicture(artwork.getBinaryData(),
                 artwork.getPictureType(),
                 artwork.getMimeType(),
                 artwork.getDescription(),
                 artwork.getWidth(),
                 artwork.getHeight(),
                 0,
                 0);
     }
 }
 
开发者ID:Dynious,项目名称:SoundsCool,代码行数:37,代码来源:VorbisCommentTag.java


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