/* $Id$
 *
 * Copyright (c) 1999 Xenonsoft Limited. All Rights Reserved.
 *
 * This software is protected by copyright. You are hereby notified from
 * now by reading this message. This software is also the confidential 
 * and proprietary information of Xenonsoft Limited.  ("Confidential
 * Information"). 
 *
 * This software is distributed under the Xenonsoft Public end user 
 * License ("XPeL"), where the machine-readable source code is provided 
 * under the "Open Source" model.
 * For more information, please read the file "LICENSE-XPL.txt" 
 */

// public int Wave.java

//
// Description:
//	Sound wave 
//	  
// Author:
//      Peter Pilgrim 
//	Wed May 26 12:52:02 BST 1999
//	  
// RCS HEADER 
// 
// $Author$
// $Date$
// $Source$
// $Revision$    $State$    $Locker$
//
// ================================================================================
// History
//	  $Log$
// 
// 
//

package xenon.soundkit;

import java.util.*;

public abstract class Wave
{
    /** default waveform length (this for a sine wave) */
    public final static int	DEFAULT_WAVELENGTH=720;

    /** The waveform length */
    protected int		WAVELENGTH;
    /** buffer for waveform data */
    protected double[]		wave;
    
    /** A default constructor for the wave */
    public Wave() 
    {
	WAVELENGTH = DEFAULT_WAVELENGTH;
    }
    
    /** generate the waveform */
    protected abstract void generateWaveform();
    

    /**
     * Gets the waveform amplitude at the Nth index of the waveform buffer 
     *
     * @param index the index in to the buffer
     */
    public double elementAt( int index )
    {
	return wave[index];
    }
    
    /** Returns the waveform buffer size */
    public int getLength()
    {
	return wave.length;
    }

    /** Returns displayable name */
    public abstract String getDisplayName();
    
}

// fini
