Refactor MainView onClick and cleanup project config

Moved the onClickFunction outside of the START button div in MainView for better event handling. Removed outdated project directory from gradle.xml to clean up project configuration. Corrected sampleRate calculation in ChipProcessor for accurate audio processing.
This commit is contained in:
2024-12-08 20:10:14 +01:00
parent dc3a940942
commit 52c7495f43
3 changed files with 10 additions and 9 deletions

1
.idea/gradle.xml generated
View File

@@ -10,7 +10,6 @@
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/audio-worklet" />
<option value="$PROJECT_DIR$/common" />
</set>
</option>
</GradleProjectSettings>

View File

@@ -85,7 +85,7 @@ class VstChipProcessor : AudioWorkletProcessor() {
var recordingSample = 0
var recordingStart = 0
val sampleLength = 1 / 48000.0 //sampleRate.toDouble()
val sampleLength = 1 / sampleRate.toDouble()
val rightDelayBuffer = Float32Array(sampleRate)
val leftDelayBuffer = Float32Array(sampleRate)

View File

@@ -1,3 +1,5 @@
@file:OptIn(ExperimentalJsExport::class)
package nl.astraeus.vst.chip.view
import kotlinx.browser.window
@@ -119,13 +121,13 @@ object MainView : Komponent(), CssName {
div(StartBoxCss.name) {
div(StartButtonCss.name) {
+"START"
onClickFunction = {
VstChipWorklet.create {
started = true
requestUpdate()
WebsocketClient.send("LOAD\n")
}
}
}
}
onClickFunction = {
VstChipWorklet.create {
started = true
requestUpdate()
WebsocketClient.send("LOAD\n")
}
}
}