Compare commits
No commits in common. "d4174635c418bfb0f5558ebcff9a85cdb08dd2d0" and "94728593088f0264ff5bcce8ea650bde54c6f118" have entirely different histories.
d4174635c4
...
9472859308
1 changed files with 18 additions and 64 deletions
|
|
@ -59,8 +59,6 @@ actual class FMediaPlayer actual constructor(
|
|||
val hairPinEndGrid: Int = -1,
|
||||
val hairPinFromFactor: Float = 1.0f,
|
||||
val hairPinToFactor: Float = 1.0f,
|
||||
val isFin: Boolean = false, // Farany D.C.
|
||||
var finActive: Boolean =false,
|
||||
)
|
||||
private val navigationSteps = mutableListOf<NavigationStep>()
|
||||
|
||||
|
|
@ -86,13 +84,9 @@ actual class FMediaPlayer actual constructor(
|
|||
applyVoiceStates()
|
||||
sequencer?.addMetaEventListener { meta ->
|
||||
if(meta.type == 47){
|
||||
val totalGrids = (sequencer!!.sequence.tickLength / sequencer!!.sequence.resolution).toInt()
|
||||
val currentGrid = (sequencer!!.tickPosition / sequencer!!.sequence.resolution).toInt()
|
||||
val pendingDc = getPendingDcStep()
|
||||
|
||||
val isDcNearEnd = pendingDc != null && (totalGrids - pendingDc.gridIndex) <= 2
|
||||
|
||||
if (isDcNearEnd && pendingDc != null) {
|
||||
if (pendingDc != null) {
|
||||
println("onFinished : DC pending → saut direct vers ${pendingDc.targetGrid}")
|
||||
pendingDc.alreadyDone = true
|
||||
seekToGrid(pendingDc.targetGrid)
|
||||
|
|
@ -287,26 +281,6 @@ actual class FMediaPlayer actual constructor(
|
|||
println("Lien DC créé : $marker à $indx vers le début")
|
||||
}
|
||||
|
||||
// Farany
|
||||
marker.trim().equals("Farany_GROUP_PART", ignoreCase = true) -> {
|
||||
val hasDcAfter = metadataList.any { (_, gi, _, _, mk, _, _, _) ->
|
||||
(gi ?: 0) > currentIndex &&
|
||||
(dcGPattern.matches(mk.trim()) ||
|
||||
dcRegex.matches(mk.trim()))
|
||||
}
|
||||
if (hasDcAfter) {
|
||||
navigationSteps.add(
|
||||
NavigationStep(
|
||||
marker = marker,
|
||||
gridIndex = currentIndex,
|
||||
targetGrid = last_grid,
|
||||
isFin = true,
|
||||
finActive = false
|
||||
)
|
||||
)
|
||||
println("Farany mémorisé à la grille $currentIndex")
|
||||
}
|
||||
}
|
||||
// velocité
|
||||
extractDynamic(marker) != null && marker.trim() != "=" -> {
|
||||
val dyn = extractDynamic(marker) ?: return@forEach
|
||||
|
|
@ -388,7 +362,6 @@ actual class FMediaPlayer actual constructor(
|
|||
step.hairPin == null &&
|
||||
step.dynamic == null &&
|
||||
!step.isHold
|
||||
&& !step.isFin
|
||||
}
|
||||
}
|
||||
private fun startNavigationMonitor(sharedScreenModel: SharedScreenModel) {
|
||||
|
|
@ -416,19 +389,6 @@ actual class FMediaPlayer actual constructor(
|
|||
|
||||
if (step != null) {
|
||||
when {
|
||||
step.isFin -> {
|
||||
if(step.finActive) {
|
||||
step.alreadyDone = true
|
||||
// println("Farany passage → FIN à grille $currentIndex")
|
||||
sequencer?.stop()
|
||||
sequencer?.tempoFactor = 1f
|
||||
synthetizer?.channels?.forEach {
|
||||
it?.controlChange(64, 0)
|
||||
it?.controlChange(123, 0)
|
||||
}
|
||||
onFinished()
|
||||
}
|
||||
}
|
||||
// Point d'orgue
|
||||
step.isHold -> {
|
||||
val currentBpm = sequencer?.tempoInBPM ?: targetBpm
|
||||
|
|
@ -483,12 +443,6 @@ actual class FMediaPlayer actual constructor(
|
|||
seekToGrid(step.targetGrid)
|
||||
synthetizer?.channels?.forEach { it?.controlChange(64, 0) }
|
||||
sequencer?.tempoFactor = 1f
|
||||
|
||||
navigationSteps.filter { it.isFin && step.gridIndex > it.gridIndex }
|
||||
.forEach {
|
||||
it.finActive = true
|
||||
it.alreadyDone = false
|
||||
}
|
||||
if (sequencer?.isRunning == false) {
|
||||
sequencer?.tempoInBPM = targetBpm
|
||||
sequencer?.start()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue