Class MediaOptions

java.lang.Object
com.craftmend.openaudiomc.api.media.MediaOptions
Direct Known Subclasses:
MediaOptions

public class MediaOptions extends Object
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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected 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.
    The id of the media, this is used to identify the media
    int
    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-100
    int
     
    boolean
    If the media should repeat when it ends
    boolean
    If this media will mute the speakers of the client.
    boolean
    If this media will mute current regions while playing.
    boolean
    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 media
    void
    setLoop(boolean loop)
    If the media should repeat when it ends
    void
    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-100
     
    validation rules for the media options

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MediaOptions

      public MediaOptions()
  • Method Details

    • validate

      public OptionalError validate()
      validation rules for the media options
      Returns:
      a validation result
    • isLoop

      public boolean isLoop()
      If the media should repeat when it ends
    • getId

      public String 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

      public void setId(String id)
      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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object