November 1, 2015 at 10:08 am #61764
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!April 14, 2017 at 5:50 pm #71834
am currently round about this point…April 16, 2017 at 4:13 pm #71855
Actualy, my question is from some time ago when I was discovering Ctrlr. I still don’t have the exact answer fro mAtom but we can say that a modulator is some kind of higher object having properties and that it contains a component which has also properties.
Atom defined different components with different properties.
So, you can see this as a way to handle a common layer of properties (the modulator) and a specific layer of properties depending on the component you use.
Maintenance wise, you only need to manage the modulator properties at one place.
This is my guess…April 17, 2017 at 1:02 am #71863
Look at my post here where I explained just that 🙂April 17, 2017 at 11:06 am #71869
Yep! Thx Mr.ToR 😉
You must be logged in to reply to this topic.