APIdia Launch Partner
Top Description Constructors Methods
com.badlogic.gdx.backends.headless.mock.audio

public Class MockMusic

extends Object
implements Music
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.audio.Music, com.badlogic.gdx.utils.Disposable
Imports
com.badlogic.gdx.audio.Music

The headless backend does its best to mock elements. This is intended to make code-sharing between server and client as simple as possible.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
dispose()

Implements com.badlogic.gdx.audio.Music.dispose.

Needs to be called when the Music is no longer needed.

public float
getPosition()

Implements com.badlogic.gdx.audio.Music.getPosition.

Returns the playback position in seconds.

public float
public boolean
public boolean
public void
pause()

Implements com.badlogic.gdx.audio.Music.pause.

Pauses the play back.

public void
play()

Implements com.badlogic.gdx.audio.Music.play.

Starts the play back of the music stream.

public void
setLooping(boolean isLooping)

Implements com.badlogic.gdx.audio.Music.setLooping.

Sets whether the music stream is looping.

public void
setOnCompletionListener(Music.OnCompletionListener listener)

Implements com.badlogic.gdx.audio.Music.setOnCompletionListener.

Register a callback to be invoked when the end of a music stream has been reached during playback.

public void
setPan(float pan, float volume)

Implements com.badlogic.gdx.audio.Music.setPan.

Sets the panning and volume of this music stream.

public void
setPosition(float position)

Implements com.badlogic.gdx.audio.Music.setPosition.

Set the playback position in seconds.

public void
setVolume(float volume)

Implements com.badlogic.gdx.audio.Music.setVolume.

Sets the volume of this music stream.

public void
stop()

Implements com.badlogic.gdx.audio.Music.stop.

Stops a playing or paused Music instance.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MockMusicback to summary
public MockMusic()

Method Detail

disposeback to summary
public void dispose()

Implements com.badlogic.gdx.audio.Music.dispose.

Doc from com.badlogic.gdx.audio.Music.dispose.

Needs to be called when the Music is no longer needed.

Annotations
@Override
getPositionback to summary
public float getPosition()

Implements com.badlogic.gdx.audio.Music.getPosition.

Doc from com.badlogic.gdx.audio.Music.getPosition.

Returns the playback position in seconds.

Annotations
@Override
getVolumeback to summary
public float getVolume()

Implements com.badlogic.gdx.audio.Music.getVolume.

Annotations
@Override
isLoopingback to summary
public boolean isLooping()

Implements com.badlogic.gdx.audio.Music.isLooping.

Annotations
@Override
isPlayingback to summary
public boolean isPlaying()

Implements com.badlogic.gdx.audio.Music.isPlaying.

Annotations
@Override
pauseback to summary
public void pause()

Implements com.badlogic.gdx.audio.Music.pause.

Doc from com.badlogic.gdx.audio.Music.pause.

Pauses the play back. If the music stream has not been started yet or has finished playing a call to this method will be ignored.

Annotations
@Override
playback to summary
public void play()

Implements com.badlogic.gdx.audio.Music.play.

Doc from com.badlogic.gdx.audio.Music.play.

Starts the play back of the music stream. In case the stream was paused this will resume the play back. In case the music stream is finished playing this will restart the play back.

Annotations
@Override
setLoopingback to summary
public void setLooping(boolean isLooping)

Implements com.badlogic.gdx.audio.Music.setLooping.

Doc from com.badlogic.gdx.audio.Music.setLooping.

Sets whether the music stream is looping. This can be called at any time, whether the stream is playing.

Annotations
@Override
setOnCompletionListenerback to summary
public void setOnCompletionListener(Music.OnCompletionListener listener)

Implements com.badlogic.gdx.audio.Music.setOnCompletionListener.

Doc from com.badlogic.gdx.audio.Music.setOnCompletionListener.

Register a callback to be invoked when the end of a music stream has been reached during playback.

Annotations
@Override
setPanback to summary
public void setPan(float pan, float volume)

Implements com.badlogic.gdx.audio.Music.setPan.

Doc from com.badlogic.gdx.audio.Music.setPan.

Sets the panning and volume of this music stream.

Annotations
@Override
setPositionback to summary
public void setPosition(float position)

Implements com.badlogic.gdx.audio.Music.setPosition.

Doc from com.badlogic.gdx.audio.Music.setPosition.

Set the playback position in seconds.

Annotations
@Override
setVolumeback to summary
public void setVolume(float volume)

Implements com.badlogic.gdx.audio.Music.setVolume.

Doc from com.badlogic.gdx.audio.Music.setVolume.

Sets the volume of this music stream. The volume must be given in the range [0,1] with 0 being silent and 1 being the maximum volume.

Annotations
@Override
stopback to summary
public void stop()

Implements com.badlogic.gdx.audio.Music.stop.

Doc from com.badlogic.gdx.audio.Music.stop.

Stops a playing or paused Music instance. Next time play() is invoked the Music will start from the beginning.

Annotations
@Override