Compare commits

..

No commits in common. "71c3e4eb1ca75fca47e9b2f783e1ac07ca78140a" and "e941da6f19680f5ca4eb91aa37d95ebe32de2773" have entirely different histories.

8 changed files with 12 additions and 35 deletions

View file

@ -97,15 +97,6 @@ kotlin {
implementation("com.google.zxing:javase:3.5.4") implementation("com.google.zxing:javase:3.5.4")
} }
} }
targets.all {
compilations.all {
compileTaskProvider.configure {
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
}
}
}
} }
android { android {

View file

@ -9,8 +9,6 @@ actual class SaveSettings actual constructor() {
actual fun loadLastUsedDir(): String = settings.getString("last_dir", "/") actual fun loadLastUsedDir(): String = settings.getString("last_dir", "/")
actual fun saveLastUsedDir(lastDir: String) { settings["last_dir"] = lastDir } actual fun saveLastUsedDir(lastDir: String) { settings["last_dir"] = lastDir }
actual fun saveWindowState(state: WindowState) {} actual fun saveWindowBounds(width: Int, height: Int, x: Int, y: Int) {}
actual fun loadWindowState(): WindowState { actual fun loadWindowBounds(): List<Int> = listOf(0, 0, 0, 0)
return WindowState(0,0,0,0)
}
} }

View file

@ -4,7 +4,9 @@ import com.russhwolf.settings.Settings
import com.russhwolf.settings.set import com.russhwolf.settings.set
import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.WindowPlacement
import androidx.compose.ui.window.WindowState import androidx.compose.ui.window.WindowState
import androidx.compose.ui.window.WindowPosition
expect class SaveSettings() { expect class SaveSettings() {
val settings: Settings val settings: Settings

View file

@ -41,11 +41,7 @@ class POneStanzaLyrics {
this.lyrics[stanzaNumber].split("\n").toMutableList() this.lyrics[stanzaNumber].split("\n").toMutableList()
} else } else
mutableListOf() mutableListOf()
if (result.isNotEmpty() && alternativeList.isNotEmpty()) {
result.addAll(1, alternativeList) // overridedLyrics's index from 1 not 0
} else {
result.addAll(alternativeList ) result.addAll(alternativeList )
}
return result return result
} }
} }

View file

@ -44,8 +44,8 @@ import androidx.compose.material.icons.filled.SettingsVoice
import androidx.compose.material.icons.filled.Star import androidx.compose.material.icons.filled.Star
import androidx.compose.material.icons.filled.Tonality import androidx.compose.material.icons.filled.Tonality
import androidx.compose.material.icons.filled.Tune import androidx.compose.material.icons.filled.Tune
import androidx.compose.material.icons.automirrored.filled.VolumeUp import androidx.compose.material.icons.filled.VolumeOff
import androidx.compose.material.icons.automirrored.filled.VolumeOff import androidx.compose.material.icons.filled.VolumeUp
import androidx.compose.material3.Button import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ExperimentalMaterial3Api
@ -402,7 +402,7 @@ fun MidiControlPanel(
Column(horizontalAlignment = Alignment.CenterHorizontally) { Column(horizontalAlignment = Alignment.CenterHorizontally) {
Icon( Icon(
imageVector = if (volume > 0) Icons.AutoMirrored.Filled.VolumeUp else Icons.AutoMirrored.Filled.VolumeOff, imageVector = if (volume > 0) Icons.Filled.VolumeUp else Icons.Filled.VolumeOff,
contentDescription = null, contentDescription = null,
modifier = Modifier.size(20.dp) modifier = Modifier.size(20.dp)
) )

View file

@ -15,7 +15,7 @@ import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Book import androidx.compose.material.icons.filled.Book
import androidx.compose.material.icons.filled.Menu import androidx.compose.material.icons.filled.Menu
import androidx.compose.material.icons.automirrored.filled.MenuBook import androidx.compose.material.icons.filled.MenuBook
import androidx.compose.material.icons.filled.MusicNote import androidx.compose.material.icons.filled.MusicNote
import androidx.compose.material3.Button import androidx.compose.material3.Button
import androidx.compose.material3.DrawerState import androidx.compose.material3.DrawerState
@ -103,7 +103,7 @@ val midi = "whawyd3.mid"
}, },
icon = { icon = {
val isIcon = when { val isIcon = when {
isFfpm -> Icons.AutoMirrored.Filled.MenuBook isFfpm -> Icons.Filled.MenuBook
isEws -> Icons.Filled.MusicNote isEws -> Icons.Filled.MusicNote
isFF -> Icons.Filled.Book isFF -> Icons.Filled.Book
else -> Icons.Filled.Menu else -> Icons.Filled.Menu

View file

@ -5,7 +5,6 @@ import androidx.compose.runtime.setValue
import cafe.adriel.voyager.core.model.ScreenModel import cafe.adriel.voyager.core.model.ScreenModel
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.StateFlow
@ -59,7 +58,7 @@ class SharedScreenModel() : ScreenModel {
private val _searchTitle = MutableStateFlow<String>("") private val _searchTitle = MutableStateFlow<String>("")
val searchTitle: StateFlow<String> = _searchTitle.asStateFlow() val searchTitle: StateFlow<String> = _searchTitle.asStateFlow()
@OptIn(ExperimentalCoroutinesApi::class) @OptIn
val filteredSongs: StateFlow<List<DrawerItem>> = searchTitle val filteredSongs: StateFlow<List<DrawerItem>> = searchTitle
.mapLatest { currentTitle -> .mapLatest { currentTitle ->
val searchTxt = if (currentTitle == "") "" else currentTitle.trim() val searchTxt = if (currentTitle == "") "" else currentTitle.trim()

View file

@ -1,11 +1,6 @@
package mg.dot.feufaro.midi package mg.dot.feufaro.midi
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.cancel
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import mg.dot.feufaro.FileRepository import mg.dot.feufaro.FileRepository
@ -43,8 +38,6 @@ actual class MediaPlayer actual constructor(
private var currentGlobalVolume: Float = 0.8f private var currentGlobalVolume: Float = 0.8f
private var currentTempo: Float = 1.0f private var currentTempo: Float = 1.0f
private val playerScope = CoroutineScope(Dispatchers.Default + SupervisorJob())
private var abJob: Job? = null
init { init {
try { try {
@ -97,7 +90,6 @@ actual class MediaPlayer actual constructor(
fun release() { fun release() {
sequencer?.close() sequencer?.close()
synthetizer?.close() synthetizer?.close()
playerScope.cancel()
} }
actual fun setVolume(level: Float) { actual fun setVolume(level: Float) {
try { try {
@ -147,8 +139,7 @@ actual class MediaPlayer actual constructor(
pointB = -1L pointB = -1L
} }
private fun startABMonitor() { private fun startABMonitor() {
abJob?.cancel() GlobalScope.launch {
abJob = playerScope.launch {
while(isLoopingAB) { while(isLoopingAB) {
val currentTick = sequencer?.tickPosition?: 0L val currentTick = sequencer?.tickPosition?: 0L
if (currentTick >= pointB) { if (currentTick >= pointB) {