FastLED 3.10.8
Loading...
Searching...
No Matches

◆ add() [1/3]

shared_ptr< Processor > fl::audio::AudioManager::add ( const Config & config)

Definition at line 19 of file audio_manager.cpp.hpp.

19 {
20#if FASTLED_HAS_AUDIO_INPUT
21 fl::string errorMsg;
22 auto input = IInput::create(config, &errorMsg);
23 if (!input) {
24 FL_WARN("Failed to create audio input: " << errorMsg);
25 return nullptr;
26 }
27 input->start();
29 if (config.getMicProfile() != MicProfile::None) {
30 proc->setMicProfile(config.getMicProfile());
31 }
32 if (processor()) {
33 FL_WARN("Replacing existing audio processor");
34 }
35 processor() = proc;
36 return proc;
37#else
38 (void)config;
40 if (processor()) {
41 FL_WARN("Replacing existing audio processor");
42 }
43 processor() = proc;
44 return proc;
45#endif
46}
shared_ptr< Processor > & processor() FL_NO_EXCEPT
static fl::shared_ptr< IInput > create(const Config &config, fl::string *error_message=nullptr) FL_NO_EXCEPT
static fl::shared_ptr< Processor > createWithAutoInput(fl::shared_ptr< IInput > input) FL_NO_EXCEPT
#define FL_WARN(...)
Definition log.h:437
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
Definition shared_ptr.h:423
@ None
No correction (flat response assumed)
constexpr remove_reference< T >::type && move(T &&t) FL_NO_EXCEPT
Definition s16x16x4.h:30

References fl::audio::IInput::create(), fl::audio::Processor::createWithAutoInput(), fl::FL_NO_EXCEPT, FL_WARN, fl::adl_barrier::make_shared(), fl::fl::adl_barrier::move(), fl::audio::None, and processor().

Referenced by CFastLED::add(), CFastLED::add(), CFastLED::add(), and fl::UIAudio::processor().

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