java.lang.Object
uk.co.caprica.vlcj.player.base.Logo

public final class Logo extends Object
Builder for a Logo.

Use like this, with a static import of logo():

   logo()
     .opacity(200)
     .location(100, 100)
     .file("logo.png")
     .enable()
     .apply(mediaPlayer)
   ;
 
  • Method Details

    • logo

      public static Logo logo()
      Create a logo.
      Returns:
      logo
    • duration

      public Logo duration(int duration)
      Set the amount of time the logo will be displayed before displaying the next in sequence (if there is one).
      Parameters:
      duration - duration, milliseconds
      Returns:
      this
    • opacity

      public Logo opacity(int opacity)
      Apply a logo opacity.
      Parameters:
      opacity - opacity, from 0 to 255, where 255 is fully opaque
      Returns:
      this
    • opacity

      public Logo opacity(float opacity)
      Apply a logo opacity.
      Parameters:
      opacity - opacity, from 0.0 to 1.0, where 1.0 is fully opaque
      Returns:
      this
    • location

      public Logo location(int x, int y)
      Apply the logo position in video co-ordinates.
      Parameters:
      x - x ordinate
      y - y ordinate
      Returns:
      this
    • position

      public Logo position(LogoPosition position)
      Apply the logo position.
      Parameters:
      position - position enumeration value
      Returns:
      this
    • repeat

      public Logo repeat(int repeat)
      Set the number of times the logo sequence will repeat.

      Note that with current versions of VLC you may need to set a repeat count one more than you might expect - this is because on the last loop iteration it appears to stop after only the first logo has been displayed.

      Parameters:
      repeat - number of times to repeat the sequence of logos, or -1 for indefinite, or 0 for no looping.
      Returns:
      this
    • file

      public Logo file(String file)
      Apply the logo file.

      It is possible to simply specify the name of the file, or the extended syntax supported by libvlc - e.g. "file,d,t;file,d,t;...", see file(String, Integer, Integer).

      Parameters:
      file - name of the file
      Returns:
      this
    • file

      public Logo file(String file, Integer duration, Integer opacity)
    • file

      public Logo file(File file)
      Apply the logo file.
      Parameters:
      file - logo file
      Returns:
      this
    • file

      public Logo file(File file, Integer duration, Integer opacity)
    • image

      public Logo image(RenderedImage image)
      Apply the logo image.

      This is not optimal as the image must first be written to disk in a temporary file.

      Parameters:
      image - logo image
      Returns:
      this
    • enable

      public Logo enable(boolean enable)
      Apply the initial enabled/disabled state.
      Parameters:
      enable - true to enable the logo; false to disable it
      Returns:
      this
    • enable

      public Logo enable()
      Enable the logo.
      Returns:
      this
    • disable

      public Logo disable()
      Disable the logo.
      Returns:
      this
    • getDuration

      public Integer getDuration()
      Get the duration for the logo.
      Returns:
      duration
    • getIntegerOpacity

      public Integer getIntegerOpacity()
      Get the opacity if set as integer.
      Returns:
      opacity
    • getFloatOpacity

      public Float getFloatOpacity()
      Get the opacity if set as float.
      Returns:
      opacity
    • getX

      public Integer getX()
      Get the location x co-ordinate.
      Returns:
      location x
    • getY

      public Integer getY()
      Get the location y co-ordinate.
      Returns:
      location y
    • getPosition

      public LogoPosition getPosition()
      Get the position.
      Returns:
      position
    • getFile

      public String getFile()
      Get the file name.
      Returns:
      file name
    • getImage

      public RenderedImage getImage()
      Get the image.
      Returns:
      image
    • getEnable

      public boolean getEnable()
      Get the enabled flag.
      Returns:
      enabled/disabled
    • apply

      public void apply(MediaPlayer mediaPlayer)
      Apply the logo to the media player.

      All previously applied properties will be set on the media player.

      Parameters:
      mediaPlayer - media player
    • toString

      public String toString()
      Overrides:
      toString in class Object