Methods Summary |
---|
public void | accept(ID3Visitor oID3Visitor)
oID3Visitor.visitID3V1_1Tag(this);
|
public int | getAlbumTrack()Get the album track number.
return m_iAlbumTrack;
|
public void | setAlbumTrack(int iAlbumTrack)Set the track number for this title on the album from which it came.
if ((iAlbumTrack > 0) && (iAlbumTrack < 256))
{
m_iAlbumTrack = iAlbumTrack;
}
else
{
throw new ID3Exception("Illegal album track value " + iAlbumTrack + ". Valid range from 1 to 255.");
}
|
public void | setComment(java.lang.String sComment)
if (sComment.length() > 28)
{
sComment = sComment.substring(0, 28);
}
m_sComment = sComment;
|
public java.lang.String | toString()
return super.toString() + "\nAlbumTrack = " + m_iAlbumTrack;
|
public void | write(java.io.OutputStream oOS)
try
{
oOS.write("TAG".getBytes());
// song title
if (getTitle() != null)
{
byte[] abySongTitle = getTitle().getBytes();
oOS.write(abySongTitle);
oOS.write(new byte[30 - abySongTitle.length]); // padding to equal 30 bytes for song title
}
else
{
oOS.write(new byte[30]); // no value, just padding
}
// artist
if (getArtist() != null)
{
byte[] abyArtist = getArtist().getBytes();
oOS.write(abyArtist);
oOS.write(new byte[30 - abyArtist.length]); // padding to equal 30 bytes for artist
}
else
{
oOS.write(new byte[30]); // no value, just padding
}
// album
if (getAlbum() != null)
{
byte[] abyAlbum = getAlbum().getBytes();
oOS.write(abyAlbum);
oOS.write(new byte[30 - abyAlbum.length]); // padding to equal 30 bytes for album
}
else
{
oOS.write(new byte[30]); // no value, just padding
}
// year
if (getYear() != null)
{
byte[] abyYear = getYear().getBytes();
oOS.write(abyYear);
oOS.write(new byte[4 - abyYear.length]); // padding to equal 4 bytes for year
}
else
{
oOS.write(new byte[4]); // no value, just padding
}
// comment
if (getComment() != null)
{
byte[] abyComment = getComment().getBytes();
oOS.write(abyComment);
oOS.write(new byte[28 - abyComment.length]); // padding to equal 28 bytes for comment (plus one terminating one)
}
else
{
oOS.write(new byte[28]); // no value, just padding
}
// separator byte
oOS.write(0);
// album track
oOS.write(getAlbumTrack());
// genre
if (getGenre() != null)
{
oOS.write(getGenre().getByteValue());
}
else
{
oOS.write(0);
}
}
catch (Exception e)
{
throw new ID3Exception(e);
}
|