FastLED 3.9.15
Loading...
Searching...
No Matches

◆ create() [1/2]

ISynthOscillatorPtr fl::audio::ISynthOscillator::create ( ISynthEnginePtr engine,
const SynthParams & params )
static

Factory function to create an oscillator with specified engine and parameters.

Parameters
engineShared pointer to the engine to use (keeps engine alive)
paramsWaveform parameters
Returns
Shared pointer to the oscillator

Definition at line 137 of file synth.cpp.hpp.

137 {
138 if (!engine || !engine->isValid()) {
139 return nullptr;
140 }
141 // Safe downcast - we control the factory, so we know the concrete type
142 auto engineImpl = fl::static_pointer_cast<SynthEngineImpl>(engine);
143 return fl::make_shared<SynthOscillatorImpl>(engineImpl, params);
144}
shared_ptr< T > make_shared(Args &&... args) FL_NOEXCEPT
Definition shared_ptr.h:414
shared_ptr< T > static_pointer_cast(const shared_ptr< Y > &other) FL_NOEXCEPT
Definition shared_ptr.h:514

References fl::make_shared(), and fl::static_pointer_cast().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: