fixup! implement realtime solfa highlighting with sync

This commit is contained in:
hasinarak3@gmail.com 2026-01-19 15:36:06 +03:00
parent c00a8507ca
commit 0e3a422a92
4 changed files with 4 additions and 28 deletions

View file

@ -68,17 +68,6 @@ object ScreenSolfa : Screen {
var isScanning by remember { mutableStateOf(false) }
var qrCodeResult by remember { mutableStateOf("Aucun code scanné") }
/* if (isScanning) {
ScannerScreen(
onScanComplete = { result ->
qrCodeResult = result
isScanning = false
},
onClose = {
isScanning = false
}
)
} else {*/
MainScreenWithDrawer(
solfaScreenModel,
@ -165,17 +154,6 @@ object ScreenSolfa : Screen {
Text(nextLabel)
}
MGButton(onClick = {
/*println("Load btn clicked")
launchFilePicker(
mimeTypes = arrayOf("text/plain"),
onFileSelected = { path ->
if (path != null) {
println("fichier $path");
} else {
println("Pas de dichier")
}
}
)*/
solfaScreenModel.loadCustomFile()
}) {
val loadFile: String by sharedScreenModel.loadFile.collectAsState()

View file

@ -84,7 +84,6 @@ var refreshTrigeer by remember { mutableStateOf(0)}
val volumelevel by sharedScreenModel.volumeLevel.collectAsState()
val player = sharedScreenModel.mediaPlayer
LaunchedEffect(isPlay, isPos) {
if (isPlay && !isPos) {
while (true) {
@ -117,7 +116,7 @@ LaunchedEffect(isPlay, isPos) {
onSongSelected = { newSong ->
sharedScreenModel.loadNewSong("whawyd3.mid")
}
)
)
}, content = {
Scaffold(contentWindowInsets = WindowInsets(0, 0, 0, 0), topBar = {
TopAppBar(
@ -247,6 +246,7 @@ LaunchedEffect(isPlay, isPos) {
duration = duration,
onPlayPauseClick = {
sharedScreenModel.togglePlayPause()
},
onSeek = { newPos ->
sharedScreenModel.setDragging(true)
sharedScreenModel.seekTo(newPos)

View file

@ -26,6 +26,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.AvTimer
import androidx.compose.material.icons.filled.Church
import androidx.compose.material.icons.filled.Clear
import androidx.compose.material.icons.filled.ClearAll
@ -339,7 +340,7 @@ fun MidiControlPanel(
onClick = {
showBPMTools = !showBPMTools
}) {
Icon(imageVector = Icons.Default.MusicNote, contentDescription = "Tempo")
Icon(imageVector = Icons.Default.AvTimer, contentDescription = "Tempo")
}
AnimatedVisibility(visible = showBPMTools){
Box(

View file

@ -1,4 +1,3 @@
// commonMain/kotlin/mg/dot/feufaro/viewmodel/SharedScreenModel.kt
import androidx.compose.runtime.State
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.getValue
@ -133,7 +132,6 @@ class SharedScreenModel() : ScreenModel {
})
println("New media Player crée $newMidiFile")
}
// val mediaPlayer =
fun togglePlayPause() {
_mediaPlayer?.let { player ->
@ -151,7 +149,6 @@ class SharedScreenModel() : ScreenModel {
}
}
println("128: Status de isPlay ${_isPlay.value} \nisPos ${_isPos.value} \ncurrentPos ${_currentPos.value} \n volume ${_volumeLevel.value}")
// _isPlay.value = !_isPlay.value
}
}
fun stopMidi() {