Home › Forums › General › Using Ctrlr › How I can change the Visible Name of uiSlider?
Tagged: uiSlider VisibleName, Visible Name, VisibleName
- This topic has 10 replies, 4 voices, and was last updated 4 years ago by goodweather.
-
AuthorPosts
-
April 26, 2020 at 1:13 am #117914
Hello Ctrlrs!
I´m trying change the visible name of slider by a previous combo selection.
The minimum and maximum values of slider are working corretly but the name don´t change.
What I´m doing wrong?efxConfig = function(mod, event) slide01 = panel:getComponent("EFX-PRM-01") comboValue = panel:getModulatorByName("EFX-TYPE"):getModulatorValue() if comboValue==00 then -- Set names and values of efx slider slide01:setProperty ("uiSliderVisibleName", "LO-FRQ", false) slide01:setProperty ("uiSliderMin", 0, false) slide01:setProperty ("uiSliderMax", 15, false) end end
Thanks!
April 26, 2020 at 2:03 am #117945The trick I use is to look at the 3rd tab on right of the modulator you want to manipulate .. the one under Resources.
The XML in there has the real names. Often they are different to the GUI names – caught me out on more than one occasion.
April 26, 2020 at 2:07 am #117948Oh and not sure about the 3rd param. I am away from Ctrlr at the moment but I recall get is 0 params and some set is 4 params. Never clear how to find the exact prototypes. What/how doesnt always give full picture. If you dont get any answers tonight I will look at my panel in the morning since I got those stuff working quite well recently.
April 26, 2020 at 2:45 am #117955Hi lecleto,
try this:
slide01 = panel:getModulatorByName("EFX-PRM-01") slide01:getComponent():setProperty ("componentVisibleName", "LO-FRQ", true) slide01:getComponent():setProperty ("uiSliderMin", 0, true) slide01:getComponent():setProperty("uiSliderMax", 15, true)
or …
slide01 = panel:getComponent("EFX-PRM-01") slide01:setProperty ("componentVisibleName", "LO-FRQ", true) slide01:setProperty ("uiSliderMin", 0, true) slide01:setProperty("uiSliderMax", 15, true)
I also uploaded a panel that calculates Roland Checksums. I don’t want to post the Ctrlr URL, because this post might go into /dev/null
- This reply was modified 4 years ago by dnaldoog.
April 26, 2020 at 1:06 pm #117973So I found all I am doing is
m:getComponent():setPropertyString("uiLabelText", getPatchName)
How does one find the signature for this setPropertyString?
OP was using false
you use true
I dont do either and it works 🙂So my guess is defaults are true?
Trouble with defaults is the API is allowed to change that.
Would be great to find the protoWhat I have been doing until now is
shooking@MUSICPC /cygdrive/c/Users/shooking/Documents/Synths/ctrlr $ grep -R setPropertyString * Source/Lua/CtrlrLuaObject.cpp:void CtrlrLuaObject::setPropertyString(const String &propertyName, const String &value) Source/Lua/CtrlrLuaObject.cpp: .def("setPropertyString", &CtrlrLuaObject::setPropertyString) Source/Lua/CtrlrLuaObject.h: virtual void setPropertyString(const String &propertyName, const String &value); vim Source/Lua/CtrlrLuaObject.h /setProperty virtual void setProperty (const Identifier &propertyName, const var &newValue, const bool isUndoable=false)=0; @see CtrlrPanel^M @see CtrlrModulator^M @see CtrlrComponent^M @see CtrlrPanelEditor^M @see CtrlrMidiMessage^M
So I take it that by default isUndoable is false … so when I dont set it, or OP sets it we are doing the same thing?
What I was suggesting I do:
select an object you want to refer to (in my case a single0N LCD)
You should see General, Resource, Utility as tabs on right hand top of the screen.
Click the Utility
find the thing you want to manipulate (this is what the setProperty will use rather than what the GUI says).
To me you calls look good except I dont specify the false.One thing you notice I also use a lot is modulatorCustomIndex.
So in my case it is 119
ah wait !!! You want a uiSliderVisibleName right?Well I have one of these
I did my trick, put the code in a temp file, then look for properties
shooking@MUSICPC /cygdrive/c/Users/shooking/Documents/Synths/ctrlr $ grep -i visible pants componentLabelHeight="14" componentLabelWidth="0" componentLabelVisible="1" componentLabelFont="<Sans-Serif>;12;0;0;0;0;1;3" componentVisibleName="Volume" shooking@MUSICPC /cygdrive/c/Users/shooking/Documents/Synths/ctrlr $ And from a LUA console >>> mv = panel:getModulatorByName("MainVolume") >>> mv:getComponent():setProperty("componentVisibleName", "pantVolume") ERROR: No matching overload found, candidates: void setProperty(CtrlrLuaObject&,Identifier const&,var const&,bool) -- so looks like the default doesnt work in this mode? >>> mv:getComponent():setProperty("componentVisibleName", "pantsVolume", true) ' >>> console(""..L(mv:getComponent():getProperty("componentVisibleName"))) pantsVolume
There living proof I do change my underwear – even it only in a virtual world.
Simply to add to what dnaldoog said – this is the odd way I reverse engineer Ctrlr APIs … I would love if there was a list somewhere that I have simply overlooked.
Attachments:
You must be logged in to view attached files.April 26, 2020 at 1:50 pm #117975I looked up the source code and while I don’t pretend to know what it means, it looks like ‘false’ might be preferable. All depends what function
owner.getUndoManager()
has. Maybe you’d need Atom to explain that one.void CtrlrModulator::setProperty (const Identifier& name, const var &newValue, const bool isUndoable) { if (isUndoable) { modulatorTree.setProperty (name, newValue, owner.getUndoManager()); } else { modulatorTree.setProperty (name, newValue, 0); } }
April 26, 2020 at 3:07 pm #117976Don’t know anymore what you are looking for tbh…
You can see the property ID’s by switching View -> Property IDs/Names in the Ctrlr menu.
Click on another modulator to see the change.When I want to change something on the fly, I’m usually hiding the name label and adding a specific uiLabel modulator.
Then use classical
lblSlide01 = panel:getModulatorByName(“Slide01”) –> put this in some Init method
lblSlide01:getComponent():setPropertyString (“uiLabelText”, “Lo-Freq”)April 26, 2020 at 3:30 pm #117979…
You can see the property ID’s by switching View -> Property IDs/Names in the Ctrlr menu.
Click on another modulator to see the change.
…Hey Goodweather – can you explain this a little. When I click on that, I don’t see anything or know what it’s for even.
April 26, 2020 at 5:13 pm #117987me neither 🙂
Can you post a before and after pic. I can only find what I need by looking at Utility
BTW I forgot about Doxygen – and then I recalled.
NiceAttachments:
You must be logged in to view attached files.April 26, 2020 at 5:21 pm #117990Hello Ctrlrs!!
First of all: Thank you for all inputs!!!
The problem is solved!!! As dnaldoog sugest me I just replaced uiSliderVisibleName by componentVisibleName
Here is the code that are working perfectly now:efxConfig = function(mod, event) slide01 = panel:getComponent("EFX-PRM-01") comboValue = panel:getModulatorByName("EFX-TYPE"):getModulatorValue() if comboValue==00 then -- EFX - STEREO-EQ slide01:setProperty ("componentVisibleName", "LO-FREQ", false) slide01:setProperty ("uiSliderMin", 0, false) slide01:setProperty ("uiSliderMax", 1, false) slide02:setProperty ("componentVisibleName", "LO-GAIN", false) slide02:setProperty ("uiSliderMin", 0, false) slide02:setProperty ("uiSliderMax", 30, false)
Just a detail!!!
Many thanks for all!
April 27, 2020 at 11:07 am #118003Maybe that you forgot to do what I stated just after 😉
You can see the property ID’s by switching View -> Property IDs/Names in the Ctrlr menu.
Click on another modulator to see the change.You need to click on another modulator to see the change of the properties Names to ID’s and opposite
Attachments:
You must be logged in to view attached files. -
AuthorPosts
- The forum ‘Using Ctrlr’ is closed to new topics and replies.