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

@@ -84,6 +84,8 @@
}
}else if(name.startsWith("branchstart") && inSong){
courses[courseName].branch = true
}else if(name.startsWith("lyric") && inSong){
courses[courseName].inlineLyrics = true
}
}else if(!inSong){
@@ -411,6 +413,18 @@
}
branchObj[branchName] = currentBranch
break
case "lyric":
if(!this.lyrics){
this.lyrics = []
}
if(this.lyrics.length !== 0){
this.lyrics[this.lyrics.length - 1].end = ms
}
this.lyrics.push({
start: ms,
text: value.trim()
})
break
}
}else{
@@ -545,6 +559,10 @@
this.scoreinit = autoscore.ScoreInit;
this.scorediff = autoscore.ScoreDiff;
}
if(this.lyrics){
var line = this.lyrics[this.lyrics.length - 1]
line.end = Math.max(ms, line.start) + 5000
}
return circles
}
}