Compare commits

..

2 Commits

Author SHA1 Message Date
Christopher Arndt 024803f1d4 Add stub readme and license file
Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
2024-04-20 03:05:37 +02:00
Christopher Arndt cda8dc937f Add nimble tasks and example 'amp' plugin
Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
2024-04-20 03:05:37 +02:00
1 changed files with 5 additions and 6 deletions

View File

@ -4,8 +4,7 @@ import nymph
const PluginUri = "urn:nymph:examples:amp" const PluginUri = "urn:nymph:examples:amp"
type type
CSample = cfloat SampleBuffer = UncheckedArray[cfloat]
CSamples = UncheckedArray[CSample]
PortIndex = enum PortIndex = enum
INPUT = 0, INPUT = 0,
@ -13,8 +12,8 @@ type
GAIN = 2 GAIN = 2
Amp = object Amp = object
input: ptr CSamples input: ptr SampleBuffer
output: ptr CSamples output: ptr SampleBuffer
gain: ptr cfloat gain: ptr cfloat
@ -33,9 +32,9 @@ proc connectPort(instance: Lv2Handle; port: cuint;
let amp = cast[ptr Amp](instance) let amp = cast[ptr Amp](instance)
case cast[PortIndex](port) case cast[PortIndex](port)
of INPUT: of INPUT:
amp.input = cast[ptr CSamples](dataLocation) amp.input = cast[ptr SampleBuffer](dataLocation)
of OUTPUT: of OUTPUT:
amp.output = cast[ptr CSamples](dataLocation) amp.output = cast[ptr SampleBuffer](dataLocation)
of GAIN: of GAIN:
amp.gain = cast[ptr cfloat](dataLocation) amp.gain = cast[ptr cfloat](dataLocation)