44 lines
1.0 KiB
Kotlin
44 lines
1.0 KiB
Kotlin
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
|