org.robokind.api.audio
Class WavBufferPlayer

java.lang.Object
  extended by org.robokind.api.common.playable.AbstractPlayable
      extended by org.robokind.api.audio.WavBufferPlayer
All Implemented Interfaces:
WavPlayer, Playable

public class WavBufferPlayer
extends AbstractPlayable
implements WavPlayer

Author:
Matthew Stevenson

Field Summary
static VersionProperty VERSION
          Controller type VersionProperty.
static String VERSION_NAME
          Controller type version name.
static String VERSION_NUMBER
          Controller type version number.
 
Fields inherited from class org.robokind.api.common.playable.AbstractPlayable
myElapsedPauseTime, myPauseTime, myPlayableListeners, myPlayState, myResumeTime, myStartTime, myStopTime
 
Fields inherited from interface org.robokind.api.audio.WavPlayer
PROP_WAV_PLAYER_ID
 
Constructor Summary
WavBufferPlayer(String playerId, WavBuffer wav)
           
WavBufferPlayer(String playerId, WavBuffer wav, long startMicrosec, long stopMicrosec, long startDelayMillisec)
           
 
Method Summary
 void addAudioProgressListener(AudioProgressListener listener)
           
 void addLineListener(LineListener listener)
           
 Long getElapsedPlayTime(long time)
           
 long getEndPositionFrame()
           
 double getEndPositionMicrosec()
           
 long getLengthFrames()
           
 double getLengthMicrosec()
           
 String getPlayerId()
           
 long getPositionFrame()
           
 double getPositionMicrosec()
           
 long getStartDelayFrames()
           
 long getStartDelayMillisec()
           
 long getStartPositionFrame()
           
 double getStartPositionMicrosec()
           
 WavBuffer getWavBuffer()
           
 String getWavPlayerId()
           
 void initAudioLine()
           
protected  boolean onComplete(long time)
           
protected  boolean onPause(long time)
           
protected  boolean onResume(long time)
           
protected  boolean onStart(long time)
           
protected  boolean onStop(long time)
           
 void removeAudioProgressListener(AudioProgressListener listener)
           
 void removeLineListener(LineListener listener)
           
 void setEndPositionFrame(long frame)
           
 void setEndPositionMicrosec(double usec)
           
 void setPositionFrame(long frame)
           
 void setPositionMicrosec(double usec)
           
 void setStartDelayFrames(long startDelayFrames)
           
 void setStartDelayMillisec(long startDelayMillisec)
           
 void setStartPositionFrame(long frame)
           
 void setStartPositionMicrosec(double usec)
           
 
Methods inherited from class org.robokind.api.common.playable.AbstractPlayable
addPlayableListener, afterComplete, complete, firePlayStateChanged, getElapsedPauseTime, getPauseTime, getPlayState, getResumeTime, getStartTime, getStopTime, pause, removePlayableListener, resume, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.robokind.api.common.playable.Playable
addPlayableListener, complete, getElapsedPauseTime, getPauseTime, getPlayState, getResumeTime, getStartTime, getStopTime, pause, removePlayableListener, resume, start, stop
 

Field Detail

VERSION_NAME

public static final String VERSION_NAME
Controller type version name.

See Also:
Constant Field Values

VERSION_NUMBER

public static final String VERSION_NUMBER
Controller type version number.

See Also:
Constant Field Values

VERSION

public static final VersionProperty VERSION
Controller type VersionProperty.

Constructor Detail

WavBufferPlayer

public WavBufferPlayer(String playerId,
                       WavBuffer wav)

WavBufferPlayer

public WavBufferPlayer(String playerId,
                       WavBuffer wav,
                       long startMicrosec,
                       long stopMicrosec,
                       long startDelayMillisec)
Method Detail

initAudioLine

public void initAudioLine()
                   throws Exception
Specified by:
initAudioLine in interface WavPlayer
Throws:
Exception

getWavBuffer

public WavBuffer getWavBuffer()
Specified by:
getWavBuffer in interface WavPlayer

getWavPlayerId

public String getWavPlayerId()
Specified by:
getWavPlayerId in interface WavPlayer

getPlayerId

public String getPlayerId()

setStartDelayMillisec

public void setStartDelayMillisec(long startDelayMillisec)
Specified by:
setStartDelayMillisec in interface WavPlayer

setStartDelayFrames

public void setStartDelayFrames(long startDelayFrames)
Specified by:
setStartDelayFrames in interface WavPlayer

getStartDelayFrames

public long getStartDelayFrames()
Specified by:
getStartDelayFrames in interface WavPlayer

getStartDelayMillisec

public long getStartDelayMillisec()
Specified by:
getStartDelayMillisec in interface WavPlayer

setPositionFrame

public void setPositionFrame(long frame)
Specified by:
setPositionFrame in interface WavPlayer

setPositionMicrosec

public void setPositionMicrosec(double usec)
Specified by:
setPositionMicrosec in interface WavPlayer

getPositionFrame

public long getPositionFrame()
Specified by:
getPositionFrame in interface WavPlayer

getPositionMicrosec

public double getPositionMicrosec()
Specified by:
getPositionMicrosec in interface WavPlayer

getElapsedPlayTime

public Long getElapsedPlayTime(long time)
Specified by:
getElapsedPlayTime in interface Playable
Overrides:
getElapsedPlayTime in class AbstractPlayable

onStart

protected boolean onStart(long time)
Specified by:
onStart in class AbstractPlayable

onPause

protected boolean onPause(long time)
Specified by:
onPause in class AbstractPlayable

onResume

protected boolean onResume(long time)
Specified by:
onResume in class AbstractPlayable

onStop

protected boolean onStop(long time)
Specified by:
onStop in class AbstractPlayable

onComplete

protected boolean onComplete(long time)
Specified by:
onComplete in class AbstractPlayable

addLineListener

public void addLineListener(LineListener listener)
Specified by:
addLineListener in interface WavPlayer

removeLineListener

public void removeLineListener(LineListener listener)
Specified by:
removeLineListener in interface WavPlayer

addAudioProgressListener

public void addAudioProgressListener(AudioProgressListener listener)
Specified by:
addAudioProgressListener in interface WavPlayer

removeAudioProgressListener

public void removeAudioProgressListener(AudioProgressListener listener)
Specified by:
removeAudioProgressListener in interface WavPlayer

setStartPositionFrame

public void setStartPositionFrame(long frame)
Specified by:
setStartPositionFrame in interface WavPlayer

setStartPositionMicrosec

public void setStartPositionMicrosec(double usec)
Specified by:
setStartPositionMicrosec in interface WavPlayer

getStartPositionFrame

public long getStartPositionFrame()
Specified by:
getStartPositionFrame in interface WavPlayer

getStartPositionMicrosec

public double getStartPositionMicrosec()
Specified by:
getStartPositionMicrosec in interface WavPlayer

setEndPositionFrame

public void setEndPositionFrame(long frame)
Specified by:
setEndPositionFrame in interface WavPlayer

setEndPositionMicrosec

public void setEndPositionMicrosec(double usec)
Specified by:
setEndPositionMicrosec in interface WavPlayer

getEndPositionFrame

public long getEndPositionFrame()
Specified by:
getEndPositionFrame in interface WavPlayer

getEndPositionMicrosec

public double getEndPositionMicrosec()
Specified by:
getEndPositionMicrosec in interface WavPlayer

getLengthFrames

public long getLengthFrames()
Specified by:
getLengthFrames in interface WavPlayer

getLengthMicrosec

public double getLengthMicrosec()
Specified by:
getLengthMicrosec in interface WavPlayer


Copyright © 2011-2013. All Rights Reserved.