net.beadsproject.beads.data
Class Sample.Regime

java.lang.Object
  extended by net.beadsproject.beads.data.Sample.Regime
Direct Known Subclasses:
Sample.TimedRegime, Sample.TotalRegime
Enclosing class:
Sample

public static class Sample.Regime
extends java.lang.Object


Field Summary
 boolean storeInNativeBitDepth
          Store the sample data in the native bit format.
 
Method Summary
static Sample.TimedRegime newStreamingRegime(long regionSize)
          Stream the file from disk -- storing the data in the sample.
static Sample.TimedRegime newStreamingRegimeWithAging(long regionSize, long memory)
          Like newStreamingRegime(long) but each buffered segment is discarded after a specified amount of time.
static Sample.TotalRegime newTotalRegime()
          Loads the entire file at initialisation.
static Sample.TotalRegime newTotalRegimeNative()
          Loads the entire file and keeps it in its native bit depth.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

storeInNativeBitDepth

public boolean storeInNativeBitDepth
Store the sample data in the native bit format. If true then memory is conserved, but a conversion has to be done every time sample data is requested. If false (the default) then the sample is stored in the internal format used by Beads. It uses more memory but is faster.

Method Detail

newTotalRegime

public static Sample.TotalRegime newTotalRegime()
Loads the entire file at initialisation. This is the default regime.


newTotalRegimeNative

public static Sample.TotalRegime newTotalRegimeNative()
Loads the entire file and keeps it in its native bit depth.


newStreamingRegime

public static Sample.TimedRegime newStreamingRegime(long regionSize)
Stream the file from disk -- storing the data in the sample. Useful for a forward sample player that possibly skips to different parts of the file. Once data is buffered it remains around forever.

Parameters:
regionSize - Buffer size in ms. Generally should be a small fraction of the entire file.

newStreamingRegimeWithAging

public static Sample.TimedRegime newStreamingRegimeWithAging(long regionSize,
                                                             long memory)
Like newStreamingRegime(long) but each buffered segment is discarded after a specified amount of time. This is useful if the sample is very large to conserve memory.

Parameters:
regionSize - Buffer size in ms. Generally should be a small fraction of the entire file.
memory - Amount of time (ms) that an untouched region is allowed to live for.