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

RVRBID3V2Frame

public class RVRBID3V2Frame extends ID3V2Frame
Frame containing reverb information.
author
paul

Fields Summary
private int
m_iReverbLeftMS
private int
m_iReverbRightMS
private int
m_iReverbBouncesLeft
private int
m_iReverbBouncesRight
private int
m_iReverbFeedbackLeftToLeft
private int
m_iReverbFeedbackLeftToRight
private int
m_iReverbFeedbackRightToRight
private int
m_iReverbFeedbackRightToLeft
private int
m_iPremixLeftToRight
private int
m_iPremixRightToLeft
Constructors Summary
public RVRBID3V2Frame(int iReverbLeftMS, int iReverbRightMS, int iReverbBouncesLeft, int iReverbBouncesRight, int iReverbFeedbackLeftToLeft, int iReverbFeedbackLeftToRight, int iReverbFeedbackRightToRight, int iReverbFeedbackRightToLeft, int iPremixLeftToRight, int iPremixRightToLeft)
Creates a new instance of RVRBID3V2Frame.

param
iReverbLeftMS the delay between bounces in milliseconds for the left channel (16-bit unsigned)
param
iReverbRightMS the delay between bounces in milliseconds for the right channel (16-bit unsigned)
param
iReverbBouncesLeft the number of bounces to make in the left channel (unsigned byte)
param
iReverbBouncesRight the number of bounces to make in the right channel (unsigned byte)
param
iReverbFeedbackLeftToLeft percentage of feedback from left to left (0-255)
param
iReverbFeedbackLeftToRight percentage of feedback from left to right (0-255)
param
iReverbFeedbackRightToRight percentage of feedback from right to right (0-255)
param
iReverbFeedbackRightToLeft percentage of feedback from right to left (0-255)
param
iPremixLeftToRight percentage of left channel mixed to right before reverb (0-255)
param
iPremixRightToLeft percentage of right channel mixed to left before reverb (0-255)
throws
ID3Exception if any value is out of its valid range

        if ((iReverbLeftMS < 0) || (iReverbLeftMS > 65535))
        {
            throw new ID3Exception("Reverb left milliseconds must be an unsigned 16-bit value in RVRB frame.");
        }
        m_iReverbLeftMS = iReverbLeftMS;
        if ((iReverbRightMS < 0) || (iReverbRightMS > 65535))
        {
            throw new ID3Exception("Reverb right milliseconds must be an unsigned 16-bit value in RVRB frame.");
        }
        m_iReverbRightMS = iReverbRightMS;
        if ((iReverbBouncesLeft < 0) || (iReverbBouncesLeft > 255))
        {
            throw new ID3Exception("Reverb bounces left value must be between 0 and 255 in RVRB frame.");
        }
        m_iReverbBouncesLeft = iReverbBouncesLeft;
        if ((iReverbBouncesRight < 0) || (iReverbBouncesRight > 255))
        {
            throw new ID3Exception("Reverb bounces right value must be between 0 and 255 in RVRB frame.");
        }
        m_iReverbBouncesRight = iReverbBouncesRight;
        if ((iReverbFeedbackLeftToLeft < 0) || (iReverbFeedbackLeftToLeft > 255))
        {
            throw new ID3Exception("Reverb feedback left to left value must be between 0 and 255 in RVRB frame.");
        }
        m_iReverbFeedbackLeftToLeft = iReverbFeedbackLeftToLeft;
        if ((iReverbFeedbackLeftToRight < 0) || (iReverbFeedbackLeftToRight > 255))
        {
            throw new ID3Exception("Reverb feedback left to right value must be between 0 and 255 in RVRB frame.");
        }
        m_iReverbFeedbackLeftToRight = iReverbFeedbackLeftToRight;
        if ((iReverbFeedbackRightToLeft < 0) || (iReverbFeedbackRightToLeft > 255))
        {
            throw new ID3Exception("Reverb feedback right to left value must be between 0 and 255 in RVRB frame.");
        }
        m_iReverbFeedbackRightToLeft = iReverbFeedbackRightToLeft;
        if ((iReverbFeedbackRightToRight < 0) || (iReverbFeedbackRightToRight > 255))
        {
            throw new ID3Exception("Reverb feedback right to right value must be between 0 and 255 in RVRB frame.");
        }
        m_iReverbFeedbackRightToRight = iReverbFeedbackRightToRight;
        if ((iPremixLeftToRight < 0) || (iPremixLeftToRight > 255))
        {
            throw new ID3Exception("Premix left to right value must be between 0 and 255 in RVRB frame.");
        }
        m_iPremixLeftToRight = iPremixLeftToRight;
        if ((iPremixRightToLeft < 0) || (iPremixRightToLeft > 255))
        {
            throw new ID3Exception("Premix right to left value must be between 0 and 255 in RVRB frame.");
        }
        m_iPremixRightToLeft = iPremixRightToLeft;
    
public RVRBID3V2Frame(InputStream oIS)

        try
        {
            ID3DataInputStream oFrameDataID3DIS = new ID3DataInputStream(oIS);
            
            // reverb left and right (16-bit unsigned)
            m_iReverbLeftMS = oFrameDataID3DIS.readBEUnsigned16();
            m_iReverbRightMS = oFrameDataID3DIS.readBEUnsigned16();
            
            // reverb and premix values (unsigned byte values)
            m_iReverbBouncesLeft = oFrameDataID3DIS.readUnsignedByte();
            m_iReverbBouncesRight = oFrameDataID3DIS.readUnsignedByte();
            m_iReverbFeedbackLeftToLeft = oFrameDataID3DIS.readUnsignedByte();
            m_iReverbFeedbackLeftToRight = oFrameDataID3DIS.readUnsignedByte();
            m_iReverbFeedbackRightToRight = oFrameDataID3DIS.readUnsignedByte();
            m_iReverbFeedbackRightToLeft = oFrameDataID3DIS.readUnsignedByte();
            m_iPremixLeftToRight = oFrameDataID3DIS.readUnsignedByte();
            m_iPremixRightToLeft = oFrameDataID3DIS.readUnsignedByte();
        }
        catch (Exception e)
        {
            throw new InvalidFrameID3Exception(e);
        }
    
Methods Summary
public voidaccept(ID3Visitor oID3Visitor)

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

        if ((oOther == null) || (!(oOther instanceof RVRBID3V2Frame)))
        {
            return false;
        }
        
        RVRBID3V2Frame oOtherRVRB = (RVRBID3V2Frame)oOther;
        
        return ((m_iReverbLeftMS == oOtherRVRB.m_iReverbLeftMS) &&
                (m_iReverbRightMS == oOtherRVRB.m_iReverbRightMS) &&
                (m_iReverbBouncesLeft == oOtherRVRB.m_iReverbBouncesLeft) &&
                (m_iReverbBouncesRight == oOtherRVRB.m_iReverbBouncesRight) &&
                (m_iReverbFeedbackLeftToLeft == oOtherRVRB.m_iReverbFeedbackLeftToLeft) &&
                (m_iReverbFeedbackLeftToRight == oOtherRVRB.m_iReverbFeedbackLeftToRight) &&
                (m_iReverbFeedbackRightToRight == oOtherRVRB.m_iReverbFeedbackRightToRight) &&
                (m_iReverbFeedbackRightToLeft == oOtherRVRB.m_iReverbFeedbackRightToLeft) &&
                (m_iPremixLeftToRight == oOtherRVRB.m_iPremixLeftToRight) &&
                (m_iPremixRightToLeft == oOtherRVRB.m_iPremixRightToLeft));
    
protected byte[]getFrameId()

        return "RVRB".getBytes();
    
public intgetPremixLeftToRight()

        return m_iPremixLeftToRight;
    
public intgetPremixRightToLeft()

        return m_iPremixRightToLeft;
    
public intgetReverbBouncesLeft()

        return m_iReverbBouncesLeft;
    
public intgetReverbBouncesRight()

        return m_iReverbBouncesRight;
    
public intgetReverbFeedbackLeftToLeft()

        return m_iReverbFeedbackLeftToLeft;
    
public intgetReverbFeedbackLeftToRight()

        return m_iReverbFeedbackLeftToRight;
    
public intgetReverbFeedbackRightToLeft()

        return m_iReverbFeedbackRightToLeft;
    
public intgetReverbFeedbackRightToRight()

        return m_iReverbFeedbackRightToRight;
    
public intgetReverbLeftMS()

        return m_iReverbLeftMS;
    
public intgetReverbRightMS()

        return m_iReverbRightMS;
    
public voidsetReverbDetails(int iReverbLeftMS, int iReverbRightMS, int iReverbBouncesLeft, int iReverbBouncesRight, int iReverbFeedbackLeftToLeft, int iReverbFeedbackLeftToRight, int iReverbFeedbackRightToRight, int iReverbFeedbackRightToLeft, int iPremixLeftToRight, int iPremixRightToLeft)
Set the reverb details for this track.

param
iReverbLeftMS the delay between bounces in milliseconds for the left channel (16-bit unsigned)
param
iReverbRightMS the delay between bounces in milliseconds for the right channel (16-bit unsigned)
param
iReverbBouncesLeft the number of bounces to make in the left channel (unsigned byte)
param
iReverbBouncesRight the number of bounces to make in the right channel (unsigned byte)
param
iReverbFeedbackLeftToLeft percentage of feedback from left to left (0-255)
param
iReverbFeedbackLeftToRight percentage of feedback from left to right (0-255)
param
iReverbFeedbackRightToRight percentage of feedback from right to right (0-255)
param
iReverbFeedbackRightToLeft percentage of feedback from right to left (0-255)
param
iPremixLeftToRight percentage of left channel mixed to right before reverb (0-255)
param
iPremixRightToLeft percentage of right channel mixed to left before reverb (0-255)
throws
ID3Exception if any value is out of its valid range

        if ((iReverbLeftMS < 0) || (iReverbLeftMS > 65535))
        {
            throw new ID3Exception("Reverb left milliseconds must be an unsigned 16-bit value in RVRB frame.");
        }
        m_iReverbLeftMS = iReverbLeftMS;
        if ((iReverbRightMS < 0) || (iReverbRightMS > 65535))
        {
            throw new ID3Exception("Reverb right milliseconds must be an unsigned 16-bit value in RVRB frame.");
        }
        m_iReverbRightMS = iReverbRightMS;
        if ((iReverbBouncesLeft < 0) || (iReverbBouncesLeft > 255))
        {
            throw new ID3Exception("Reverb bounces left value must be between 0 and 255 in RVRB frame.");
        }
        m_iReverbBouncesLeft = iReverbBouncesLeft;
        if ((iReverbBouncesRight < 0) || (iReverbBouncesRight > 255))
        {
            throw new ID3Exception("Reverb bounces right value must be between 0 and 255 in RVRB frame.");
        }
        m_iReverbBouncesRight = iReverbBouncesRight;
        if ((iReverbFeedbackLeftToLeft < 0) || (iReverbFeedbackLeftToLeft > 255))
        {
            throw new ID3Exception("Reverb feedback left to left value must be between 0 and 255 in RVRB frame.");
        }
        m_iReverbFeedbackLeftToLeft = iReverbFeedbackLeftToLeft;
        if ((iReverbFeedbackLeftToRight < 0) || (iReverbFeedbackLeftToRight > 255))
        {
            throw new ID3Exception("Reverb feedback left to right value must be between 0 and 255 in RVRB frame.");
        }
        m_iReverbFeedbackLeftToRight = iReverbFeedbackLeftToRight;
        if ((iReverbFeedbackRightToLeft < 0) || (iReverbFeedbackRightToLeft > 255))
        {
            throw new ID3Exception("Reverb feedback right to left value must be between 0 and 255 in RVRB frame.");
        }
        m_iReverbFeedbackRightToLeft = iReverbFeedbackRightToLeft;
        if ((iReverbFeedbackRightToRight < 0) || (iReverbFeedbackRightToRight > 255))
        {
            throw new ID3Exception("Reverb feedback right to right value must be between 0 and 255 in RVRB frame.");
        }
        m_iReverbFeedbackRightToRight = iReverbFeedbackRightToRight;
        if ((iPremixLeftToRight < 0) || (iPremixLeftToRight > 255))
        {
            throw new ID3Exception("Premix left to right value must be between 0 and 255 in RVRB frame.");
        }
        m_iPremixLeftToRight = iPremixLeftToRight;
        if ((iPremixRightToLeft < 0) || (iPremixRightToLeft > 255))
        {
            throw new ID3Exception("Premix right to left value must be between 0 and 255 in RVRB frame.");
        }
        m_iPremixRightToLeft = iPremixRightToLeft;
    
public java.lang.StringtoString()

        return "Reverb: Reverb Left (ms)=[" + m_iReverbLeftMS + "], Reverb Right (ms)=" + m_iReverbRightMS +
               "], Reverb Bounces Left=[" + m_iReverbBouncesLeft +
               "], Reverb Bounches right=[" + m_iReverbBouncesRight +
               "], Reverb Feedback Left To Left=[" + m_iReverbFeedbackLeftToLeft +
               "], Reverb Feedback Left To Right=[" + m_iReverbFeedbackLeftToRight +
               "], Reverb Feedback Right To Right=[" + m_iReverbFeedbackRightToRight +
               "], Reverb Feedback Right To Left=[" + m_iReverbFeedbackRightToLeft +
               "], Premix Left To Right=[" + m_iPremixLeftToRight +
               "], Premix Right To Left=[" + m_iPremixRightToLeft + "]";
    
protected voidwriteBody(ID3DataOutputStream oIDOS)

        oIDOS.writeBEUnsigned16(m_iReverbLeftMS);
        oIDOS.writeBEUnsigned16(m_iReverbRightMS);
        oIDOS.writeUnsignedByte(m_iReverbBouncesLeft);
        oIDOS.writeUnsignedByte(m_iReverbBouncesRight);
        oIDOS.writeUnsignedByte(m_iReverbFeedbackLeftToLeft);
        oIDOS.writeUnsignedByte(m_iReverbFeedbackLeftToRight);
        oIDOS.writeUnsignedByte(m_iReverbFeedbackRightToRight);
        oIDOS.writeUnsignedByte(m_iReverbFeedbackRightToLeft);
        oIDOS.writeUnsignedByte(m_iPremixLeftToRight);
        oIDOS.writeUnsignedByte(m_iPremixRightToLeft);