Update template source when new marker or notes modified
This commit is contained in:
parent
6b8ce0cecf
commit
14c27b541a
1 changed files with 14 additions and 2 deletions
|
|
@ -781,8 +781,20 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
||||||
): String {
|
): String {
|
||||||
/* On ne modifie pas le template tant que les notes ne sont pas modifiées
|
/* On ne modifie pas le template tant que les notes ne sont pas modifiées
|
||||||
* Et tant qu'une marker est ajouter */
|
* Et tant qu'une marker est ajouter */
|
||||||
if (newMarkerValue.isEmpty()) {
|
val notesByVoice = editState.notesByVoice
|
||||||
println("Aucune modification détectée (marqueur vide), on retourne le template original.")
|
val originalNotes = editState.originalNotes
|
||||||
|
var anyNoteModified = false
|
||||||
|
for (voiceNum in 0..3) {
|
||||||
|
val newNot = notesByVoice[voiceNum] ?: ""
|
||||||
|
val oldNot = originalNotes[voiceNum] ?: ""
|
||||||
|
|
||||||
|
if (newNot != oldNot) {
|
||||||
|
anyNoteModified = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!anyNoteModified && newMarkerValue.isEmpty()) {
|
||||||
|
println("Aucune modification détectée, on retourne le template original.")
|
||||||
return templateLine
|
return templateLine
|
||||||
}
|
}
|
||||||
val isT0 = templateLine.startsWith("T0")
|
val isT0 = templateLine.startsWith("T0")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue