Remove KeyboardInputComponent and add file upload and WebSocket support
Deleted unused `KeyboardInputComponent`. Added file upload functionality to `MainView` with WebSocket event handling. Introduced `WebsocketClient` class for managing server connection and file transmission. Enhanced `KeyboardComponent` with configurable key rounding. Updated `WebsocketHandler` for improved binary message handling and storage.
This commit is contained in:
@@ -38,6 +38,7 @@ class KeyboardComponent(
|
||||
initialOctave: Int = 4,
|
||||
val keyboardWidth: Int = 210,
|
||||
val keyboardHeight: Int = keyboardWidth / 2,
|
||||
val rounding: Int = 4,
|
||||
val onNoteDown: (Int) -> Unit = {},
|
||||
val onNoteUp: (Int) -> Unit = {}
|
||||
) : Komponent() {
|
||||
@@ -222,7 +223,7 @@ class KeyboardComponent(
|
||||
0,
|
||||
whiteKeyWidth,
|
||||
keyboardHeight,
|
||||
0,
|
||||
rounding,
|
||||
if (isPressed) WhiteKeyPressedCls.name else WhiteKeyCls.name
|
||||
)
|
||||
}
|
||||
@@ -238,7 +239,7 @@ class KeyboardComponent(
|
||||
0,
|
||||
blackKeyWidth,
|
||||
blackKeyHeight,
|
||||
0,
|
||||
rounding,
|
||||
if (isPressed) BlackKeyPressedCls.name else BlackKeyCls.name
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
package nl.astraeus.vst.ui.components
|
||||
|
||||
import kotlinx.html.div
|
||||
import nl.astraeus.komp.HtmlBuilder
|
||||
import nl.astraeus.komp.Komponent
|
||||
import nl.astraeus.vst.ui.css.Css.defineCss
|
||||
import nl.astraeus.vst.ui.css.CssId
|
||||
import nl.astraeus.vst.ui.css.CssName
|
||||
|
||||
class KeyboardInputComponent : Komponent() {
|
||||
override fun HtmlBuilder.render() {
|
||||
div {
|
||||
+"Keyboard component"
|
||||
}
|
||||
}
|
||||
|
||||
companion object : CssId("keyboard-input") {
|
||||
object KeyboardInputCss : CssName()
|
||||
|
||||
init {
|
||||
defineCss {
|
||||
select(KeyboardInputCss.cls()) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -45,12 +45,12 @@ fun SVG.rect(
|
||||
y: Int,
|
||||
width: Int,
|
||||
height: Int,
|
||||
rx: Int,
|
||||
cls: String
|
||||
rounding: Int,
|
||||
cls: String,
|
||||
) {
|
||||
this.unsafe {
|
||||
+ """
|
||||
<rect class="$cls" x="$x" y="$y" width="$width" height="$height" rx="$rx" />
|
||||
<rect class="$cls" x="$x" y="$y" width="$width" height="$height" rx="$rounding" rx="$rounding" />
|
||||
""".trimIndent()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user