org.blinkenlights.jid3.v2
Class SYLTID3V2Frame

java.lang.Object
  extended byorg.blinkenlights.jid3.v2.ID3V2Frame
      extended byorg.blinkenlights.jid3.v2.SYLTID3V2Frame
All Implemented Interfaces:
ID3Subject, ID3Visitable

public class SYLTID3V2Frame
extends ID3V2Frame

Frame containing synchronized lyrics/text.


Nested Class Summary
static class SYLTID3V2Frame.ContentType
          Content type.
static class SYLTID3V2Frame.SyncEntry
          SyncEntry class.
static class SYLTID3V2Frame.TimestampFormat
          Timestamp format.
 
Constructor Summary
SYLTID3V2Frame(java.io.InputStream oIS)
           
SYLTID3V2Frame(java.lang.String sLanguage, SYLTID3V2Frame.TimestampFormat oTimestampFormat, SYLTID3V2Frame.ContentType oContentType, java.lang.String sContentDescriptor)
          Creates a new instance of SYLTID3V2Frame.
 
Method Summary
 void accept(ID3Visitor oID3Visitor)
          Accept a visitor.
 void addSyncEntry(SYLTID3V2Frame.SyncEntry oSyncEntry)
          Add a sync entry to the frame.
 boolean equals(java.lang.Object oOther)
           
 java.lang.String getContentDescriptor()
          Get the content descriptor for this frame.
 SYLTID3V2Frame.ContentType getContentType()
          Get the content type.
protected  byte[] getFrameId()
          Get the four bytes which uniquely specify of which type this frame is.
 java.lang.String getLanguage()
          Get the language used in this frame.
 SYLTID3V2Frame.SyncEntry getSyncEntry(int iTimestamp)
          Get a sync entry from this frame.
 TextEncoding getTextEncoding()
          Get the text encoding used for the content descriptor and text in this frame.
 SYLTID3V2Frame.TimestampFormat getTimestampFormat()
          Get the timestamp format used.
 int[] getTimestamps()
          Get all timestamps for which entries have been set in this frame.
 SYLTID3V2Frame.SyncEntry removeSyncEntry(int iTimestamp)
          Remove a sync entry from this frame.
 void setContentDescriptor(java.lang.String sContentDescriptor)
          Set the content descriptor for this frame.
 void setContentType(SYLTID3V2Frame.ContentType oContentType)
          Set the content type.
 void setLanguage(java.lang.String sLanguage)
          Set the language used in this frame.
 void setTextEncoding(TextEncoding oTextEncoding)
          Set the text encoding to be used for the content descriptor and text in this frame.
 void setTimestampFormat(SYLTID3V2Frame.TimestampFormat oTimestampFormat)
          Set the timestamp format used.
 java.lang.String toString()
          Represent the contents of this frame as a string.
protected  void writeBody(ID3DataOutputStream oIDOS)
          Write the body of the frame to an ID3 data output stream.
 
Methods inherited from class org.blinkenlights.jid3.v2.ID3V2Frame
addID3Observer, getEncryptionMethod, isEncrypted, notifyID3Observers, removeID3Observer, setCompressionFlag, setEncryption, setFileAlterPreservationFlag, setGroupingIdentityFlag, setReadOnlyFlag, setTagAlterPreservationFlag, write, writeHeader
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SYLTID3V2Frame

public SYLTID3V2Frame(java.lang.String sLanguage,
                      SYLTID3V2Frame.TimestampFormat oTimestampFormat,
                      SYLTID3V2Frame.ContentType oContentType,
                      java.lang.String sContentDescriptor)
               throws ID3Exception
Creates a new instance of SYLTID3V2Frame.

Parameters:
sLanguage - three letter language code for the content descriptor
oTimestampFormat - the timestamp format used in this frame
oContentType - the content for which synchronization is set
sContentDescriptor - a unique text description for the synchronization details
Throws:
ID3Exception - if language is not three characters, or if oTimestampFormat, oContentType or sContentDescriptor are null

SYLTID3V2Frame

public SYLTID3V2Frame(java.io.InputStream oIS)
               throws ID3Exception
Method Detail

accept

public void accept(ID3Visitor oID3Visitor)
Description copied from interface: ID3Visitable
Accept a visitor.

Parameters:
oID3Visitor - a visitor of this object

setTextEncoding

public void setTextEncoding(TextEncoding oTextEncoding)
Set the text encoding to be used for the content descriptor and text in this frame.

Parameters:
oTextEncoding - the text encoding to be used for this frame

getTextEncoding

public TextEncoding getTextEncoding()
Get the text encoding used for the content descriptor and text in this frame.

Returns:
the text encoding to be used for this frame

setLanguage

public void setLanguage(java.lang.String sLanguage)
                 throws ID3Exception
Set the language used in this frame.

Parameters:
sLanguage - a three letter language code
Throws:
ID3Exception - if the language is null or not three characters in length or if this frame is in a tag which contains another SYLT frame with the same language and content descriptor
ID3Exception - if this frame is in a tag with another SYLT frame which would have the same language and content descriptor

getLanguage

public java.lang.String getLanguage()
Get the language used in this frame.

Returns:
a three letter language code

setTimestampFormat

public void setTimestampFormat(SYLTID3V2Frame.TimestampFormat oTimestampFormat)
Set the timestamp format used.

Parameters:
oTimestampFormat - the timestamp format used in this frame

getTimestampFormat

public SYLTID3V2Frame.TimestampFormat getTimestampFormat()
Get the timestamp format used.

Returns:
the timestamp format

setContentType

public void setContentType(SYLTID3V2Frame.ContentType oContentType)
Set the content type.

Parameters:
oContentType - the content type for this frame

getContentType

public SYLTID3V2Frame.ContentType getContentType()
Get the content type.

Returns:
the content type

setContentDescriptor

public void setContentDescriptor(java.lang.String sContentDescriptor)
                          throws ID3Exception
Set the content descriptor for this frame.

Parameters:
sContentDescriptor - the content descriptor for this frame
Throws:
ID3Exception - if the content descriptor is null
ID3Exception - if this frame is in a tag with another SYLT frame which would have the same language and content descriptor

getContentDescriptor

public java.lang.String getContentDescriptor()
Get the content descriptor for this frame.

Returns:
the content descriptor

addSyncEntry

public void addSyncEntry(SYLTID3V2Frame.SyncEntry oSyncEntry)
                  throws ID3Exception
Add a sync entry to the frame.

Parameters:
oSyncEntry - the sync entry to be added to this frame
Throws:
ID3Exception - if oSyncEntry is null, or if a sync entry for this timestamp already exists in this frame

getSyncEntry

public SYLTID3V2Frame.SyncEntry getSyncEntry(int iTimestamp)
Get a sync entry from this frame.

Parameters:
iTimestamp - the timestamp for which the sync entry should be returned
Returns:
the sync entry object matching the specified timestamp, or null if no matching tiemstamp exists

removeSyncEntry

public SYLTID3V2Frame.SyncEntry removeSyncEntry(int iTimestamp)
Remove a sync entry from this frame.

Parameters:
iTimestamp - the timestamp for which the sync entry is to be removed
Returns:
the previously set sync entry for this timestamp, or null if no sync entry was set for this timestamp

getTimestamps

public int[] getTimestamps()
Get all timestamps for which entries have been set in this frame.

Returns:
an array of ints, containing all of the timestamps

getFrameId

protected byte[] getFrameId()
Description copied from class: ID3V2Frame
Get the four bytes which uniquely specify of which type this frame is.

Specified by:
getFrameId in class ID3V2Frame

toString

public java.lang.String toString()
Description copied from class: ID3V2Frame
Represent the contents of this frame as a string. For debugging purposes.

Specified by:
toString in class ID3V2Frame
Returns:
a string representing this frame

writeBody

protected void writeBody(ID3DataOutputStream oIDOS)
                  throws java.io.IOException
Description copied from class: ID3V2Frame
Write the body of the frame to an ID3 data output stream.

Specified by:
writeBody in class ID3V2Frame
Parameters:
oIDOS - the output stream to write to
Throws:
java.io.IOException

equals

public boolean equals(java.lang.Object oOther)