Support importing lyrics

- Use inline "#LYRIC" lines in tja files
- "LYRICS:" in tja metadata can point to a vtt file, this overrides "#LYRIC"
This commit is contained in:
LoveEevee
2020-03-31 15:50:27 +03:00
parent b4dcd76f90
commit 51bd6cec63
6 changed files with 58 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
class Lyrics{
constructor(file, songOffset, div){
constructor(file, songOffset, div, parsed){
this.div = div
this.stroke = document.createElement("div")
this.stroke.classList.add("stroke")
@@ -12,7 +12,7 @@ class Lyrics{
this.songOffset = songOffset || 0
this.vttOffset = 0
this.rLinebreak = /\n|\r\n/
this.lines = this.parseFile(file)
this.lines = parsed ? file : this.parseFile(file)
this.length = this.lines.length
}
parseFile(file){