Compare commits
No commits in common. "6ba2af679ab5e4964f6926db1a72503248df48a2" and "cbc20effa7ed1470c498152374998c590fbf2d67" have entirely different histories.
6ba2af679a
...
cbc20effa7
1 changed files with 4 additions and 19 deletions
|
|
@ -64,8 +64,6 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
|||
val REGEX_NOTE_TODROP = Regex("([drmfsltz][ia]?|[―])([₄₃₂₁¹²³⁴',]*)<")
|
||||
val REGEX_NOTE_SPLIT = Regex("\\$\\{[Ss]:([^\\}]+)\\}([drmfsltDRFSTz][,']*)")
|
||||
val REGEX_DC_REFRAIN = Regex("""\$\{R=\}\$\{D:(.*?)\}""")
|
||||
val REGEX_D_BLOCK = Regex("""\$\{D=\}(.*?)\$\{D!\}""", RegexOption.DOT_MATCHES_ALL)
|
||||
val REGEX_OVERRIDE_TOKEN = Regex("""\$\{O:\d+\}""")
|
||||
val KEEP_MARKERS = listOf("\${L}", "\$T")
|
||||
}
|
||||
|
||||
|
|
@ -2174,13 +2172,13 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
|||
loadM(value)
|
||||
|
||||
"L" ->
|
||||
loadL(index, normalizeDBlocks(value))
|
||||
loadL(index, value)
|
||||
|
||||
"Y" ->
|
||||
loadY(index, normalizeDBlocks(value))
|
||||
loadY(index, value)
|
||||
|
||||
"E" ->
|
||||
loadE(index, normalizeDBlocks(value))
|
||||
loadE(index, value)
|
||||
|
||||
"U" ->
|
||||
loadU(value)
|
||||
|
|
@ -2815,7 +2813,6 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
|||
val isDS = Regex("\\$\\{D([^:]*):").find(item)
|
||||
if (isDS != null) {
|
||||
item = item.replace(REGEX_LYRICS_COMMENT, "$2")
|
||||
item = decodeNestedBraces(item) // restitue les ${O:n} imbriqués
|
||||
val signDS = isDS.groupValues[1]
|
||||
val item = when (smartLyricsType) {
|
||||
"E" -> smartELyrics(item.replace(" _", " "))
|
||||
|
|
@ -2830,8 +2827,7 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
|||
.addHyphens()
|
||||
.split(Regex("[_/]"))
|
||||
.forEachIndexed { i, xval ->
|
||||
// ${O:n} imbriqués sont retirés
|
||||
appendLyricsItem(stanzaNumber, i + pDS, REGEX_OVERRIDE_TOKEN.replace(xval, ""))
|
||||
appendLyricsItem(stanzaNumber, i + pDS, xval)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2908,17 +2904,6 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
|||
return REGEX_STRIP_DC.replace(lyrics, $$"\\${x:}")
|
||||
}
|
||||
|
||||
fun normalizeDBlocks(lyrics: String): String =
|
||||
REGEX_D_BLOCK.replace(lyrics) { m ->
|
||||
"\${D:${encodeNestedBraces(m.groupValues[1])}}"
|
||||
}
|
||||
|
||||
private fun encodeNestedBraces(inner: String): String =
|
||||
inner.replace("\${", "\uE000").replace('}', '\uE001')
|
||||
|
||||
private fun decodeNestedBraces(text: String): String =
|
||||
text.replace("\uE000", "\${").replace('\uE001', '}')
|
||||
|
||||
private fun defineRefrainFrom(tuoNumber: Int) {
|
||||
refrainBeginsAt = tuoNumber
|
||||
refrainEndsAt = 99999
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue