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.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
int
Keep expirationTimeout/keepTimeout is the amount of seconds that the openaudiomc plugin runtime should keep track of this media for.int
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.getId()
The id of the media, this is used to identify the mediaint
The starting point of the media, in milliseconds. 0 by default, but can be used to skip intros or start at a certain point.int
The volume of the media, 0-100int
hashCode()
boolean
isLoop()
If the media should repeat when it endsboolean
If this media will mute the speakers of the client.boolean
If this media will mute current regions while playing.boolean
isPickUp()
If the media should attempt to pick up where its currently according to the time spent since the start instant.void
setExpirationTimeout
(int expirationTimeout) Keep expirationTimeout/keepTimeout is the amount of seconds that the openaudiomc plugin runtime should keep track of this media for.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.void
The id of the media, this is used to identify the mediavoid
setLoop
(boolean loop) If the media should repeat when it endsvoid
setMuteRegions
(boolean muteRegions) If this media will mute the speakers of the client.void
setMuteSpeakers
(boolean muteSpeakers) If this media will mute current regions while playing.void
setPickUp
(boolean pickUp) If the media should attempt to pick up where its currently according to the time spent since the start instant.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.void
setVolume
(int volume) The volume of the media, 0-100toString()
validate()
validation rules for the media options
-
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. -
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. -
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. -
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. -
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. -
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. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-