org.xith3d.loaders.sound.impl.midi
Class MidiSoundContainer

java.lang.Object
  extended by org.xith3d.loaders.sound.impl.midi.MidiSoundContainer
All Implemented Interfaces:
SingletonSoundContainer, SoundContainer

public class MidiSoundContainer
extends java.lang.Object
implements SingletonSoundContainer

SoundContainer implementation for Wave sounds.


Method Summary
protected  void finalize()
          
 SoundBuffer getData(SoundDriver driver)
          Gets a buffer to be played.
 long getDuration()
          
 boolean isStreaming()
          
 void returnData(SoundDriver driver, SoundBuffer buffer)
          Called by the sound system to indicate that it has finished playing the buffer.
 void rewind(SoundDriver driver)
          Generally only valid for streaming sound containers.
 void setEnabled(boolean enabled)
          
 void setPaused(boolean paused)
          
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setEnabled

public void setEnabled(boolean enabled)

Specified by:
setEnabled in interface SingletonSoundContainer

setPaused

public void setPaused(boolean paused)

Specified by:
setPaused in interface SingletonSoundContainer

getDuration

public long getDuration()

Specified by:
getDuration in interface SingletonSoundContainer

finalize

protected void finalize()

Overrides:
finalize in class java.lang.Object

isStreaming

public boolean isStreaming()

Specified by:
isStreaming in interface SoundContainer
Returns:
if there might be more than one sound buffer available.

getData

public SoundBuffer getData(SoundDriver driver)
Gets a buffer to be played.

Specified by:
getData in interface SoundContainer
Returns:
The buffer ready to be played. Null indicates there is no more data to be played.

returnData

public void returnData(SoundDriver driver,
                       SoundBuffer buffer)
Called by the sound system to indicate that it has finished playing the buffer. In a streaming implementation this is an opportunity to decode the next chunk into this released buffer.

Specified by:
returnData in interface SoundContainer

rewind

public void rewind(SoundDriver driver)
Generally only valid for streaming sound containers. Sets up for a call to the getData() method. The next call to getData() should return the first buffer in the sound source.

Specified by:
rewind in interface SoundContainer