Add channel selection

This commit is contained in:
2024-06-26 14:10:03 +02:00
parent 2bcd1e0b71
commit f7e088bb67
6 changed files with 53 additions and 29 deletions

View File

@@ -13,6 +13,7 @@ import kotlinx.html.h1
import kotlinx.html.input
import kotlinx.html.js.onChangeFunction
import kotlinx.html.js.onClickFunction
import kotlinx.html.js.onInputFunction
import kotlinx.html.option
import kotlinx.html.select
import kotlinx.html.span
@@ -111,9 +112,11 @@ object MainView : Komponent() {
input {
type = InputType.number
value = Midi.inputChannel.toString()
onChangeFunction = { event ->
onInputFunction = { event ->
val target = event.target as HTMLInputElement
Midi.inputChannel = target.value.toInt()
println("onInput channel: ${Midi.inputChannel}")
VstChipWorklet.postMessage("set_channel\n${Midi.inputChannel}")
}
}
}
@@ -155,7 +158,7 @@ object MainView : Komponent() {
input {
type = InputType.number
value = Midi.outputChannel.toString()
onChangeFunction = { event ->
onInputFunction = { event ->
val target = event.target as HTMLInputElement
Midi.outputChannel = target.value.toInt()
}
@@ -230,6 +233,8 @@ object MainView : Komponent() {
margin(1.rem)
padding(1.rem)
backgroundColor(Css.currentStyle.buttonBackgroundColor)
borderColor(Css.currentStyle.buttonBorderColor)
borderWidth(Css.currentStyle.buttonBorderWidth)
color(Css.currentStyle.mainFontColor)
hover {