org.farng.mp3.lyrics3
Class FieldBodyIMG

java.lang.Object
  extended byorg.farng.mp3.AbstractMP3FileItem
      extended byorg.farng.mp3.AbstractMP3FragmentBody
          extended byorg.farng.mp3.lyrics3.AbstractLyrics3v2FieldBody
              extended byorg.farng.mp3.lyrics3.FieldBodyIMG

public class FieldBodyIMG
extends AbstractLyrics3v2FieldBody

Link to an image files (BMP or JPG format). Image lines include filename, description and timestamp separated by delimiter - two ASCII chars 124 ("||"). Description and timestamp are optional, but if timestamp is used, and there is no description, two delimiters ("||||") should be used between the filename and the timestamp. Multiple images are allowed by using a [CR][LF] delimiter between each image line. No [CR][LF] is needed after the last image line. Number of images is not limited (except by the field size).
Filename can be in one of these formats:

Description can be up to 250 chars long.
Timestamp must be formatted like the lyrics timestamp which is "[mm:ss]". If an image has a timestamp, then the visible image will automatically switch to that image on the timestamp play time, just the same as the selected lyrics line is switched based on timestamps.

Version:
$Revision: 1.4 $
Author:
Eric Farng

Constructor Summary
FieldBodyIMG()
          Creates a new FieldBodyIMG object.
FieldBodyIMG(FieldBodyIMG copyObject)
          Creates a new FieldBodyIMG object.
FieldBodyIMG(ObjectLyrics3Image image)
          Creates a new FieldBodyIMG object.
FieldBodyIMG(java.io.RandomAccessFile file)
          Creates a new FieldBodyIMG object.
FieldBodyIMG(java.lang.String imageString)
          Creates a new FieldBodyIMG object.
 
Method Summary
 void addImage(ObjectLyrics3Image image)
           
 boolean equals(java.lang.Object obj)
          Returns true if this object and its entire MP3Object array list equals the argument.
 java.lang.String getIdentifier()
          ID string that usually corresponds to the class name, but can be displayed to the user.
 int getSize()
          Returns the estimated size in bytes of this object if it was to be written to file.
 java.lang.String getValue()
           
 boolean isSubsetOf(java.lang.Object object)
          Returns true if this instance and its entire MP3Object array list is a subset of the argument.
 java.util.Iterator iterator()
          Returns an iterator of the MP3Object object list.
 void read(java.io.RandomAccessFile file)
          Read the data from the given file into this object.
protected  void setupObjectList()
          Create the order of MP3Object objects that this body expects.
 void setValue(java.lang.String value)
           
 java.lang.String toString()
          Calls toString for all MP3Object objects and creates a string with a new line character.
 void write(java.io.RandomAccessFile file)
          Write the contents of this object to the file at the position it is currently at.
 
Methods inherited from class org.farng.mp3.lyrics3.AbstractLyrics3v2FieldBody
readHeader, writeHeader
 
Methods inherited from class org.farng.mp3.AbstractMP3FragmentBody
appendToObjectList, getBriefDescription, getDescription, getObject, getObjectListIterator, has6ByteHeader, setObject
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FieldBodyIMG

public FieldBodyIMG()
Creates a new FieldBodyIMG object.


FieldBodyIMG

public FieldBodyIMG(FieldBodyIMG copyObject)
Creates a new FieldBodyIMG object.


FieldBodyIMG

public FieldBodyIMG(java.lang.String imageString)
Creates a new FieldBodyIMG object.


FieldBodyIMG

public FieldBodyIMG(ObjectLyrics3Image image)
Creates a new FieldBodyIMG object.


FieldBodyIMG

public FieldBodyIMG(java.io.RandomAccessFile file)
             throws InvalidTagException,
                    java.io.IOException
Creates a new FieldBodyIMG object.

Method Detail

getIdentifier

public java.lang.String getIdentifier()
Description copied from class: AbstractMP3FileItem
ID string that usually corresponds to the class name, but can be displayed to the user. It is not indended to identify each individual instance.

Specified by:
getIdentifier in class AbstractMP3FileItem
Returns:
ID string

getSize

public int getSize()
Description copied from class: AbstractMP3FragmentBody
Returns the estimated size in bytes of this object if it was to be written to file. This is not guaranteed to be accurate 100% of the time.

Overrides:
getSize in class AbstractMP3FragmentBody
Returns:
estimated size in bytes of this object

isSubsetOf

public boolean isSubsetOf(java.lang.Object object)
Description copied from class: AbstractMP3FragmentBody
Returns true if this instance and its entire MP3Object array list is a subset of the argument. This class is a subset if it is the same class as the argument.

Overrides:
isSubsetOf in class AbstractMP3FragmentBody
Parameters:
object - object to determine subset of
Returns:
true if this instance and its entire object array list is a subset of the argument.

setValue

public void setValue(java.lang.String value)

getValue

public java.lang.String getValue()

addImage

public void addImage(ObjectLyrics3Image image)

equals

public boolean equals(java.lang.Object obj)
Description copied from class: AbstractMP3FragmentBody
Returns true if this object and its entire MP3Object array list equals the argument. This object is equal to the argument only if they are the same class.

Overrides:
equals in class AbstractMP3FragmentBody
Parameters:
obj - object to determine equality of
Returns:
true if this object and its entire MP3Object array list equals the argument.

iterator

public java.util.Iterator iterator()
Description copied from class: AbstractMP3FragmentBody
Returns an iterator of the MP3Object object list.

Overrides:
iterator in class AbstractMP3FragmentBody
Returns:
iterator of the MP3Object object list.

setupObjectList

protected void setupObjectList()
Description copied from class: AbstractMP3FragmentBody
Create the order of MP3Object objects that this body expects. This method needs to be overwritten.

Specified by:
setupObjectList in class AbstractMP3FragmentBody

read

public void read(java.io.RandomAccessFile file)
          throws InvalidTagException,
                 java.io.IOException
Description copied from class: AbstractMP3FragmentBody
Read the data from the given file into this object. The file needs to have its file pointer in the correct location.

Overrides:
read in class AbstractMP3FragmentBody
Parameters:
file - file to read from
Throws:
InvalidTagException - if there is any error in the data format.
java.io.IOException - on any I/O error

toString

public java.lang.String toString()
Description copied from class: AbstractMP3FragmentBody
Calls toString for all MP3Object objects and creates a string with a new line character.

Overrides:
toString in class AbstractMP3FragmentBody
Returns:
description string

write

public void write(java.io.RandomAccessFile file)
           throws java.io.IOException
Description copied from class: AbstractMP3FragmentBody
Write the contents of this object to the file at the position it is currently at.

Overrides:
write in class AbstractMP3FragmentBody
Parameters:
file - destination file
Throws:
java.io.IOException - on any I/O error


Copyright (c) 2004 Eric Farng