HISE Logo Forum
    • Categories
    • Register
    • Login

    panel.changed() recursion

    Scheduled Pinned Locked Moved Scripting
    5 Posts 2 Posters 796 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.
    • d.healeyD
      d.healey
      last edited by

      I have a panel I've set up as a slider. In the panel's event.drag callback I do set the value of the panel and then call the .changed() function, this applies the value of the panel to the parameter I've linked the panel to. However it is also triggering a recursion and giving me a warning

      Recursive call to changed() for sliPan2

      In the API documentation it says there is recursion protection for the .changed() function, so can I just ignore this?

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

      1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart
        last edited by

        Actually it uses a stupid timer approach to catch recursion which might give false positives if you call this function with high frequency. The cleaner solution would be a stack based test.

        I am currently moving everything script related into a separate thread so while I am at this, maybe I can implement this more robustly. I remember when I implemented the recursion protection there were some weird edge cases which lead me to the timer solution but maybe with the new solution it‘s more straight forward.

        d.healeyD 1 Reply Last reply Reply Quote 2
        • d.healeyD
          d.healey @Christoph Hart
          last edited by

          @christoph-hart This issue is still present in the develop branch. Doesn't seem to cause any harm, just floods the console with warnings.

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

          1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart
            last edited by

            Stack based approach it is.

            Since every script code runs on a dedicated thread now, it can be executed synchronously and just needs to be deferred when you call it from a MIDI callback...

            d.healeyD 1 Reply Last reply Reply Quote 1
            • d.healeyD
              d.healey @Christoph Hart
              last edited by

              @christoph-hart Going to build now :)

              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

              43

              Online

              1.7k

              Users

              11.7k

              Topics

              102.0k

              Posts