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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user