Class MediaOptions
java.lang.Object
com.craftmend.openaudiomc.api.media.MediaOptions
- Direct Known Subclasses:
MediaOptions
This class is a model for media options, which are used to configure media objects.
Media options are used to configure the behavior of a media object, such as volume, looping, and fading.
These can be set on the Media object itself too, but this serves as an intermediate object to help apply serialized media options.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanIf this media will mute the speakers of the client.protected booleanIf this media will mute current regions while playing.protected intThe speed of the media, 100 by default, but can be used to speed up or slow down the media.protected intThe volume of the media, 0-100 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanintKeep expirationTimeout/keepTimeout is the amount of seconds that the openaudiomc plugin runtime should keep track of this media for.intFade time is the amount of milliseconds it takes to fade in or out.getId()The id of the media, this is used to identify the mediaintgetSpeed()The speed of the media, 100 by default, but can be used to speed up or slow down the media.intThe starting point of the media, in milliseconds.intThe volume of the media, 0-100inthashCode()booleanisLoop()If the media should repeat when it endsbooleanIf this media will mute the speakers of the client.booleanIf this media will mute current regions while playing.booleanisPickUp()If the media should attempt to pick up where its currently according to the time spent since the start instant.voidsetExpirationTimeout(int expirationTimeout) Keep expirationTimeout/keepTimeout is the amount of seconds that the openaudiomc plugin runtime should keep track of this media for.voidsetFadeTime(int fadeTime) Fade time is the amount of milliseconds it takes to fade in or out.voidThe id of the media, this is used to identify the mediavoidsetLoop(boolean loop) If the media should repeat when it endsvoidsetMuteRegions(boolean muteRegions) If this media will mute the speakers of the client.voidsetMuteSpeakers(boolean muteSpeakers) If this media will mute current regions while playing.voidsetPickUp(boolean pickUp) If the media should attempt to pick up where its currently according to the time spent since the start instant.voidsetSpeed(int speed) The speed of the media, 100 by default, but can be used to speed up or slow down the media.voidsetStartAtMillis(int startAtMillis) The starting point of the media, in milliseconds.voidsetVolume(int volume) The volume of the media, 0-100toString()validate()validation rules for the media options
-
Field Details
-
volume
protected int volumeThe volume of the media, 0-100 -
muteSpeakers
protected boolean muteSpeakersIf this media will mute current regions while playing. This is used to prevent overlapping media in regions. -
muteRegions
protected boolean muteRegionsIf this media will mute the speakers of the client. This is used to prevent overlapping media with speakers. -
speed
protected int speedThe speed of the media, 100 by default, but can be used to speed up or slow down the media. 100 = normal speed, 200 = double speed, 50 = half speed, etc.
-
-
Constructor Details
-
MediaOptions
public MediaOptions()
-
-
Method Details
-
validate
validation rules for the media options- Returns:
- a validation result
-
isLoop
public boolean isLoop()If the media should repeat when it ends -
getId
The id of the media, this is used to identify the media -
getExpirationTimeout
public int getExpirationTimeout()Keep expirationTimeout/keepTimeout is the amount of seconds that the openaudiomc plugin runtime should keep track of this media for. Used to retroactively play media if a client connected too late. optional, -1 by default to disable. -
isPickUp
public boolean isPickUp()If the media should attempt to pick up where its currently according to the time spent since the start instant. -
getFadeTime
public int getFadeTime()Fade time is the amount of milliseconds it takes to fade in or out. 0 by default, but can be used to create smooth transitions between multiple regions, or to create a fade in effect. -
getStartAtMillis
public int getStartAtMillis()The starting point of the media, in milliseconds. 0 by default, but can be used to skip intros or start at a certain point. -
getVolume
public int getVolume()The volume of the media, 0-100 -
isMuteSpeakers
public boolean isMuteSpeakers()If this media will mute current regions while playing. This is used to prevent overlapping media in regions. -
isMuteRegions
public boolean isMuteRegions()If this media will mute the speakers of the client. This is used to prevent overlapping media with speakers. -
getSpeed
public int getSpeed()The speed of the media, 100 by default, but can be used to speed up or slow down the media. 100 = normal speed, 200 = double speed, 50 = half speed, etc. -
setLoop
public void setLoop(boolean loop) If the media should repeat when it ends -
setId
The id of the media, this is used to identify the media -
setExpirationTimeout
public void setExpirationTimeout(int expirationTimeout) Keep expirationTimeout/keepTimeout is the amount of seconds that the openaudiomc plugin runtime should keep track of this media for. Used to retroactively play media if a client connected too late. optional, -1 by default to disable. -
setPickUp
public void setPickUp(boolean pickUp) If the media should attempt to pick up where its currently according to the time spent since the start instant. -
setFadeTime
public void setFadeTime(int fadeTime) Fade time is the amount of milliseconds it takes to fade in or out. 0 by default, but can be used to create smooth transitions between multiple regions, or to create a fade in effect. -
setStartAtMillis
public void setStartAtMillis(int startAtMillis) The starting point of the media, in milliseconds. 0 by default, but can be used to skip intros or start at a certain point. -
setVolume
public void setVolume(int volume) The volume of the media, 0-100 -
setMuteSpeakers
public void setMuteSpeakers(boolean muteSpeakers) If this media will mute current regions while playing. This is used to prevent overlapping media in regions. -
setMuteRegions
public void setMuteRegions(boolean muteRegions) If this media will mute the speakers of the client. This is used to prevent overlapping media with speakers. -
setSpeed
public void setSpeed(int speed) The speed of the media, 100 by default, but can be used to speed up or slow down the media. 100 = normal speed, 200 = double speed, 50 = half speed, etc. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-