MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / learnParam

Method learnParam

plugins/Cardinal/src/HostParameters-Map.cpp:302–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300 }
301
302 void learnParam(const uint8_t id, const int64_t moduleId, const int paramId)
303 {
304 DISTRHO_SAFE_ASSERT_UINT2_RETURN(id == learningId, id, learningId,);
305 DISTRHO_SAFE_ASSERT_RETURN(id < MAX_MAPPED_PARAMS,);
306
307 // reset for next time
308 learningId = UINT8_MAX;
309
310 // reset smoothing filters
311 filterInitialized[id] = false;
312 valueFilters[id].reset();
313 valueReached[id] = true;
314
315 // report mapping change to engine if needed
316 if (mappings[id].paramHandle.moduleId != moduleId || mappings[id].paramHandle.paramId != paramId)
317 pcontext->engine->updateParamHandle(&mappings[id].paramHandle, moduleId, paramId, true);
318
319 updateMapLen();
320 }
321
322 void updateMapLen()
323 {

Callers 1

stepMethod · 0.45

Calls 2

updateParamHandleMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected