Class Player
java.lang.Object
com.jackmeng.halcyoninae.halcyon.runtime.Player
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
float
convertVolume
(float zeroToHundred) getControl
(String key) boolean
boolean
void
play()
Starts playing the audiovoid
void
void
Resets the audio to a different track.void
setLooping
(boolean b) void
setShuffling
(boolean b) void
setVolume
(float percent) toString()
-
Field Details
-
audio
-
currentAbsolutePath
-
-
Constructor Details
-
Player
public Player()Constructs a player with a blank mp3 file -
Player
Constructs a player with a file locationNote: 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
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
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
- Returns:
- String
-
getStream
- Returns:
- TailwindPlayer
-
absolutePlay
public void absolutePlay() -
getStringedTime
- Returns:
- String
-
getControl
- Parameters:
key
-- Returns:
- Control
-
convertVolume
public float convertVolume(float zeroToHundred) - Parameters:
zeroToHundred
-- Returns:
- float
-
toString
-