net.shredzone.ifish.ltr
Class TagMp3v200

java.lang.Object
  extended by net.shredzone.ifish.ltr.LTR
      extended by net.shredzone.ifish.ltr.LTRmp3
          extended by net.shredzone.ifish.ltr.TagMp3v200

public class TagMp3v200
extends LTRmp3

Decodes an MP3 file with old ID3v2.00 tag. The file is compliant to the specifications found at www.id3.org. Only ID3 V2.00 up to v2.2.0 is handled here. Newer versions are separately handled in TagMp3v2.

Version:
$Id: TagMp3v200.java 338 2009-06-28 23:15:58Z shred $

Field Summary
 
Fields inherited from class net.shredzone.ifish.ltr.LTR
factory, in
 
Constructor Summary
TagMp3v200(RandomAccessFile in, LTRFactory factory)
          Create a new TagMp3v200 instance.
 
Method Summary
 String getAlbum()
          Get the album.
 String getArtist()
          Get the artist.
 String getComment()
          Get the comment.
 String getGenre()
          Get the genre.
 String getTitle()
          Get the title.
 String getTrack()
          Get the track.
 String getType()
          Get the type of this file.
 String getYear()
          Get the year.
protected  int read3Int()
          Read an ID3v2 3 byte integer.
protected  net.shredzone.ifish.ltr.TagMp3v200.Frame readFrame()
          Read a tag frame.
 
Methods inherited from class net.shredzone.ifish.ltr.LTRmp3
decodeGenre, readInt, readSyncsafe, readSyncsafeInt
 
Methods inherited from class net.shredzone.ifish.ltr.LTR
readStringLen, readStringLen, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TagMp3v200

public TagMp3v200(RandomAccessFile in,
                  LTRFactory factory)
           throws FormatDecodeException
Create a new TagMp3v200 instance.

Parameters:
in - File to be read
factory - Reference to the LTRFactory
Throws:
FormatDecodeException - Couldn't decode this file
Method Detail

getType

public String getType()
Get the type of this file. This is usually the compression format itself (e.g. "OGG" or "MP3"). If there are different taggings for this format, the used tag format is appended after a slash (e.g. "MP3/id3v2").

Specified by:
getType in class LTR
Returns:
The type

getArtist

public String getArtist()
Get the artist.

Specified by:
getArtist in class LTR
Returns:
The artist (never null)

getAlbum

public String getAlbum()
Get the album.

Specified by:
getAlbum in class LTR
Returns:
The album (never null)

getTitle

public String getTitle()
Get the title.

Specified by:
getTitle in class LTR
Returns:
The title (never null)

getGenre

public String getGenre()
Get the genre.

Specified by:
getGenre in class LTR
Returns:
The genre (never null)

getYear

public String getYear()
Get the year.

Specified by:
getYear in class LTR
Returns:
The year (never null)

getComment

public String getComment()
Get the comment.

Specified by:
getComment in class LTR
Returns:
The comment (never null)

getTrack

public String getTrack()
Get the track.

Specified by:
getTrack in class LTR
Returns:
The track (never null)

readFrame

protected net.shredzone.ifish.ltr.TagMp3v200.Frame readFrame()
                                                      throws IOException
Read a tag frame. A Frame object will be returned, or null if no more frames were available.

Returns:
The next frame, or null
Throws:
IOException - If premature EOF was reached.

read3Int

protected int read3Int()
                throws IOException
Read an ID3v2 3 byte integer. This is a 3 byte big endian value, which is always not syncsafe.

Returns:
The integer read.
Throws:
IOException - If there were not enough bytes in the file.


Copyright © 2007-2011 shredzone.org. All Rights Reserved.