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

◆ add() [1/3]

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

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

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

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

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

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