org.farng.mp3.id3
Class ID3v1_1

java.lang.Object
  extended byorg.farng.mp3.AbstractMP3FileItem
      extended byorg.farng.mp3.AbstractMP3Tag
          extended byorg.farng.mp3.id3.AbstractID3
              extended byorg.farng.mp3.id3.AbstractID3v1
                  extended byorg.farng.mp3.id3.ID3v1
                      extended byorg.farng.mp3.id3.ID3v1_1

public class ID3v1_1
extends ID3v1

What is ID3v1.1?

ID3v1 may well be easy to implement for programmers, but it sure is frustrating for those with their own, creative ideas. Since the ID3v1 tag had a fixed size and no space marked "Reserved for future use", there isn't really room for that much improvement, if you want to maintain compatibility with existing software.

One who found a way out was Michael Mutschler who made a quite clever improvement on ID3v1. Since all non-filled fields must be padded with zeroed bytes its a good assumption that all ID3v1 readers will stop reading the field when they encounter a zeroed byte. If the second last byte of a field is zeroed and the last one isn't we have an extra byte to fill with information. As the comments field is to short to write anything useful in the ID3v1.1 standard declares that this field should be 28 characters, that the next byte always should be zero and that the last byte before the genre byte should contain which track on the CD this music comes from.

Version:
$Revision: 1.7 $
Author:
Eric Farng

Field Summary
protected  byte track
           
 
Fields inherited from class org.farng.mp3.id3.ID3v1
album, artist, comment, genre, title, year
 
Constructor Summary
ID3v1_1()
          Creates a new ID3v1_1 object.
ID3v1_1(AbstractMP3Tag mp3tag)
          Creates a new ID3v1_1 object.
ID3v1_1(ID3v1_1 copyObject)
          Creates a new ID3v1_1 object.
ID3v1_1(java.io.RandomAccessFile file)
          Creates a new ID3v1_1 object.
 
Method Summary
 void append(AbstractMP3Tag tag)
          This method does nothing, but is called by subclasses for completeness
 boolean equals(java.lang.Object obj)
          Determines whether another object is equal to this tag.
 java.lang.String getComment()
           
 java.lang.String getIdentifier()
          ID string that usually corresponds to the class name, but can be displayed to the user.
 byte getTrack()
           
 java.lang.String getTrackNumberOnAlbum()
           
 void overwrite(AbstractMP3Tag tag)
          This method does nothing, but is called by subclasses for completeness
 void read(java.io.RandomAccessFile file)
          import java.io.IOException; import java.io.RandomAccessFile; read from current file pointer position.
 boolean seek(java.io.RandomAccessFile file)
          Looks for this tag.
 void setComment(java.lang.String comment)
           
 void setTrack(byte track)
           
 void setTrackNumberOnAlbum(java.lang.String trackNumberOnAlbum)
           
 java.lang.String toString()
           
 void write(AbstractMP3Tag tag)
          This method does nothing, but is called by subclasses for completeness
 void write(java.io.RandomAccessFile file)
          Method to write this object to the file argument at is current file pointer position.
 
Methods inherited from class org.farng.mp3.id3.ID3v1
delete, getAlbum, getAlbumTitle, getArtist, getAuthorComposer, getGenre, getID3tag, getLeadArtist, getSize, getSongComment, getSongGenre, getSongLyric, getSongTitle, getTitle, getYear, getYearReleased, iterator, setAlbum, setAlbumTitle, setArtist, setAuthorComposer, setGenre, setLeadArtist, setSongComment, setSongGenre, setSongLyric, setSongTitle, setTitle, setYear, setYearReleased
 
Methods inherited from class org.farng.mp3.id3.AbstractID3v1
append, overwrite
 
Methods inherited from class org.farng.mp3.AbstractMP3Tag
isSubsetOf
 
Methods inherited from class org.farng.mp3.AbstractMP3FileItem
isSubsetOf
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

track

protected byte track
Constructor Detail

ID3v1_1

public ID3v1_1()
Creates a new ID3v1_1 object.


ID3v1_1

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


ID3v1_1

public ID3v1_1(AbstractMP3Tag mp3tag)
Creates a new ID3v1_1 object.


ID3v1_1

public ID3v1_1(java.io.RandomAccessFile file)
        throws TagNotFoundException,
               java.io.IOException
Creates a new ID3v1_1 object.

Method Detail

setComment

public void setComment(java.lang.String comment)
Overrides:
setComment in class ID3v1

getComment

public java.lang.String getComment()
Overrides:
getComment in class ID3v1

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.

Overrides:
getIdentifier in class ID3v1

setTrack

public void setTrack(byte track)

getTrack

public byte getTrack()

append

public void append(AbstractMP3Tag tag)
Description copied from class: AbstractMP3Tag
This method does nothing, but is called by subclasses for completeness

Overrides:
append in class ID3v1

equals

public boolean equals(java.lang.Object obj)
Description copied from class: AbstractMP3Tag
Determines whether another object is equal to this tag. It just compares if they are the same class, then calls super.equals(object).

Overrides:
equals in class ID3v1

overwrite

public void overwrite(AbstractMP3Tag tag)
Description copied from class: AbstractMP3Tag
This method does nothing, but is called by subclasses for completeness

Overrides:
overwrite in class ID3v1

read

public void read(java.io.RandomAccessFile file)
          throws TagNotFoundException,
                 java.io.IOException
Description copied from class: AbstractMP3FileItem
import java.io.IOException; import java.io.RandomAccessFile; read from current file pointer position.

Overrides:
read in class ID3v1
Throws:
TagNotFoundException
java.io.IOException

seek

public boolean seek(java.io.RandomAccessFile file)
             throws java.io.IOException
Description copied from class: AbstractMP3Tag
Looks for this tag. returns true if found. If found, the file pointer is right after the tag start indicator i.e. "TAG" "LYRICSBEGIN" "ID3" + 2

Overrides:
seek in class ID3v1
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class ID3v1

write

public void write(AbstractMP3Tag tag)
Description copied from class: AbstractMP3Tag
This method does nothing, but is called by subclasses for completeness

Overrides:
write in class ID3v1

write

public void write(java.io.RandomAccessFile file)
           throws java.io.IOException
Description copied from class: AbstractMP3FileItem
Method to write this object to the file argument at is current file pointer position.

Overrides:
write in class ID3v1
Throws:
java.io.IOException

getTrackNumberOnAlbum

public java.lang.String getTrackNumberOnAlbum()
Overrides:
getTrackNumberOnAlbum in class ID3v1

setTrackNumberOnAlbum

public void setTrackNumberOnAlbum(java.lang.String trackNumberOnAlbum)
Overrides:
setTrackNumberOnAlbum in class ID3v1


Copyright (c) 2004 Eric Farng