Add "p" meta for bpm song metadata
This commit is contained in:
parent
057b8b0333
commit
8e75ed8ec0
1 changed files with 3 additions and 2 deletions
|
|
@ -219,6 +219,7 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
||||||
N.clear()
|
N.clear()
|
||||||
L.clear()
|
L.clear()
|
||||||
globalDComments.clear()
|
globalDComments.clear()
|
||||||
|
meta.clear()
|
||||||
if (pitches.isNotEmpty()) {
|
if (pitches.isNotEmpty()) {
|
||||||
pitches[0].reset()
|
pitches[0].reset()
|
||||||
}
|
}
|
||||||
|
|
@ -242,8 +243,6 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
||||||
parseOneLine(line)
|
parseOneLine(line)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val songBpm = meta["p"]?.toFloatOrNull() ?: 120f
|
|
||||||
sharedScreenModel.setBpmFlow(songBpm)
|
|
||||||
unparsedNote.forEach {
|
unparsedNote.forEach {
|
||||||
preloadN(it)
|
preloadN(it)
|
||||||
}
|
}
|
||||||
|
|
@ -307,6 +306,7 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
||||||
T.clear()
|
T.clear()
|
||||||
N.clear()
|
N.clear()
|
||||||
L.clear()
|
L.clear()
|
||||||
|
meta.clear()
|
||||||
globalDComments.clear()
|
globalDComments.clear()
|
||||||
if (pitches.isNotEmpty()) {
|
if (pitches.isNotEmpty()) {
|
||||||
pitches[0].reset()
|
pitches[0].reset()
|
||||||
|
|
@ -2049,6 +2049,7 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
||||||
sharedScreenModel.setSongAuthor(meta["a"] ?: "")
|
sharedScreenModel.setSongAuthor(meta["a"] ?: "")
|
||||||
sharedScreenModel.setSongComposer(meta["h"] ?: "")
|
sharedScreenModel.setSongComposer(meta["h"] ?: "")
|
||||||
sharedScreenModel.setSongRhythm(meta["r"] ?: "")
|
sharedScreenModel.setSongRhythm(meta["r"] ?: "")
|
||||||
|
sharedScreenModel.setBpmFlow(meta["p"]?.toFloat() ?: 120.0f)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun loadN(voiceNumber: Int, line: String, templateComments: MutableList<String>) {
|
private fun loadN(voiceNumber: Int, line: String, templateComments: MutableList<String>) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue