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

Method updateParamHandle_NoLock

src/override/Engine.cpp:1176–1210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1174
1175
1176void Engine::updateParamHandle_NoLock(ParamHandle* paramHandle, int64_t moduleId, int paramId, bool overwrite) {
1177 // Check that it exists
1178 auto it = internal->paramHandles.find(paramHandle);
1179 DISTRHO_SAFE_ASSERT_RETURN(it != internal->paramHandles.end(),);
1180
1181 // Set IDs
1182 paramHandle->moduleId = moduleId;
1183 paramHandle->paramId = paramId;
1184 paramHandle->module = NULL;
1185 // At this point, the ParamHandle cache might be invalid.
1186
1187 if (paramHandle->moduleId >= 0) {
1188 // Replace old ParamHandle, or reset the current ParamHandle
1189 ParamHandle* oldParamHandle = getParamHandle_NoLock(moduleId, paramId);
1190 if (oldParamHandle) {
1191 if (overwrite) {
1192 oldParamHandle->moduleId = -1;
1193 oldParamHandle->paramId = 0;
1194 oldParamHandle->module = NULL;
1195 }
1196 else {
1197 paramHandle->moduleId = -1;
1198 paramHandle->paramId = 0;
1199 paramHandle->module = NULL;
1200 }
1201 }
1202 }
1203
1204 // Set module pointer if the above block didn't reset it
1205 if (paramHandle->moduleId >= 0) {
1206 paramHandle->module = getModule_NoLock(paramHandle->moduleId);
1207 }
1208
1209 Engine_refreshParamHandleCache(this);
1210}
1211
1212
1213json_t* Engine::toJson() {

Callers 4

clearMaps_NoLockMethod · 0.80
json_array_foreachMethod · 0.80
clearMaps_NoLockMethod · 0.80
json_array_foreachMethod · 0.80

Calls 2

endMethod · 0.45

Tested by

no test coverage detected