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 isScanning by remember { mutableStateOf(false) }
var qrCodeResult by remember { mutableStateOf("Aucun code scanné") } var qrCodeResult by remember { mutableStateOf("Aucun code scanné") }
/* if (isScanning) {
ScannerScreen(
onScanComplete = { result ->
qrCodeResult = result
isScanning = false
},
onClose = {
isScanning = false
}
)
} else {*/
MainScreenWithDrawer( MainScreenWithDrawer(
solfaScreenModel, solfaScreenModel,
@ -165,17 +154,6 @@ object ScreenSolfa : Screen {
Text(nextLabel) Text(nextLabel)
} }
MGButton(onClick = { 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() solfaScreenModel.loadCustomFile()
}) { }) {
val loadFile: String by sharedScreenModel.loadFile.collectAsState() 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 volumelevel by sharedScreenModel.volumeLevel.collectAsState()
val player = sharedScreenModel.mediaPlayer val player = sharedScreenModel.mediaPlayer
LaunchedEffect(isPlay, isPos) { LaunchedEffect(isPlay, isPos) {
if (isPlay && !isPos) { if (isPlay && !isPos) {
while (true) { while (true) {
@ -117,7 +116,7 @@ LaunchedEffect(isPlay, isPos) {
onSongSelected = { newSong -> onSongSelected = { newSong ->
sharedScreenModel.loadNewSong("whawyd3.mid") sharedScreenModel.loadNewSong("whawyd3.mid")
} }
) )
}, content = { }, content = {
Scaffold(contentWindowInsets = WindowInsets(0, 0, 0, 0), topBar = { Scaffold(contentWindowInsets = WindowInsets(0, 0, 0, 0), topBar = {
TopAppBar( TopAppBar(
@ -247,6 +246,7 @@ LaunchedEffect(isPlay, isPos) {
duration = duration, duration = duration,
onPlayPauseClick = { onPlayPauseClick = {
sharedScreenModel.togglePlayPause() sharedScreenModel.togglePlayPause()
},
onSeek = { newPos -> onSeek = { newPos ->
sharedScreenModel.setDragging(true) sharedScreenModel.setDragging(true)
sharedScreenModel.seekTo(newPos) 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.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons 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.Church
import androidx.compose.material.icons.filled.Clear import androidx.compose.material.icons.filled.Clear
import androidx.compose.material.icons.filled.ClearAll import androidx.compose.material.icons.filled.ClearAll
@ -339,7 +340,7 @@ fun MidiControlPanel(
onClick = { onClick = {
showBPMTools = !showBPMTools showBPMTools = !showBPMTools
}) { }) {
Icon(imageVector = Icons.Default.MusicNote, contentDescription = "Tempo") Icon(imageVector = Icons.Default.AvTimer, contentDescription = "Tempo")
} }
AnimatedVisibility(visible = showBPMTools){ AnimatedVisibility(visible = showBPMTools){
Box( Box(

View file

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