FileDocCategorySizeDatePackage
AndroidArtwork.javaAPI DocJaudiotagger 2.0.45171Wed Jun 08 11:06:58 BST 2011org.jaudiotagger.tag.images

AndroidArtwork

public class AndroidArtwork extends Object implements Artwork
Represents artwork in a format independent way

Fields Summary
private byte[]
binaryData
private String
mimeType
private String
description
private boolean
isLinked
private String
imageUrl
private int
pictureType
private int
width
private int
height
Constructors Summary
public AndroidArtwork()


     
    

    
Methods Summary
public static org.jaudiotagger.tag.images.AndroidArtworkcreateArtworkFromFile(java.io.File file)
Create Artwork from File

param
file
return
throws
java.io.IOException

        AndroidArtwork artwork = new AndroidArtwork();
        artwork.setFromFile(file);
        return artwork;
    
public static org.jaudiotagger.tag.images.AndroidArtworkcreateArtworkFromMetadataBlockDataPicture(org.jaudiotagger.audio.flac.metadatablock.MetadataBlockDataPicture coverArt)
Create artwork from Flac block

param
coverArt
return

        AndroidArtwork artwork = new AndroidArtwork();
        artwork.setFromMetadataBlockDataPicture(coverArt);
        return artwork;
    
public static org.jaudiotagger.tag.images.AndroidArtworkcreateLinkedArtworkFromURL(java.lang.String url)

param
url
return
throws
IOException

        AndroidArtwork artwork = new AndroidArtwork();
        artwork.setLinkedFromURL(url);
        return artwork;
    
public byte[]getBinaryData()

        return binaryData;
    
public java.lang.StringgetDescription()

        return description;
    
public intgetHeight()

        return height;
    
public java.lang.ObjectgetImage()

        throw new UnsupportedOperationException();
    
public java.lang.StringgetImageUrl()

        return imageUrl;
    
public java.lang.StringgetMimeType()

        return mimeType;
    
public intgetPictureType()

        return pictureType;
    
public intgetWidth()

        return width;
    
public booleanisLinked()

        return isLinked;
    
public voidsetBinaryData(byte[] binaryData)

        this.binaryData = binaryData;
    
public voidsetDescription(java.lang.String description)

        this.description = description;
    
public voidsetFromFile(java.io.File file)
Create Artwork from File

param
file
throws
java.io.IOException

        RandomAccessFile imageFile = new RandomAccessFile(file, "r");
        byte[] imagedata = new byte[(int) imageFile.length()];
        imageFile.read(imagedata);
        imageFile.close();

        setBinaryData(imagedata);
        setMimeType(ImageFormats.getMimeTypeForBinarySignature(imagedata));
        setDescription("");
        setPictureType(PictureTypes.DEFAULT_ID);
    
public voidsetFromMetadataBlockDataPicture(org.jaudiotagger.audio.flac.metadatablock.MetadataBlockDataPicture coverArt)
Populate Artwork from MetadataBlockDataPicture as used by Flac and VorbisComment

param
coverArt

        setMimeType(coverArt.getMimeType());
        setDescription(coverArt.getDescription());
        setPictureType(coverArt.getPictureType());       
        if(coverArt.isImageUrl())
        {
            setLinked(coverArt.isImageUrl());
            setImageUrl(coverArt.getImageUrl());
        }
        else
        {
            setBinaryData(coverArt.getImageData());
        }
        setWidth(coverArt.getWidth());
        setHeight(coverArt.getHeight());
    
public voidsetHeight(int height)

        this.height = height;
    
public booleansetImageFromData()
Should be called when you wish to prime the artwork for saving

return

        throw new UnsupportedOperationException();
    
public voidsetImageUrl(java.lang.String imageUrl)

        this.imageUrl = imageUrl;
    
public voidsetLinked(boolean linked)

        isLinked = linked;
    
public voidsetLinkedFromURL(java.lang.String url)
Create Linked Artwork from URL

param
url
throws
java.io.IOException

          setLinked(true);
          setImageUrl(url);
      
public voidsetMimeType(java.lang.String mimeType)

        this.mimeType = mimeType;
    
public voidsetPictureType(int pictureType)

        this.pictureType = pictureType;
    
public voidsetWidth(int width)

        this.width = width;