From 95100a0f03715f0433dfaee016f31a80bf32f7fe Mon Sep 17 00:00:00 2001 From: Christopher Arndt Date: Fri, 19 Apr 2024 12:07:48 +0200 Subject: [PATCH] Initial commit Signed-off-by: Christopher Arndt --- config.nims | 4 ++++ nymph.nimble | 12 ++++++++++++ src/nymph.nim | 46 ++++++++++++++++++++++++++++++++++++++++++++++ tests/config.nims | 1 + 4 files changed, 63 insertions(+) create mode 100644 config.nims create mode 100644 nymph.nimble create mode 100644 src/nymph.nim create mode 100644 tests/config.nims diff --git a/config.nims b/config.nims new file mode 100644 index 0000000..8ee48d2 --- /dev/null +++ b/config.nims @@ -0,0 +1,4 @@ +# begin Nimble config (version 2) +when withDir(thisDir(), system.fileExists("nimble.paths")): + include "nimble.paths" +# end Nimble config diff --git a/nymph.nimble b/nymph.nimble new file mode 100644 index 0000000..ca0be21 --- /dev/null +++ b/nymph.nimble @@ -0,0 +1,12 @@ +# Package + +version = "0.1.0" +author = "Christopher Arndt" +description = "A Nim library for writing audio and MIDI plugins conforming to the LV2 standard" +license = "MIT" +srcDir = "src" + + +# Dependencies + +requires "nim >= 2.0" diff --git a/src/nymph.nim b/src/nymph.nim new file mode 100644 index 0000000..034a555 --- /dev/null +++ b/src/nymph.nim @@ -0,0 +1,46 @@ +const LV2_CORE_URI* = "http://lv2plug.in/ns/lv2core" + +type Lv2Handle* = pointer + +type Lv2Feature* = object + uri*: cstring + data*: pointer + +type Lv2Descriptor* = object + uri*: cstring + + instantiate* = proc( + descriptor: ptr Lv2Descriptor, + sampleRate: cdouble, + bundlePath: cstring, + features: ptr ptr Lv2Feature + ): Lv2Handle {.cdecl.} + + connectPort*: proc( + instance: Lv2Handle, + port: cuint, + dataLocation: pointer + ) {.cdecl.} + + activate*: proc( + instance: Lv2Handle + ) {.cdecl.} + + run*: proc( + instance: Lv2Handle, + sampleCount: cuint + ) {.cdecl.} + + deactivate*: proc( + instance: Lv2Handle + ) {.cdecl.} + + cleanup*: proc( + instance: Lv2Handle + ) {.cdecl.} + + extensionData*: proc( + uri: cstring + ): pointer {.cdecl.} + +type lv2Descriptor* = proc(index: cuint): ptr Lv2Descriptor {.cdecl.} diff --git a/tests/config.nims b/tests/config.nims new file mode 100644 index 0000000..3bb69f8 --- /dev/null +++ b/tests/config.nims @@ -0,0 +1 @@ +switch("path", "$projectDir/../src") \ No newline at end of file