Class Lyrics
java.lang.Object
lol.trq.orpheus.lyrics.Lyrics
The lyrics of one track. Immutable; lookups allocate nothing and may run on any thread.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLyrics(Lyrics.Kind kind, List<LyricLine> lines, long offsetMillis, String source, double confidence) -
Method Summary
-
Field Details
-
NONE
-
-
Constructor Details
-
Lyrics
public Lyrics(Lyrics.Kind kind, List<LyricLine> lines, long offsetMillis, String source, double confidence) - Parameters:
kind- how the lines are timedlines- the lines, ordered by start time for synced kindsoffsetMillis- a correction: positive values show every line earliersource- where the lyrics came from, for displayconfidence- how sure the match to the track is, 0 to 1
-
-
Method Details
-
kind
-
synced
public boolean synced() -
size
public int size() -
line
-
lines
-
offsetMillis
public long offsetMillis() -
source
-
confidence
public double confidence() -
withOffset
-
withMatch
-
lineAt
public int lineAt(long positionMillis) The line being sung at a position.- Returns:
- the index of the last line that has started, or -1 before the first line and for unsynced lyrics
-
wordAt
public int wordAt(int lineIndex, long positionMillis) The word being sung inside a line.- Returns:
- the index into
line(lineIndex).words(), or -1 before the first word or when the line has none
-