Correction ${D: et ${DS: + Bug I0:
This commit is contained in:
parent
937837125c
commit
997f5e87b4
3 changed files with 15 additions and 17 deletions
|
|
@ -1,4 +1,4 @@
|
|||
M0:|c:D|m:4/4|r:8.8 L.M.|t:EWS 1 - From all that dwell below the sky|n:15|l:10|a:John Warrington Hatton (1793: 1710-1793)|h:Isaac Watts (1719)|x:https://hymnary.org/tune/duke_street_hatton
|
||||
M0:|c:D|m:4/4|r:8.8 L.M.|t:EWS 1 - From all that dwell below the sky|n:15|l:10|a:John Warrington Hatton (1793: 1710-1793)|h:Isaac Watts (1719)|u:https://hymnary.org/tune/duke_street_hatton
|
||||
T0:{|D:-!M:F|S:-!(L:T)|D:-!(T:L)|S:-!-:-/S:-!S:S|L:-!(S:S)|(F:T)!M:-|R:-!-:-/M:-!M:R|(D:M)!(S:D)|(L:R)!(F:M)|R:-!-:-/S:-!L:T|(D:-.F!S):D|D:-!T:-|D:-!-:-}
|
||||
N1:dmfsltd'tls/sssls-f-mr/mmrdmsd'lsfmr/sltd'--fmrd
|
||||
N2:ddt,ddfmrdt,/d5s,l,t,dt,/ddt,s,dd-d-t,dt,/ddrmrdrdt,d
|
||||
|
|
|
|||
|
|
@ -167,17 +167,9 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
|||
stateSettings.saveLastUsedDir(path)
|
||||
|
||||
try {
|
||||
val fileName = path.substringAfterLast(File.separatorChar)
|
||||
|
||||
val content = fileRepository.readFileContent(path)
|
||||
|
||||
fileRepository.saveLocalFile(fileName, content.encodeToByteArray())
|
||||
sharedScreenModel.loadItems()
|
||||
parse("${fileRepository.getAppPublicFolder()}/$fileName")
|
||||
|
||||
println("Fichier copié avec succès vers : Documents/Feufaro")
|
||||
parse(path)
|
||||
} catch (e: Exception) {
|
||||
println("Erreur lors de la copie du fichier : ${e.message}")
|
||||
println("Erreur lors de l'ouverture du fichier : ${e.message}")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -755,8 +747,12 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
|||
val overrideIterator: MutableMap<Int, Iterator<String>> = mutableMapOf()
|
||||
try {
|
||||
val lyrics = getLyricsComments(lyrics)
|
||||
val positionDS = ArrayDeque<Int>()
|
||||
val arrayLyrics = lyrics.split(Regex("[/_]"))
|
||||
arrayLyrics.forEachIndexed { i, lyricsItem ->
|
||||
if (lyricsItem.contains($$"${x:}")) {
|
||||
positionDS.add(i)
|
||||
}
|
||||
val originalLyrics = REGEX_STRIP_DC.replace(lyricsItem, "")
|
||||
val REGEX_OVERRIDE = Regex(".*\\$\\{O:(\\d+)\\}.*")
|
||||
if (REGEX_OVERRIDE.matches(lyricsItem)) {
|
||||
|
|
@ -807,24 +803,26 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
|||
val lyricsIterator = lyricsComment.iterator()
|
||||
while (lyricsIterator.hasNext()) {
|
||||
var item = lyricsIterator.next()
|
||||
var positionDS = 0
|
||||
// @todo: if item == ${O:...}
|
||||
// ${D:xxx} lyrics of DC and DSs
|
||||
val isDS = Regex("^\\$\\{D([^:]*):").find(item)
|
||||
val isDS = Regex("\\$\\{D([^:]*):").find(item)
|
||||
if (isDS != null) {
|
||||
item = item.replace(REGEX_LYRICS_COMMENT, "$2")
|
||||
val signDS = isDS.groupValues[1]
|
||||
//todo: calculate positionDS
|
||||
val item = when (smartLyricsType) {
|
||||
"E" -> smartELyrics(item.replace(" _", " "))
|
||||
"Y" -> smartYLyrics(item)
|
||||
else -> item
|
||||
}
|
||||
var pDS = positionDS.removeFirstOrNull() ?: 0
|
||||
if (signDS != "S") {
|
||||
pDS = 0
|
||||
}
|
||||
item
|
||||
.addHyphens()
|
||||
.split(Regex("[_/]"))
|
||||
.forEachIndexed { i, xval ->
|
||||
appendLyricsItem(stanzaNumber, i + positionDS, xval)
|
||||
appendLyricsItem(stanzaNumber, i + pDS, xval)
|
||||
}
|
||||
lyricsIterator.remove()
|
||||
}
|
||||
|
|
@ -892,7 +890,7 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
|||
if (matchResult.isNotEmpty()) {
|
||||
lyricsComment.addAll(matchResult)
|
||||
}
|
||||
return REGEX_STRIP_DC.replace(lyrics, "")
|
||||
return REGEX_STRIP_DC.replace(lyrics, $$"\\${x:}")
|
||||
}
|
||||
|
||||
private fun defineRefrainFrom(tuoNumber: Int) {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ kotlin = "2.2.0"
|
|||
kotlinx-coroutines = "1.10.2"
|
||||
#20250704
|
||||
koin = "4.0.4"
|
||||
core = "0.91.1"
|
||||
core = "0.91.3"
|
||||
kmpObservableviewmodelCore = "1.0.0-BETA-3"
|
||||
kotlinxSerializationJson = "1.8.1"
|
||||
material3 = "1.3.2"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue