Hi,
can someone explain the difference between a Modulator (the buttons we are adding for example) and Components?
Then explain the reason and differences when using different Lua codes like the following
To switch a normal uiImageButton modulator representing a LED on, I’m using this code on the button that triggres it (a momentary uiImageButton modulator):
function ledFilterSlopes(modulator, modValue)
-- -6dB slope
if modValue==0 then
panel:getComponent("ledSlope6"):setValue(1,true)
panel:getComponent("ledSlope12"):setValue(0,true)
panel:getComponent("ledSlope18"):setValue(0,true)
panel:getComponent("ledSlope24"):setValue(0,true)
end
-- -12dB slope
if modValue==1 then
panel:getComponent("ledSlope6"):setValue(0,true)
panel:getComponent("ledSlope12"):setValue(1,true)
panel:getComponent("ledSlope18"):setValue(0,true)
panel:getComponent("ledSlope24"):setValue(0,true)
end
end
So, here I’m using directly the name in getComponent().
Is it also correct to use function ledFilterSlopes(modulator, modValue) or shall I use ledFilterSlopes = function(modulator, modValue)?
At other places, I’m using:
txtParameter=panel:getModulatorByName("txtParameter")
txtParameter:getComponent():setPropertyString ("uiLabelText", sParameter)
So, what is the correct way to set values?
Are both correct but maybe that their respective usage is depending on something?
Is the second method to be used for setting properties of the component within the modulator while the first one is setting the value of the modulator?
Thx in advance for explanations!