JsAudioPlayer

eu.joaocosta.minart.backend.JsAudioPlayer
final class JsAudioPlayer() extends LowLevelAudioPlayer

Attributes

Graph
Supertypes
trait LowLevelAudioPlayer
trait Simple[Settings]
trait LowLevelSubsystem[Settings]
trait AutoCloseable
trait AudioPlayer
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def getChannelMix(channel: Int): AudioMix

Gets the mixing definitions for a channel.

Gets the mixing definitions for a channel.

Value parameters

channel

channel to check

Attributes

def isPlaying(): Boolean

Checks if this player still has data to be played.

Checks if this player still has data to be played.

Attributes

Returns

true of the player is still playing, false otherwise

def isPlaying(channel: Int): Boolean

Checks if a channel still has data to be played.

Checks if a channel still has data to be played.

Value parameters

channel

channel to check

Attributes

Returns

true of the channel is still playing, false otherwise

def play(clip: AudioClip, channel: Int): Unit

Enqueues an audio clip to be played later in a certain channel.

Enqueues an audio clip to be played later in a certain channel.

Value parameters

channel

channel where to play the audio clip

clip

audio clip to play

Attributes

def setChannelMix(mix: AudioMix, channel: Int): Unit

Sets the mixing definitions for a channel.

Sets the mixing definitions for a channel.

Value parameters

channel

channel to update

mix

the new mixing definitions

Attributes

def stop(): Unit

Stops playback and removes all enqueued waves.

Stops playback and removes all enqueued waves.

Attributes

def stop(channel: Int): Unit

Stops playback and removes all enqueued waves in a certain channel.

Stops playback and removes all enqueued waves in a certain channel.

Value parameters

channel

channel to stop

Attributes

protected def unsafeApplySettings(settings: Settings): Settings

Configures the subsystem according to the settings and returns the applied settings.

Configures the subsystem according to the settings and returns the applied settings.

This method assumes that the subsystem is initialized.

Attributes

protected def unsafeDestroy(): Unit

Unsafe implementation of the subsystem destroy.

Unsafe implementation of the subsystem destroy.

Attributes

protected def unsafeInit(): Unit

Unsafe implementation of the subsystem init.

Unsafe implementation of the subsystem init.

Attributes

Inherited methods

def changeSettings(newSettings: Settings): Unit

Changes the settings of the subsystem.

Changes the settings of the subsystem.

Value parameters

newSettings

new settings to apply

Attributes

Inherited from:
Simple
def close(): Unit

Destroys the subsystem.

Destroys the subsystem.

Calling any operation on this object after calling close() without calling init() has an undefined behavior.

Attributes

Inherited from:
Simple
def init(settings: Settings): Simple.this.type

Creates the subsystem.

Creates the subsystem.

Operations can only be called after calling this.

Value parameters

settings

settings used to configure the subsystem

Attributes

Returns

this subsystem

Inherited from:
Simple
def isCreated(): Boolean

Checks if the subsystem is created or if it has been destroyed.

Checks if the subsystem is created or if it has been destroyed.

Attributes

Inherited from:
Simple
final def play(wave: AudioWave, channel: Int): Unit

Enqueues an audio wave to be played later in a certain channel. The Audio Wave will play infinitely until stop() is called.

Enqueues an audio wave to be played later in a certain channel. The Audio Wave will play infinitely until stop() is called.

Value parameters

channel

channel where to play the audio wave

wave

audio wave to play

Attributes

Inherited from:
AudioPlayer
final def play(wave: AudioWave): Unit

Enqueues an audio wave to be played later in channel 0. The Audio Wave will play infinitely until stop() is called.

Enqueues an audio wave to be played later in channel 0. The Audio Wave will play infinitely until stop() is called.

Value parameters

wave

audio wave to play

Attributes

Inherited from:
AudioPlayer
final def play(clip: AudioClip): Unit

Enqueues an audio clip to be played later in channel 0.

Enqueues an audio clip to be played later in channel 0.

Value parameters

clip

audio clip to play

Attributes

Inherited from:
AudioPlayer
def settings: Settings

Returns the current settings.

Returns the current settings.

Attributes

Inherited from:
Simple
final def updateChannelMix(f: AudioMix => AudioMix, channel: Int): AudioMix

Updates the mixing definitions for a channel based on the current definitions.

Updates the mixing definitions for a channel based on the current definitions.

Value parameters

channel

channel to update

f

update function

Attributes

Returns

the new audio mix

Inherited from:
AudioPlayer

Inherited fields

protected var _settings: Settings

Attributes

Inherited from:
Simple