Class SongSettings
java.lang.Object
de.pottgames.tuningfork.jukebox.song.SongSettings
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SongSettingsNo fade-in and no fade-out, general volume of 1.static final SongSettingsFade-in and fade-out of 1 second, linear interpolation, general volume of 1.static final com.badlogic.gdx.math.InterpolationDoes not interpolate and ignores the alpha value, always applies 1. -
Constructor Summary
ConstructorsConstructorDescriptionSongSettings(float volume, float fadeInDuration, com.badlogic.gdx.math.Interpolation fadeInCurve, float fadeOutDuration, com.badlogic.gdx.math.Interpolation fadeOutCurve) Creates a SongSettings instance with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionbooleanfloatfadeVolume(SongSettings.FadeType type, float alpha) Returns the fade volume for a given fade type and alpha value.com.badlogic.gdx.math.InterpolationReturns the fade-in curve.floatReturns the fade-in duration in seconds.com.badlogic.gdx.math.InterpolationReturns the fade-out curve.floatReturns the fade-out duration in seconds.floatReturns the standard volume.inthashCode()static SongSettingslinear(float volume, float fadeInDuration, float fadeOutDuration) Creates a SongSettings instance with linear fade-in and fade-out interpolation.static SongSettingsnoFade(float volume) Creates a SongSettings instance that has fade-in and fade-out turned off.toString()
-
Field Details
-
NO_INTERPOLATION
public static final com.badlogic.gdx.math.Interpolation NO_INTERPOLATIONDoes not interpolate and ignores the alpha value, always applies 1. -
DEFAULT
No fade-in and no fade-out, general volume of 1. -
DEFAULT_LINEAR
Fade-in and fade-out of 1 second, linear interpolation, general volume of 1.
-
-
Constructor Details
-
SongSettings
public SongSettings(float volume, float fadeInDuration, com.badlogic.gdx.math.Interpolation fadeInCurve, float fadeOutDuration, com.badlogic.gdx.math.Interpolation fadeOutCurve) Creates a SongSettings instance with the given parameters.- Parameters:
volume- the volume, ranging from 0 - 1. Will be clamped if it exceeds the range.fadeInDuration- fade-in duration in secondsfadeInCurve- fade-in curvefadeOutDuration- fade-out duration in secondsfadeOutCurve- fade-out curve
-
-
Method Details
-
noFade
Creates a SongSettings instance that has fade-in and fade-out turned off.- Parameters:
volume- the volume this song will be played with, ranging from 0 - 1- Returns:
- the settings
-
linear
Creates a SongSettings instance with linear fade-in and fade-out interpolation.- Parameters:
volume- the volume this song will be played with, ranging from 0 - 1fadeInDuration- fade-in duration in secondsfadeOutDuration- fade-out duration in seconds- Returns:
- the settings
-
fadeVolume
Returns the fade volume for a given fade type and alpha value.- Parameters:
type- the fade typealpha- the alpha value- Returns:
- the fade volume
-
getFadeInDuration
public float getFadeInDuration()Returns the fade-in duration in seconds.- Returns:
- fade-in duration in seconds
-
getFadeOutDuration
public float getFadeOutDuration()Returns the fade-out duration in seconds.- Returns:
- fade-out duration in seconds
-
getFadeInCurve
public com.badlogic.gdx.math.Interpolation getFadeInCurve()Returns the fade-in curve.- Returns:
- fade-in curve
-
getFadeOutCurve
public com.badlogic.gdx.math.Interpolation getFadeOutCurve()Returns the fade-out curve.- Returns:
- fade-out curve
-
getVolume
public float getVolume()Returns the standard volume.- Returns:
- volume, ranging from 0-1
-
hashCode
-
equals
-
toString
-