Compare commits
1 Commits
master
...
incrementa
| Author | SHA1 | Date | |
|---|---|---|---|
| b3cd36b8f8 |
@@ -37,8 +37,6 @@ kotlin {
|
|||||||
val commonMain by getting {
|
val commonMain by getting {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(project(":common"))
|
implementation(project(":common"))
|
||||||
|
|
||||||
implementation("nl.astraeus:vst-worklet-base:1.0.0-SNAPSHOT")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val jsMain by getting {
|
val jsMain by getting {
|
||||||
|
|||||||
45
audio-worklet/src/jsMain/kotlin/nl/astraeus/vst/Externals.kt
Normal file
45
audio-worklet/src/jsMain/kotlin/nl/astraeus/vst/Externals.kt
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
package nl.astraeus.vst
|
||||||
|
|
||||||
|
import org.khronos.webgl.Float32Array
|
||||||
|
import org.w3c.dom.MessagePort
|
||||||
|
|
||||||
|
enum class AutomationRate(
|
||||||
|
val rate: String
|
||||||
|
) {
|
||||||
|
A_RATE("a-rate"),
|
||||||
|
K_RATE("k-rate")
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AudioParam {
|
||||||
|
var value: Double
|
||||||
|
var automationRate: AutomationRate
|
||||||
|
val defaultValue: Double
|
||||||
|
val minValue: Double
|
||||||
|
val maxValue: Double
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AudioParamMap {
|
||||||
|
operator fun get(name: String): AudioParam
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract external class AudioWorkletProcessor {
|
||||||
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletNode/parameters) */
|
||||||
|
//val parameters: AudioParamMap;
|
||||||
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletNode/port) */
|
||||||
|
@JsName("port")
|
||||||
|
val port: MessagePort
|
||||||
|
|
||||||
|
@JsName("process")
|
||||||
|
open fun process(
|
||||||
|
inputs: Array<Array<Float32Array>>,
|
||||||
|
outputs: Array<Array<Float32Array>>,
|
||||||
|
parameters: dynamic
|
||||||
|
): Boolean {
|
||||||
|
definedExternally
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
external fun registerProcessor(name: String, processorCtor: JsClass<*>)
|
||||||
|
external val sampleRate: Int
|
||||||
|
external val currentTime: Double
|
||||||
Reference in New Issue
Block a user