ddf.minim
Class MAudioFile

java.lang.Object
  extended byddf.minim.MAudioFile
All Implemented Interfaces:
LineWriterListener, Playable

public class MAudioFile
extends java.lang.Object
implements LineWriterListener, Playable


Field Summary
 boolean doEffects
           
 EffectsChain effects
           
 MAudioBuffer left
           
 MAudioBuffer mix
           
 MAudioBuffer right
           
 
Method Summary
 void cue(int millis)
          Sets the position of the file to millis milliseconds from the beginning.
 boolean isLooping()
          Returns true if this is currently playing and has more than one loop left to play.
 boolean isPlaying()
          Returns true if the AudioFile is currently playing.
 int length()
          Returns the length of the file in milliseconds.
 void loop()
          Sets the clip to loop continuously.
 void loop(int n)
          Sets the clip to loop n times.
 void pause()
          Pauses playback.
 void play()
          Starts playback from the current position.
 void play(int millis)
          Starts playback millis from the beginning.
 int position()
          Returns the current position of the "playhead" in the clip (ie how much of the clip has already been played)
 void rewind()
          Rewinds the clip to the beginning.
 void writeSamples(org.tritonus.share.sampled.FloatSampleBuffer fsb)
          Writes samples to fsb.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

effects

public EffectsChain effects

doEffects

public boolean doEffects

left

public final MAudioBuffer left

right

public final MAudioBuffer right

mix

public final MAudioBuffer mix
Method Detail

writeSamples

public void writeSamples(org.tritonus.share.sampled.FloatSampleBuffer fsb)
Description copied from interface: LineWriterListener
Writes samples to fsb.

Specified by:
writeSamples in interface LineWriterListener
Parameters:
fsb - the FloatSampleBuffer to write to

play

public void play()
Starts playback from the current position.

Specified by:
play in interface Playable

play

public void play(int millis)
Starts playback millis from the beginning.

Specified by:
play in interface Playable
Parameters:
millis -

isPlaying

public boolean isPlaying()
Returns true if the AudioFile is currently playing.

Specified by:
isPlaying in interface Playable
Returns:
a boolean indicating whether this file is currently playing

pause

public void pause()
Pauses playback.

Specified by:
pause in interface Playable

rewind

public void rewind()
Rewinds the clip to the beginning. This does not stop playback.

Specified by:
rewind in interface Playable

loop

public void loop()
Sets the clip to loop continuously. If it is already playing, this will not reset the position to the beginning. If it is not playing, this will cause the clip to start playing.

Specified by:
loop in interface Playable

loop

public void loop(int n)
Sets the clip to loop n times. If it is already playing, this will not reset the position to the beginning. If it is not playing, this will cause the clip to start playing.

Specified by:
loop in interface Playable
Parameters:
n - the number of times to loop

length

public int length()
Returns the length of the file in milliseconds.

Specified by:
length in interface Playable
Returns:
the length of the file in milliseconds

position

public int position()
Returns the current position of the "playhead" in the clip (ie how much of the clip has already been played)

Specified by:
position in interface Playable
Returns:
the current position of the "playhead" in the file

cue

public void cue(int millis)
Sets the position of the file to millis milliseconds from the beginning. This will not change the playstate of the file. If an error occurs while trying to cue the file, it will be reported and the file will be rewound.

Specified by:
cue in interface Playable
Parameters:
millis -

isLooping

public boolean isLooping()
Description copied from interface: Playable
Returns true if this is currently playing and has more than one loop left to play.

Specified by:
isLooping in interface Playable
Returns:
true if this is looping