Fix! Prioritize point d'orgue over navigation jumps on the same grid

This commit is contained in:
Hasinjato 2026-08-27 11:54:08 +03:00
parent 224062e90d
commit a676f567a6
2 changed files with 13 additions and 7 deletions

View file

@ -334,11 +334,8 @@ actual class FMediaPlayer actual constructor(
clockNano = System.nanoTime()
clockTick = currentTickPos
val targetIdx = events.indexOfFirst { it.tickAbsolute >= currentTickPos }
idx = events.indexOfFirst { it.tickAbsolute >= currentTickPos }
.takeIf { it >= 0 } ?: events.size
if (targetIdx > idx) {
idx = targetIdx
}
needsClockSync = false
}
@ -699,9 +696,8 @@ actual class FMediaPlayer actual constructor(
}.sortedBy { step ->
when {
step.isHold -> 0
step.isTempoChange -> 1
step.isFarany -> 1
step.dynamic != null || step.hairPin != null -> 1
step.newBpm != null || step.newKey != null || step.isFarany -> 1
step.isTempoChange || step.hairPin != null || step.dynamic != null -> 2
else -> 3
}
}
@ -808,6 +804,9 @@ actual class FMediaPlayer actual constructor(
allNotesOff()
seekToGrid(step.targetGrid)
currentTickPos = step.targetGrid.toLong() * resolution
needsClockSync = true
isHolding = false
for (ch in 0 until 4) controlChange(ch, 64, 0)

View file

@ -558,6 +558,13 @@ actual class FMediaPlayer actual constructor(
val currentSteps = navigationSteps.filter {
it.gridIndex == currentIndex && !it.alreadyDone
}.sortedBy { step ->
when {
step.isHold -> 0
step.newBpm != null || step.newKey != null || step.isFin -> 1
step.isTempoChange || step.hairPin != null || step.dynamic != null -> 2
else -> 3
}
}
for (step in currentSteps) {
if (Math.abs(sequencer!!.tempoInBPM - targetBpm) > 0.1 && !isInTempoChange) {