com.vwp.sound.mod.modplay.module
Class Sample

java.lang.Object
  extended by com.vwp.sound.mod.modplay.module.Sample

public class Sample
extends java.lang.Object

A sample. Should be generic enough to support all module formats


Field Summary
static int FORWARD
          forward loop
static int NO_LOOP
          no loop
static int PING_PONG
          ping-pong loop
 
Constructor Summary
Sample(java.lang.String id, java.lang.String name, double volume, double panning, int length, int loopType, int loopStart, int loopLength, double relativeNote, double fineTune, ModuleUnits units)
           
 
Method Summary
 short[] getData()
           
 double getFineTune()
           
 java.lang.String getId()
           
 java.lang.String getInfo()
           
 int getLength()
           
 int getLoopLength()
           
 int getLoopStart()
           
 int getLoopType()
           
 java.lang.String getName()
           
 double getPanning()
           
 double getRelativeNote()
           
 ModuleUnits getUnits()
           
 double getVolume()
           
 void setData(short[] data)
          Sets the sample data.
 void setUnits(ModuleUnits units)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_LOOP

public static final int NO_LOOP
no loop

See Also:
Constant Field Values

FORWARD

public static final int FORWARD
forward loop

See Also:
Constant Field Values

PING_PONG

public static final int PING_PONG
ping-pong loop

See Also:
Constant Field Values
Constructor Detail

Sample

public Sample(java.lang.String id,
              java.lang.String name,
              double volume,
              double panning,
              int length,
              int loopType,
              int loopStart,
              int loopLength,
              double relativeNote,
              double fineTune,
              ModuleUnits units)
Parameters:
id - id of volume. must be unique
name - name of sample
volume - volume of sample
panning - panning of sample (0 = far left, 0.5 = middle, 1 = far right) (ignored if Module.panningType != Module.SAMPLE_PANNING)
length - length of the sample data
loopType - type of loop
loopStart - start offset of loop
loopLength - length of loop
relativeNote - add relativeNote notes to the rate when playing this sample (can be negative)
fineTune - same function as relativeNote
Method Detail

getInfo

public java.lang.String getInfo()
Returns:
human readable info about this sample

setData

public void setData(short[] data)
Sets the sample data. The sample data is often not available when the Sample object is constructed. Use this method to set it later


getData

public short[] getData()
Returns:
the sample data

getId

public java.lang.String getId()
Returns:
the unique id of the sample

getName

public java.lang.String getName()
Returns:
the name of the sample

getVolume

public double getVolume()
Returns:
the volume of the sample

getPanning

public double getPanning()
Returns:
the panning of the sample

getLength

public int getLength()
Returns:
the length of the sample

getLoopType

public int getLoopType()
Returns:
the loop type of the sample

getLoopStart

public int getLoopStart()
Returns:
the start position of the loop

getLoopLength

public int getLoopLength()
Returns:
the length of the samples loop

getRelativeNote

public double getRelativeNote()
Returns:
the relative note of the sample

getFineTune

public double getFineTune()
Returns:
the fine tune of the sample

setUnits

public void setUnits(ModuleUnits units)

getUnits

public ModuleUnits getUnits()