com.huguesjohnson.tiamat.audio
Class AudioPlayer

java.lang.Object
  extended by com.huguesjohnson.tiamat.audio.AudioPlayer
Direct Known Subclasses:
MidiPlayer

public abstract class AudioPlayer
extends java.lang.Object

AudioPlayer - abstract class for playing audio

Author:
Hugues Johnson

Field Summary
static int INFINITE_LOOP
           
protected  int loop
          The number of times to loop.
protected  int trackIndex
          The index of the track currently being played.
protected  java.lang.String[] trackList
          The list of tracks to play.
 
Constructor Summary
AudioPlayer()
           
 
Method Summary
abstract  void play(java.lang.String path)
          Play with no loop.
abstract  void play(java.lang.String[] paths)
          Play with no loop.
abstract  void play(java.lang.String[] paths, int loop)
          Play with looping, loops back to the first track after playing the last one.
abstract  void play(java.lang.String path, int loop)
          Play with looping.
abstract  void stop()
          Stops playback.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

loop

protected int loop
The number of times to loop.


trackList

protected java.lang.String[] trackList
The list of tracks to play.


trackIndex

protected int trackIndex
The index of the track currently being played.


INFINITE_LOOP

public static final int INFINITE_LOOP
See Also:
Constant Field Values
Constructor Detail

AudioPlayer

public AudioPlayer()
Method Detail

play

public abstract void play(java.lang.String path)
Play with no loop.

Parameters:
path - The path of the audio file to play.

play

public abstract void play(java.lang.String path,
                          int loop)
Play with looping.

Parameters:
path - The path of the audio file to play.
loop - The number of times to loop, if loop <0 the infinite loop.

play

public abstract void play(java.lang.String[] paths)
Play with no loop.

Parameters:
paths - The paths of the audio files to play.

play

public abstract void play(java.lang.String[] paths,
                          int loop)
Play with looping, loops back to the first track after playing the last one.

Parameters:
paths - The paths of the audio files to play.
loop - The number of times to loop, if loop <0 the infinite loop.

stop

public abstract void stop()
Stops playback.


toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of the object.


Copyright © 2004-2006 Hugues Johnson