FileDocCategorySizeDatePackage
TPE1TextInformationID3V2Frame.javaAPI Docjid3 0.465749Sun Feb 06 18:11:23 GMT 2005org.blinkenlights.jid3.v2

TPE1TextInformationID3V2Frame

public class TPE1TextInformationID3V2Frame extends TextInformationID3V2Frame
author
paul Text frame containing the lead artist(s), lead performer(s), soloist(s) or performing group in the track.

Fields Summary
private String[]
m_asLeadPerformer
Constructors Summary
public TPE1TextInformationID3V2Frame(String sLeadPerformer)
Constructor.

param
sLeadPerformer the lead artist, performer, soloist or performing group in the track

    
                       
      
    
        super(sLeadPerformer);
        
        m_asLeadPerformer = getPerformers(sLeadPerformer);
    
public TPE1TextInformationID3V2Frame(String[] asLeadPerformer)
Constructor.

param
asLeadPerformer the lead artist(s), performer(s), soloist(s) or performing group in this track

        super("");
        
        // build single string of composers, separated by "/", as described in ID3 spec
        StringBuffer sbLeadPerformers = new StringBuffer();
        for (int i=0; i < asLeadPerformer.length; i++)
        {
            sbLeadPerformers.append(asLeadPerformer[i] + "/");
        }
        sbLeadPerformers.deleteCharAt(sbLeadPerformers.length()-1);   // delete last "/"
        m_sInformation = sbLeadPerformers.toString();
        
        m_asLeadPerformer = getPerformers(m_sInformation);
    
public TPE1TextInformationID3V2Frame(InputStream oIS)

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

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

        if ((oOther == null) || (!(oOther instanceof TPE1TextInformationID3V2Frame)))
        {
            return false;
        }
        
        TPE1TextInformationID3V2Frame oOtherTPE1 = (TPE1TextInformationID3V2Frame)oOther;
        
        return (m_sInformation.equals(oOtherTPE1.m_sInformation) &&
                m_oTextEncoding.equals(oOtherTPE1.m_oTextEncoding) &&
                Arrays.equals(m_asLeadPerformer, oOtherTPE1.m_asLeadPerformer));
    
protected byte[]getFrameId()

        return "TPE1".getBytes();
    
public java.lang.String[]getLeadPerformers()
Get the lead artist(s), performer(s), soloist(s) or performing group for this track.

return
the lead artist(s), performer(s), soloist(s) or performing group for this track

        return m_asLeadPerformer;
    
private java.lang.String[]getPerformers(java.lang.String sValue)
Split a string containing potentially several distinct values (forward-slash separated) into an array of Strings, one value per String.

param
sValue value to be separated
return
an array of values

        String[] asPerformer = sValue.split("/");
        
        return asPerformer;
    
public voidsetLeadPerformer(java.lang.String sLeadPerformer)
Set the lead artist, performer, soloist or performing group for this track. Multiple values can optionally be set with this method by separating them with a slash "/" character.

param
sLeadPerformer the lead artist, performer, soloist or performing group for this track

        m_oTextEncoding = TextEncoding.getDefaultTextEncoding();
        m_sInformation = sLeadPerformer;
        m_asLeadPerformer = getPerformers(sLeadPerformer);
    
public voidsetLeadPerformers(java.lang.String[] asLeadPerformer)
Set the lead artist(s), performer(s), soloist(s) or performing group for this track.

param
asLeadPerformer the lead artist(s), performer(s), soloist(s) or performing group for this track

        // build single string of performers, separated by "/", as described in ID3 spec
        StringBuffer sbLeadPerformers = new StringBuffer();
        for (int i=0; i < asLeadPerformer.length; i++)
        {
            sbLeadPerformers.append(asLeadPerformer[i] + "/");
        }
        sbLeadPerformers.deleteCharAt(sbLeadPerformers.length()-1);   // delete last "/"
        m_oTextEncoding = TextEncoding.getDefaultTextEncoding();
        m_sInformation = sbLeadPerformers.toString();
        
        m_asLeadPerformer = getPerformers(m_sInformation);
    
public java.lang.StringtoString()

        return "Lead performer(s)/Soloist(s): [" + m_sInformation + "]";