com.huguesjohnson.tiamat.audio
Class MidiPlayer

java.lang.Object
  extended by com.huguesjohnson.tiamat.audio.AudioPlayer
      extended by com.huguesjohnson.tiamat.audio.MidiPlayer
All Implemented Interfaces:
java.util.EventListener, javax.sound.midi.MetaEventListener

public class MidiPlayer
extends AudioPlayer
implements javax.sound.midi.MetaEventListener

MidiPlayer - plays midi files

Author:
Hugues Johnson

Field Summary
 
Fields inherited from class com.huguesjohnson.tiamat.audio.AudioPlayer
INFINITE_LOOP, loop, trackIndex, trackList
 
Constructor Summary
MidiPlayer()
           
 
Method Summary
 void meta(javax.sound.midi.MetaMessage metaMessage)
          Trap meta events.
 void play(java.lang.String path)
          Play with no loop.
 void play(java.lang.String[] paths)
          Play with no loop.
 void play(java.lang.String[] paths, int loop)
          Play with looping, loops back to the first track after playing the last one.
 void play(java.lang.String path, int loop)
          Play with looping.
 void stop()
          Stops playback.
 
Methods inherited from class com.huguesjohnson.tiamat.audio.AudioPlayer
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MidiPlayer

public MidiPlayer()
Method Detail

play

public void play(java.lang.String path)
Description copied from class: AudioPlayer
Play with no loop.

Specified by:
play in class AudioPlayer
Parameters:
path - The path of the audio file to play.

play

public void play(java.lang.String path,
                 int loop)
Description copied from class: AudioPlayer
Play with looping.

Specified by:
play in class AudioPlayer
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 void play(java.lang.String[] paths)
Description copied from class: AudioPlayer
Play with no loop.

Specified by:
play in class AudioPlayer
Parameters:
paths - The paths of the audio files to play.

play

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

Specified by:
play in class AudioPlayer
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 void stop()
Description copied from class: AudioPlayer
Stops playback.

Specified by:
stop in class AudioPlayer

meta

public void meta(javax.sound.midi.MetaMessage metaMessage)
Trap meta events. Why isn't there a simple way to loop midi? Let me get this straight.. the only way to loop a midi is to:


Copyright © 2004-2006 Hugues Johnson