Multi Sampler Enabled Buttons
-
Hey Gang,
I've got 4 samplers in the Strings section, each with a power button on the UI. Im using another power button on UI to be a "Master Power" for that section.
I've got the Individual power buttons working just fine. However, the Master Power button will turn off the buttons on the UI but not actually turn off the samplers. Can anyone see what Im doing wrong?
//SECTION POWER BLACKOUTS //Strings const var Blackoutimg1 = Content.getComponent("Blackoutimg1"); inline function onSectionPowerbtn1Control(component, value) { Blackoutimg1.showControl(value); Content.getComponent("Powerbtn0").setValue(!value); Content.getComponent("Powerbtn1").setValue(!value); Content.getComponent("Powerbtn2").setValue(!value); Content.getComponent("Powerbtn3").setValue(!value); }; Content.getComponent("SectionPowerbtn1").setControlCallback(onSectionPowerbtn1Control);
-
const var Blackoutimg1 = Content.getComponent("Blackoutimg1"); // better use an array const grpBtn = [Content.getComponent("Powerbtn0"), Content.getComponent("Powerbtn1"), Content.getComponent("Powerbtn2"), Content.getComponent("Powerbtn3")]; inline function onSectionPowerbtn1Control(component, value) { Blackoutimg1.showControl(value); // better use a for... loop for(b in grpBtn) { // call this function to change //the value of the buttons b.setValue(!value); // call this function to trigger their callbacks //and actually turn off the samplers b.changed(); } }; Content.getComponent("SectionPowerbtn1").setControlCallback(onSectionPowerbtn1Control);
-
@Matt_SF Ahhhh, great, thank you!
-
@Matt_SF So now that this is implemented and I save a preset, the preset always turns the buttons back on no matter if it was off when saved. I do have "Save In Preset" parameter turned ON for each power button. Any idea what may be going on?
I have a feeling that the preset saves correctly but this "Master Sectional Power" button triggers after the preset is loaded? I think that makes sense.
EDIT: Im a little thrown off by "UserPresetHander.presetCallback"