GTGE API

com.golden.gamedev.engine.audio
Class MidiRenderer

java.lang.Object
  extended by com.golden.gamedev.engine.BaseAudioRenderer
      extended by com.golden.gamedev.engine.audio.MidiRenderer
All Implemented Interfaces:
EventListener, MetaEventListener

public class MidiRenderer
extends BaseAudioRenderer
implements MetaEventListener

Play midi sound (*.mid).

Note: Midi sound use soundbank that not delivered in JRE, only JDK can play midi sound properly.
In order to play midi sound properly in JRE you must explicitly install soundbank.
Download soundbank from java sun website ( http://java.sun.com/products/java-media/sound/soundbanks.html) and refer to the manual how to install it.


Field Summary
 
Fields inherited from class com.golden.gamedev.engine.BaseAudioRenderer
END_OF_SOUND, ERROR, PLAYING, status, STOPPED, volume
 
Constructor Summary
MidiRenderer()
          Creates new midi audio renderer.
 
Method Summary
 boolean isAvailable()
          Returns true, if this audio renderer is available to use or false if this renderer is not available to use (failed to initialized).
 boolean isVolumeSupported()
          Returns whether setting audio volume is supported or not.
 void meta(MetaMessage msg)
          Notified when the sound has finished playing.
protected  void playSound(URL audiofile)
          Plays sound with specified audio file.
protected  void replaySound(URL audiofile)
          Replays last played sound.
protected  void setSoundVolume(float volume)
          Sets audio sound volume.
protected  void stopSound()
          Stops any playing sound.
 
Methods inherited from class com.golden.gamedev.engine.BaseAudioRenderer
getAudioFile, getStatus, getVolume, isLoop, play, play, setLoop, setVolume, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MidiRenderer

public MidiRenderer()
Creates new midi audio renderer.

Method Detail

isAvailable

public boolean isAvailable()
Description copied from class: BaseAudioRenderer
Returns true, if this audio renderer is available to use or false if this renderer is not available to use (failed to initialized).

Specified by:
isAvailable in class BaseAudioRenderer

playSound

protected void playSound(URL audiofile)
Description copied from class: BaseAudioRenderer
Plays sound with specified audio file.

Specified by:
playSound in class BaseAudioRenderer

replaySound

protected void replaySound(URL audiofile)
Description copied from class: BaseAudioRenderer
Replays last played sound.

Specified by:
replaySound in class BaseAudioRenderer

stopSound

protected void stopSound()
Description copied from class: BaseAudioRenderer
Stops any playing sound.

Specified by:
stopSound in class BaseAudioRenderer

meta

public void meta(MetaMessage msg)
Notified when the sound has finished playing.

Specified by:
meta in interface MetaEventListener

setSoundVolume

protected void setSoundVolume(float volume)
Description copied from class: BaseAudioRenderer
Sets audio sound volume.

Overrides:
setSoundVolume in class BaseAudioRenderer

isVolumeSupported

public boolean isVolumeSupported()
Description copied from class: BaseAudioRenderer
Returns whether setting audio volume is supported or not.

Overrides:
isVolumeSupported in class BaseAudioRenderer

GTGE API

Copyright © 2003-2005 Golden T Studios. All rights reserved. Use is subject to license terms.
GoldenStudios.or.id