Add support for "m:X/X" measure on MarkersPopup & fix! ffpm213 lyrics
This commit is contained in:
parent
5b493e5b4e
commit
d9f8f715ff
4 changed files with 27 additions and 4 deletions
|
|
@ -4,6 +4,6 @@ N1:#m ssllsltdd/ m'rdrsltd/ dtltdtlls/ dtdltdrd/ mmfflsffm/ ssdlswss/ sssstwrrd/
|
|||
N2:mmfffwffm/ sfmrfwfm/ ssf3wf3/ mfsssltd'/ ddrrfmrrd/ ssmrfwfm/ mmfflsffm/ ssd'lswss
|
||||
N3:#s dtltdtlls/ dtdltdrd/ dddsswlrs/ ssddrmfm/ ssllsltdd/ mrdrsltd/ ssttrwttd/ mmdrdmfm
|
||||
N4:#t, d5wd3/ d'slfswsd / mmfmrwdtt/ drmfswsd'/ d5wd3/ d'tlfswsd'ddrrswsll/ d't'lfswsd
|
||||
Y1:Ry fana\hy mangetaheta/Mila fitsaharana:/Aza kivy, mahareta,/Sentonao hifarana!/Fa ny tenin'i Jehovah,/Soa mangarangarana;/Loharano tsy mi_ova,/Ao no hasambarana.
|
||||
Y1:Ry fana\hy mangetaheta/Mila fitsaharana:/Aza kivy, mahareta,/Sentonao hifarana!/Fa ny tenin'i Jehova\h,/Soa mangarangarana;/Loharano tsy mi_ova,/Ao no hasambarana.
|
||||
Y2:Ry tontolo mila vonjy,/Te ho afa-patotra,/Ao ny tenin'ny Mpamonjy/Dia Kristy Mpanavotra!/Teny velona sy mamy,/Feno fananarana;/Ho torina eran-tany,/Fa fampihavanana.
|
||||
Y3:Ry Mpanjakan'ny mpanjaka!/Ao, tendreo ny lelako/Mba hitory sy hizaka,/Hampandre ny havako,/Dia tahio ny teny reny/Tsy ho very hasina,/Ka hamo_a zato heny/Ny Baiboly Masina./
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ import androidx.compose.ui.text.font.FontWeight
|
|||
import androidx.compose.ui.text.input.KeyboardType
|
||||
import androidx.compose.ui.unit.IntOffset
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.window.DialogProperties
|
||||
import androidx.compose.ui.window.Popup
|
||||
import androidx.compose.ui.window.PopupProperties
|
||||
import mg.dot.feufaro.viewmodel.measureOptions
|
||||
|
||||
data class Marker(
|
||||
val abbr: String,
|
||||
|
|
@ -138,6 +138,14 @@ private val markerGroups = listOf(
|
|||
markers = listOf(
|
||||
Marker("Dô dia", "Modulation", canEditValue = true, defaultValue = "C", options = Transpose.keyToNumber)
|
||||
)
|
||||
),
|
||||
|
||||
|
||||
MarkerGroup(
|
||||
title = "Mesure",
|
||||
markers = listOf(
|
||||
Marker("m:", measureOptions.firstOrNull { it.first == "4/4" } ?.second ?: "", canEditValue = true, defaultValue = "4/4", options = measureOptions.map { it.first })
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1770,7 +1770,9 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
|||
|
||||
val finalLines = (prefix + cleanedBlocks.joinToString(""))
|
||||
.replace("2z11", "y")
|
||||
.replace("/", "/ ")
|
||||
.replace(Regex("""\$\{.*?\}|/""")) { match ->
|
||||
if (match.value == "/") "/ " else match.value
|
||||
}
|
||||
.replace(Regex("\\s+"), " ")
|
||||
.trim()
|
||||
|
||||
|
|
|
|||
|
|
@ -531,7 +531,7 @@ class SharedScreenModel(private val fileRepository: FileRepository) : ScreenMode
|
|||
|
||||
val tempoRegex = Regex("""^(♩\s*=\s*\d+)""", RegexOption.IGNORE_CASE)
|
||||
val modulaRegex = Regex("""^(D(?:ô|o)?\s*dia\s*(?:C|Db|D|Eb|E|F|Gb|G|Ab|A|Bb|B))""", RegexOption.IGNORE_CASE)
|
||||
|
||||
val measureRegex = Regex("""^\d+\s*/\s*\d+""")
|
||||
// Lexer
|
||||
while (remaining.isNotEmpty()) {
|
||||
remaining = remaining.trimStart()
|
||||
|
|
@ -551,6 +551,14 @@ class SharedScreenModel(private val fileRepository: FileRepository) : ScreenMode
|
|||
continue
|
||||
}
|
||||
|
||||
val measureMatch = measureRegex.find(remaining)
|
||||
if (measureMatch != null) {
|
||||
val cleanMeasure = measureMatch.value.replace(" ", "")
|
||||
tokens.add(cleanMeasure)
|
||||
remaining = remaining.substring(measureMatch.value.length)
|
||||
continue
|
||||
}
|
||||
|
||||
val matchedMarker = allStaticMarkers.find { remaining.startsWith(it, ignoreCase = true) }
|
||||
if (matchedMarker != null) {
|
||||
tokens.add(matchedMarker)
|
||||
|
|
@ -593,6 +601,7 @@ class SharedScreenModel(private val fileRepository: FileRepository) : ScreenMode
|
|||
val isDSFin = markerText.trim().contains(Regex("""D\.?S\.?""", RegexOption.IGNORE_CASE)) && markerText.trim().contains(Regex("""(fine|fin|farany|end)""", RegexOption.IGNORE_CASE))
|
||||
val isRit = Regex("""rit\.?|ritard\.?|ritenuto\.?|ritardando""", RegexOption.IGNORE_CASE)
|
||||
val isRall = Regex("""rall\.?|rallent\.?|rallentando""", RegexOption.IGNORE_CASE)
|
||||
val isMeasure = markerText.trim().matches(Regex("""^(\d+/\d+)""", RegexOption.IGNORE_CASE))
|
||||
|
||||
var searchIndex = index + 1
|
||||
var lastValidIndex = index
|
||||
|
|
@ -633,6 +642,10 @@ class SharedScreenModel(private val fileRepository: FileRepository) : ScreenMode
|
|||
currentMarker = currentMarker.copy(lastCallerMarker = targetIndex)
|
||||
newMarkerList.add("Rallentando")
|
||||
}
|
||||
isMeasure -> {
|
||||
newGridIndex = targetIndex
|
||||
newMarkerList.add("${markerText.trim()}")
|
||||
}
|
||||
else -> {
|
||||
newMarkerList.add(markerText)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue