java.lang.Object
com.jackmeng.halcyoninae.halcyon.runtime.Player

public class Player extends Object
This simplification is due to some of the methods not being to be needed and to have much more control over the playback library and to make it a global scope player instead of having to reinit everything on something new.

这种简化是由于不需要某些方法,并且至 对播放库有更多的控制权并使其成为全局 范围播放器,而不必在新事物上重新启动所有内容。

Since:
3.0
Author:
Jack Meng
  • Field Details

  • Constructor Details

    • Player

      public Player()
      Constructs a player with a blank mp3 file
    • Player

      public Player(String file)
      Constructs a player with a file location

      Note: This constructor does assert for the file path leading to the file to be having access to the file or the file existing at all.

      Parameters:
      file - The absolute file path leading to the audio track
    • Player

      public Player(File f)
      Constructs a player with a file object
      Parameters:
      f - The file object
  • Method Details

    • play

      public void play()
      Starts playing the audio
    • setVolume

      public void setVolume(float percent)
      Parameters:
      percent -
    • isLooping

      public boolean isLooping()
      Returns:
      boolean
    • setLooping

      public void setLooping(boolean b)
      Parameters:
      b -
    • requestNextTrack

      public void requestNextTrack()
    • requestPreviousTrack

      public void requestPreviousTrack()
    • isShuffling

      public boolean isShuffling()
      Returns:
      boolean
    • setShuffling

      public void setShuffling(boolean b)
      Parameters:
      b -
    • setFile

      public void setFile(String f)
      Resets the audio to a different track.

      This method will create the new track in a threaded manner in order prevent any other processes from being blocked.

      Parameters:
      f - The new file location (absolute path)
    • getCurrentFile

      public String getCurrentFile()
      Returns:
      String
    • getStream

      public Tailwind getStream()
      Returns:
      TailwindPlayer
    • absolutePlay

      public void absolutePlay()
    • getStringedTime

      public String getStringedTime()
      Returns:
      String
    • getControl

      public Control getControl(String key)
      Parameters:
      key -
      Returns:
      Control
    • convertVolume

      public float convertVolume(float zeroToHundred)
      Parameters:
      zeroToHundred -
      Returns:
      float
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      String