How I can change the Visible Name of uiSlider?

Home Forums General Using Ctrlr How I can change the Visible Name of uiSlider?

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #117914
    lecleto
    Participant
      • Topics: 10
      • Replies: 34
      • Total: 44

      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!

      #117945
      shooking
      Blocked
        • Topics: 14
        • Replies: 60
        • Total: 74

        The 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.

        #117948
        shooking
        Blocked
          • Topics: 14
          • Replies: 60
          • Total: 74

          Oh 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.

          #117955
          dnaldoog
          Participant
            • Topics: 4
            • Replies: 480
            • Total: 484
            • ★★

            Hi 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.
            #117973
            shooking
            Blocked
              • Topics: 14
              • Replies: 60
              • Total: 74

              So 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 proto

              What 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.
              #117975
              dnaldoog
              Participant
                • Topics: 4
                • Replies: 480
                • Total: 484
                • ★★

                I 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);
                	}
                }
                
                #117976
                goodweather
                Participant
                  • Topics: 45
                  • Replies: 550
                  • Total: 595
                  • ★★★

                  Don’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”)

                  #117979
                  dnaldoog
                  Participant
                    • Topics: 4
                    • Replies: 480
                    • Total: 484
                    • ★★


                    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.

                    #117987
                    shooking
                    Blocked
                      • Topics: 14
                      • Replies: 60
                      • Total: 74

                      me 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.
                      Nice

                      Attachments:
                      You must be logged in to view attached files.
                      #117990
                      lecleto
                      Participant
                        • Topics: 10
                        • Replies: 34
                        • Total: 44

                        Hello 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!

                        #118003
                        goodweather
                        Participant
                          • Topics: 45
                          • Replies: 550
                          • Total: 595
                          • ★★★

                          Maybe 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.
                        Viewing 11 posts - 1 through 11 (of 11 total)
                        • The forum ‘Using Ctrlr’ is closed to new topics and replies.
                        There is currently 0 users and 169 guests online
                        No users are currently active
                        Forum Statistics
                        Threads: 2,495, Posts: 17,374, Members: 77,605
                        Most users ever online was 12 on January 22, 2019 3:47 pm
                        Ctrlr