FileDocCategorySizeDatePackage
TKEYTextInformationID3V2Frame.javaAPI Docjid3 0.464125Sun Feb 06 18:11:24 GMT 2005org.blinkenlights.jid3.v2

TKEYTextInformationID3V2Frame

public class TKEYTextInformationID3V2Frame extends TextInformationID3V2Frame
author
paul Text frame containing the initial key in the track. It is represented as a string with a maximum length of three characters. The ground keys are represented with "A","B","C","D","E", "F" and "G" and halfkeys represented with "b" and "#". Minor is represented as "m". Example "Cbm". Off key is represented with an "o" only.

Fields Summary
private String
m_sInitialKey
Constructors Summary
public TKEYTextInformationID3V2Frame(String sInitialKey)
Constructor.

param
sInitialKey the initial key in the track
throws
ID3Exception if the initial key string is invalid


                           
      
         
    
        super(sInitialKey);

        // check to make sure initial key format is valid
        if (! sInitialKey.matches("([A-G][#b]?m?|o)"))
        {
            throw new ID3Exception("Invalid initial key string.");
        }
        
        m_sInitialKey = sInitialKey;
    
public TKEYTextInformationID3V2Frame(InputStream oIS)

        super(oIS);
        
        m_sInitialKey = m_sInformation;
    
Methods Summary
public voidaccept(ID3Visitor oID3Visitor)

        oID3Visitor.visitTKEYTextInformationID3V2Frame(this);
    
public booleanequals(java.lang.Object oOther)

        if ((oOther == null) || (!(oOther instanceof TKEYTextInformationID3V2Frame)))
        {
            return false;
        }
        
        TKEYTextInformationID3V2Frame oOtherTKEY = (TKEYTextInformationID3V2Frame)oOther;
        
        return (m_sInitialKey.equals(oOtherTKEY.m_sInitialKey) &&
                m_oTextEncoding.equals(oOtherTKEY.m_oTextEncoding) &&
                m_sInformation.equals(oOtherTKEY.m_sInformation));
    
protected byte[]getFrameId()

        return "TKEY".getBytes();
    
public java.lang.StringgetInitialKey()
Get the initial key of the track. There is no guarantee that values read from a file will be in a valid format.

return
the initial key in the track

        return m_sInitialKey;
    
public voidsetInitialKey(java.lang.String sInitialKey)
Set the initial key of the track.

param
sInitialKey the initial key in the track
throws
ID3Exception if the initial key string is invalid

        // check to make sure initial key format is valid
        if (! sInitialKey.matches("([A-G][#b]?m?|o)"))
        {
            throw new ID3Exception("Invalid initial key string.");
        }
        
        m_sInitialKey = sInitialKey;
        m_oTextEncoding = TextEncoding.getDefaultTextEncoding();
        m_sInformation = sInitialKey;
    
public java.lang.StringtoString()

        return "Initial key: [" + m_sInformation + "]";