| 148 | ////////////////////////////////////////////////////////////////////////////// |
| 149 | |
| 150 | SynthOscillatorImpl::SynthOscillatorImpl(fl::shared_ptr<SynthEngineImpl> engine, const SynthParams& params) |
| 151 | : mEngine(engine), mCurrentParams(params) { |
| 152 | // Allocate HexWave structure |
| 153 | mHexWave = static_cast<hw::HexWave*>(fl::malloc(sizeof(hw::HexWave))); |
| 154 | fl::memset(mHexWave, 0, sizeof(hw::HexWave)); |
| 155 | |
| 156 | // Initialize the oscillator with the engine |
| 157 | hw::hexwave_create( |
| 158 | mHexWave, |
| 159 | engine->getEngineInternal(), |
| 160 | params.reflect, |
| 161 | params.peakTime, |
| 162 | params.halfHeight, |
| 163 | params.zeroWait |
| 164 | ); |
| 165 | } |
| 166 | |
| 167 | SynthOscillatorImpl::~SynthOscillatorImpl() FL_NOEXCEPT { |
| 168 | if (mHexWave) { |
nothing calls this directly
no test coverage detected