public interface AudioPlayer extends UserProfileSavable, UpdateEventListener, NotificationListener
| Type | Property and Description |
|---|---|
javafx.beans.property.DoubleProperty |
globalMusicVolume |
javafx.beans.property.DoubleProperty |
globalSoundVolume |
| Modifier and Type | Method and Description |
|---|---|
default double |
getGlobalMusicVolume() |
default double |
getGlobalSoundVolume() |
javafx.beans.property.DoubleProperty |
globalMusicVolumeProperty() |
javafx.beans.property.DoubleProperty |
globalSoundVolumeProperty() |
default void |
onNotificationEvent(NotificationEvent event)
Fired on notification event.
|
void |
pauseAllMusic()
Pauses all currently playing music.
|
void |
pauseMusic(Music music)
Pauses given music if it was previously started with
playSound(Sound). |
void |
playMusic(Music music)
Plays given music based on its properties.
|
default void |
playMusic(String assetName)
Convenience method to play the music given its filename.
|
void |
playSound(Sound sound)
Plays given sound based on its properties.
|
default void |
playSound(String assetName)
Convenience method to play the sound given its filename.
|
void |
resumeAllMusic()
Resumes all currently paused music.
|
void |
resumeMusic(Music music)
Resumes previously paused
pauseMusic(Music) music. |
default void |
setGlobalMusicVolume(double volume)
Set global music volume in the range [0..1],
where 0 = 0%, 1 = 100%.
|
default void |
setGlobalSoundVolume(double volume)
Set global sound volume in the range [0..1],
where 0 = 0%, 1 = 100%.
|
void |
stopAllMusic()
Stops all currently playing music.
|
void |
stopAllSounds()
Stops playing all sounds.
|
void |
stopMusic(Music music)
Stops currently playing music.
|
void |
stopSound(Sound sound)
Stops playing given sound.
|
load, saveonUpdateEventjavafx.beans.property.DoubleProperty globalMusicVolumeProperty
javafx.beans.property.DoubleProperty globalSoundVolumeProperty
default void onNotificationEvent(NotificationEvent event)
NotificationListeneronNotificationEvent in interface NotificationListenerevent - the notification eventjavafx.beans.property.DoubleProperty globalMusicVolumeProperty()
default double getGlobalMusicVolume()
default void setGlobalMusicVolume(double volume)
volume - music volumejavafx.beans.property.DoubleProperty globalSoundVolumeProperty()
default double getGlobalSoundVolume()
default void setGlobalSoundVolume(double volume)
volume - sound volumedefault void playSound(String assetName)
assetName - name of the sound filedefault void playMusic(String assetName)
assetName - name of the music filevoid playSound(Sound sound)
sound - sound to playvoid stopSound(Sound sound)
sound - sound to stopvoid stopAllSounds()
void playMusic(Music music)
resumeMusic(Music) instead.music - music to playIllegalArgumentException - if the music is already playing / pausedvoid pauseMusic(Music music)
playSound(Sound).
It can then be restarted by resumeMusic(Music).music - music to pausevoid resumeMusic(Music music)
pauseMusic(Music) music.music - music to resumevoid stopMusic(Music music)
resumeMusic(Music). The music object needs
to be started again by playMusic(Music).music - music to stopvoid pauseAllMusic()
resumeAllMusic().void resumeAllMusic()
void stopAllMusic()
resumeAllMusic(). Each music object will need
to be started by playMusic(Music).Copyright © 2017. All rights reserved.