Fix! instru on playing midi - Android
This commit is contained in:
parent
4698bc6a2c
commit
84b2094798
2 changed files with 7 additions and 0 deletions
|
|
@ -184,6 +184,7 @@ actual class FMediaPlayer actual constructor(
|
||||||
init {
|
init {
|
||||||
midiDriver.start()
|
midiDriver.start()
|
||||||
loadVoiceVolumes()
|
loadVoiceVolumes()
|
||||||
|
loadSavedInstrumentsToPlayer(this)
|
||||||
val file = File(filename)
|
val file = File(filename)
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -1012,4 +1013,9 @@ actual class FMediaPlayer actual constructor(
|
||||||
val defaultProgram = 0
|
val defaultProgram = 0
|
||||||
return settings.getInt("voice_instrument", defaultProgram)
|
return settings.getInt("voice_instrument", defaultProgram)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun loadSavedInstrumentsToPlayer(mediaPlayer: FMediaPlayer) {
|
||||||
|
val savedProgram = getVoiceInstrument()
|
||||||
|
mediaPlayer.changeInstru(savedProgram)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -865,5 +865,6 @@ class SharedScreenModel(private val fileRepository: FileRepository) : ScreenMode
|
||||||
}
|
}
|
||||||
fun saveVoiceInstrument(program: Int) {
|
fun saveVoiceInstrument(program: Int) {
|
||||||
prefs.putInt("voice_instrument", program)
|
prefs.putInt("voice_instrument", program)
|
||||||
|
_mediaPlayer?.changeInstru(program)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Reference in a new issue