1 module libwasm.bindings.WaveShaperNode;
2 
3 import libwasm.types;
4 
5 import memutils.ct: tuple;
6 import libwasm.bindings.AudioNode;
7 
8 @safe:
9 nothrow:
10 
11 enum OverSampleType {
12   none,
13   _2x,
14   _4x
15 }
16 struct WaveShaperNode {
17   nothrow:
18   libwasm.bindings.AudioNode.AudioNode _parent;
19   alias _parent this;
20   this(Handle h) {
21     _parent = .AudioNode(h);
22   }
23   void curve(T0)(scope auto ref Optional!(T0) curve) if (isTOrPointer!(T0, Float32Array)) {
24     Serialize_Object_VarArgCall!void(this._parent, "curve", "Optional!Handle", tuple(!curve.empty, cast(Handle)curve.front.handle));
25   }
26   auto curve()() {
27     return recastOpt!(Float32Array)(Object_Getter__OptionalHandle(this._parent, "curve"));
28   }
29   void oversample()(OverSampleType oversample) {
30     Object_Call_int__void(this._parent, "oversample", oversample);
31   }
32   OverSampleType oversample()() {
33     return Object_Getter__int(this._parent, "oversample");
34   }
35   void passThrough()(bool passThrough) {
36     Object_Call_bool__void(this._parent, "passThrough", passThrough);
37   }
38   bool passThrough()() {
39     return Object_Getter__bool(this._parent, "passThrough");
40   }
41 }
42 struct WaveShaperOptions {
43   nothrow:
44   libwasm.bindings.AudioNode.AudioNodeOptions _parent;
45   alias _parent this;
46   this(Handle h) {
47     _parent = .AudioNodeOptions(h);
48   }
49   static auto create() {
50     return WaveShaperOptions(libwasm_add__object());
51   }
52   void curve()(scope ref Sequence!(float) curve) {
53     Object_Call_Handle__void(this._parent, "curve", curve.handle);
54   }
55   auto curve()() {
56     return Sequence!(float)(Object_Getter__Handle(this._parent, "curve"));
57   }
58   void oversample()(OverSampleType oversample) {
59     Object_Call_int__void(this._parent, "oversample", oversample);
60   }
61   OverSampleType oversample()() {
62     return Object_Getter__int(this._parent, "oversample");
63   }
64 }
65 
66