MCPcopy Create free account
hub / github.com/christophhart/HISE / updateComponent

Method updateComponent

hi_scripting/scripting/api/ScriptComponentWrappers.cpp:280–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278}
279
280void ScriptCreatedComponentWrapper::updateComponent(int propertyIndex, var newValue)
281{
282 if (propertyIndex >= ScriptingApi::Content::ScriptComponent::Properties::numProperties)
283 return;
284
285 auto propIndex = (ScriptingApi::Content::ScriptComponent::Properties)propertyIndex;
286
287 switch (propIndex)
288 {
289 case hise::ScriptingApi::Content::ScriptComponent::visible: contentComponent->updateComponentVisibility(this); break;
290 case hise::ScriptingApi::Content::ScriptComponent::enabled: contentComponent->updateComponentVisibility(this); break;
291 case hise::ScriptingApi::Content::ScriptComponent::x:
292 case hise::ScriptingApi::Content::ScriptComponent::y:
293 case hise::ScriptingApi::Content::ScriptComponent::width:
294 case hise::ScriptingApi::Content::ScriptComponent::height: contentComponent->updateComponentPosition(this); break;
295 case hise::ScriptingApi::Content::ScriptComponent::parentComponent: contentComponent->updateComponentParent(this); break;
296 case hise::ScriptingApi::Content::ScriptComponent::automationId:
297 {
298 if (auto mco = dynamic_cast<MacroControlledObject*>(getComponent()))
299 {
300 auto id = newValue.toString();
301 mco->connectToCustomAutomation(id.isNotEmpty() ? Identifier(id) : Identifier());
302 }
303 }
304 default:
305 break;
306 }
307}
308
309void ScriptCreatedComponentWrapper::updateFadeState(ScriptCreatedComponentWrapper& wrapper, bool shouldBeVisible, int fadeTime)
310{

Callers

nothing calls this directly

Calls 15

getComponentFunction · 0.85
updateComponentFunction · 0.85
updateComponentParentMethod · 0.80
setIsMomentaryMethod · 0.80
setButtonTextMethod · 0.80
setRadioGroupIdMethod · 0.80

Tested by

no test coverage detected