com.badlogic.gdx.backends.openal
Class OpenALMusic

java.lang.Object
  extended by com.badlogic.gdx.backends.openal.OpenALMusic
All Implemented Interfaces:
Music, Disposable
Direct Known Subclasses:
Mp3.Music, Ogg.Music, Wav.Music

public abstract class OpenALMusic
extends Object
implements Music

Author:
Nathan Sweet

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.badlogic.gdx.audio.Music
Music.OnCompletionListener
 
Constructor Summary
OpenALMusic(OpenALAudio audio, FileHandle file)
           
 
Method Summary
 void dispose()
           
 int getChannels()
           
 float getPosition()
           
 int getRate()
           
 int getSourceId()
           
 float getVolume()
           
 boolean isLooping()
           
 boolean isPlaying()
           
 void pause()
           
 void play()
           
abstract  int read(byte[] buffer)
          Fills as much of the buffer as possible and returns the number of bytes filled.
abstract  void reset()
          Resets the stream to the beginning.
 void setLooping(boolean isLooping)
           
 void setOnCompletionListener(Music.OnCompletionListener listener)
           
 void setPan(float pan, float volume)
           
 void setVolume(float volume)
           
 void stop()
           
 void update()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenALMusic

public OpenALMusic(OpenALAudio audio,
                   FileHandle file)
Method Detail

play

public void play()
Specified by:
play in interface Music

stop

public void stop()
Specified by:
stop in interface Music

pause

public void pause()
Specified by:
pause in interface Music

isPlaying

public boolean isPlaying()
Specified by:
isPlaying in interface Music

setLooping

public void setLooping(boolean isLooping)
Specified by:
setLooping in interface Music

isLooping

public boolean isLooping()
Specified by:
isLooping in interface Music

setVolume

public void setVolume(float volume)
Specified by:
setVolume in interface Music

getVolume

public float getVolume()
Specified by:
getVolume in interface Music

setPan

public void setPan(float pan,
                   float volume)
Specified by:
setPan in interface Music

getPosition

public float getPosition()
Specified by:
getPosition in interface Music

read

public abstract int read(byte[] buffer)
Fills as much of the buffer as possible and returns the number of bytes filled. Returns <= 0 to indicate the end of the stream.


reset

public abstract void reset()
Resets the stream to the beginning.


getChannels

public int getChannels()

getRate

public int getRate()

update

public void update()

dispose

public void dispose()
Specified by:
dispose in interface Music
Specified by:
dispose in interface Disposable

setOnCompletionListener

public void setOnCompletionListener(Music.OnCompletionListener listener)
Specified by:
setOnCompletionListener in interface Music

getSourceId

public int getSourceId()


Copyright © 2013. All Rights Reserved.