| 26 | } |
| 27 | |
| 28 | DiodeNode::DiodeNode(AudioContext & ac) |
| 29 | : WaveShaperNode(ac, *desc()) |
| 30 | { |
| 31 | _distortion = setting("distortion"); |
| 32 | _vb = setting("vb"); |
| 33 | _vl = setting("vl"); |
| 34 | _vb->setFloat(0.2f); |
| 35 | _vl->setFloat(0.4f); |
| 36 | setDistortion(1.f); |
| 37 | |
| 38 | _distortion->setValueChanged([this]() { |
| 39 | this->_precalc(); |
| 40 | }); |
| 41 | _vb->setValueChanged([this]() { |
| 42 | this->_precalc(); |
| 43 | }); |
| 44 | _vl->setValueChanged([this]() { |
| 45 | this->_precalc(); |
| 46 | }); |
| 47 | |
| 48 | initialize(); |
| 49 | } |
| 50 | |
| 51 | void DiodeNode::setDistortion(float distortion) |
| 52 | { |
nothing calls this directly
no test coverage detected