MCPcopy Create free account
hub / github.com/FastLED/FastLED / add

Method add

src/fl/audio/audio_manager.cpp.hpp:18–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18shared_ptr<Processor> AudioManager::add(const Config &config) {
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();
27 auto proc = Processor::createWithAutoInput(fl::move(input));
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;
38 auto proc = fl::make_shared<Processor>();
39 if (processor()) {
40 FL_WARN("Replacing existing audio processor");
41 }
42 processor() = proc;
43 return proc;
44#endif
45}
46
47shared_ptr<Processor> AudioManager::add(shared_ptr<IInput> input) {
48 if (!input) {

Callers 15

onBeatMethod · 0.45
onBeatPhaseMethod · 0.45
onOnsetMethod · 0.45
onTempoChangeMethod · 0.45
onTempoMethod · 0.45
onTempoWithConfidenceMethod · 0.45
onTempoStableMethod · 0.45
onTempoUnstableMethod · 0.45
onBassMethod · 0.45
onMidMethod · 0.45
onTrebleMethod · 0.45
onFrequencyBandsMethod · 0.45

Calls 8

createFunction · 0.85
configMethod · 0.80
addFunction · 0.50
startMethod · 0.45
getMicProfileMethod · 0.45
setMicProfileMethod · 0.45
audioInputMethod · 0.45
has_valueMethod · 0.45

Tested by

no test coverage detected