HISE Logo Forum
    • Categories
    • Register
    • Login

    obj.value

    Scheduled Pinned Locked Moved General Questions
    7 Posts 3 Posters 260 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MikeBM
      MikeB
      last edited by

      is something like that possible?

      laf.registerFunction("drawLinearSlider", function(g, obj)
        
          xxx = this.obj  getValue??
          
          if (obj.value !== xxx) 
                 do anything
             else
                do anything 
      

      "One hour of trial and error can save 10 minutes of reading the manual."
      "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
      HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

      1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey
        last edited by

        Inside your LAF function put this line:

        Console.print(trace(obj));

        After you hit compile you will see in the console all of the obj properties that are available in your function.

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        1 Reply Last reply Reply Quote 0
        • ?
          A Former User
          last edited by

          What are you trying to do here?

          You're setting xxx to the value of the object, then trying to check if the value of the object is different to xxx (which is the value of the object).

          Seems a bit cyclical.

          1 Reply Last reply Reply Quote 0
          • MikeBM
            MikeB
            last edited by

            What I am trying to do is relatively simple.

            A user loads a preset and the knob "Decay" has the value 234, for example.
            If the user now changes this value - the colour of the knob should change - so that you can see that this value has been changed.
            and is no longer the original value.

            This is possible in a callback for the knob.

            But that would force me to create a callback for each of the 80 buttons.

            It would be more efficient if it were already possible in the "Look and Feel" for all buttons.

            1. get the default value
            2. if the value of the knob changes - i.e. greater/lower than the default value
            3. colour the knob red.

            "One hour of trial and error can save 10 minutes of reading the manual."
            "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
            HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

            d.healeyD 1 Reply Last reply Reply Quote 0
            • d.healeyD
              d.healey @MikeB
              last edited by

              @MikeB said in obj.value:

              But that would force me to create a callback for each of the 80 buttons.

              You can use the same callback function for all knobs.

              The LAF function only provides the current value, you won't be able to detect a changed value without using some external variables which might get messy. You can still set the colour in the LAF though by changing the colour property in the control callback.

              Libre Wave - Freedom respecting instruments and effects
              My Patreon - HISE tutorials
              YouTube Channel - Public HISE tutorials

              MikeBM 1 Reply Last reply Reply Quote 0
              • MikeBM
                MikeB @d.healey
                last edited by

                @d-healey

                I have given the knobs the colour (obj.textColour) in the LAF.

                However, this cannot be subsequently changed in a callback!

                at least I have not been able to do this

                "One hour of trial and error can save 10 minutes of reading the manual."
                "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
                HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

                d.healeyD 1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @MikeB
                  last edited by

                  @MikeB This should work in the callback component.set("textColour", Colours.white);

                  Libre Wave - Freedom respecting instruments and effects
                  My Patreon - HISE tutorials
                  YouTube Channel - Public HISE tutorials

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  26

                  Online

                  1.8k

                  Users

                  12.0k

                  Topics

                  104.2k

                  Posts