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:-!-:-}
|
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
|
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
|
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)
|
stateSettings.saveLastUsedDir(path)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val fileName = path.substringAfterLast(File.separatorChar)
|
parse(path)
|
||||||
|
|
||||||
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")
|
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
println("Erreur lors de la copie du fichier : ${e.message}")
|
println("Erreur lors de l'ouverture du fichier : ${e.message}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -755,8 +747,12 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
||||||
val overrideIterator: MutableMap<Int, Iterator<String>> = mutableMapOf()
|
val overrideIterator: MutableMap<Int, Iterator<String>> = mutableMapOf()
|
||||||
try {
|
try {
|
||||||
val lyrics = getLyricsComments(lyrics)
|
val lyrics = getLyricsComments(lyrics)
|
||||||
|
val positionDS = ArrayDeque<Int>()
|
||||||
val arrayLyrics = lyrics.split(Regex("[/_]"))
|
val arrayLyrics = lyrics.split(Regex("[/_]"))
|
||||||
arrayLyrics.forEachIndexed { i, lyricsItem ->
|
arrayLyrics.forEachIndexed { i, lyricsItem ->
|
||||||
|
if (lyricsItem.contains($$"${x:}")) {
|
||||||
|
positionDS.add(i)
|
||||||
|
}
|
||||||
val originalLyrics = REGEX_STRIP_DC.replace(lyricsItem, "")
|
val originalLyrics = REGEX_STRIP_DC.replace(lyricsItem, "")
|
||||||
val REGEX_OVERRIDE = Regex(".*\\$\\{O:(\\d+)\\}.*")
|
val REGEX_OVERRIDE = Regex(".*\\$\\{O:(\\d+)\\}.*")
|
||||||
if (REGEX_OVERRIDE.matches(lyricsItem)) {
|
if (REGEX_OVERRIDE.matches(lyricsItem)) {
|
||||||
|
|
@ -807,24 +803,26 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
||||||
val lyricsIterator = lyricsComment.iterator()
|
val lyricsIterator = lyricsComment.iterator()
|
||||||
while (lyricsIterator.hasNext()) {
|
while (lyricsIterator.hasNext()) {
|
||||||
var item = lyricsIterator.next()
|
var item = lyricsIterator.next()
|
||||||
var positionDS = 0
|
|
||||||
// @todo: if item == ${O:...}
|
// @todo: if item == ${O:...}
|
||||||
// ${D:xxx} lyrics of DC and DSs
|
// ${D:xxx} lyrics of DC and DSs
|
||||||
val isDS = Regex("^\\$\\{D([^:]*):").find(item)
|
val isDS = Regex("\\$\\{D([^:]*):").find(item)
|
||||||
if (isDS != null) {
|
if (isDS != null) {
|
||||||
item = item.replace(REGEX_LYRICS_COMMENT, "$2")
|
item = item.replace(REGEX_LYRICS_COMMENT, "$2")
|
||||||
val signDS = isDS.groupValues[1]
|
val signDS = isDS.groupValues[1]
|
||||||
//todo: calculate positionDS
|
|
||||||
val item = when (smartLyricsType) {
|
val item = when (smartLyricsType) {
|
||||||
"E" -> smartELyrics(item.replace(" _", " "))
|
"E" -> smartELyrics(item.replace(" _", " "))
|
||||||
"Y" -> smartYLyrics(item)
|
"Y" -> smartYLyrics(item)
|
||||||
else -> item
|
else -> item
|
||||||
}
|
}
|
||||||
|
var pDS = positionDS.removeFirstOrNull() ?: 0
|
||||||
|
if (signDS != "S") {
|
||||||
|
pDS = 0
|
||||||
|
}
|
||||||
item
|
item
|
||||||
.addHyphens()
|
.addHyphens()
|
||||||
.split(Regex("[_/]"))
|
.split(Regex("[_/]"))
|
||||||
.forEachIndexed { i, xval ->
|
.forEachIndexed { i, xval ->
|
||||||
appendLyricsItem(stanzaNumber, i + positionDS, xval)
|
appendLyricsItem(stanzaNumber, i + pDS, xval)
|
||||||
}
|
}
|
||||||
lyricsIterator.remove()
|
lyricsIterator.remove()
|
||||||
}
|
}
|
||||||
|
|
@ -892,7 +890,7 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
||||||
if (matchResult.isNotEmpty()) {
|
if (matchResult.isNotEmpty()) {
|
||||||
lyricsComment.addAll(matchResult)
|
lyricsComment.addAll(matchResult)
|
||||||
}
|
}
|
||||||
return REGEX_STRIP_DC.replace(lyrics, "")
|
return REGEX_STRIP_DC.replace(lyrics, $$"\\${x:}")
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun defineRefrainFrom(tuoNumber: Int) {
|
private fun defineRefrainFrom(tuoNumber: Int) {
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ kotlin = "2.2.0"
|
||||||
kotlinx-coroutines = "1.10.2"
|
kotlinx-coroutines = "1.10.2"
|
||||||
#20250704
|
#20250704
|
||||||
koin = "4.0.4"
|
koin = "4.0.4"
|
||||||
core = "0.91.1"
|
core = "0.91.3"
|
||||||
kmpObservableviewmodelCore = "1.0.0-BETA-3"
|
kmpObservableviewmodelCore = "1.0.0-BETA-3"
|
||||||
kotlinxSerializationJson = "1.8.1"
|
kotlinxSerializationJson = "1.8.1"
|
||||||
material3 = "1.3.2"
|
material3 = "1.3.2"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue