HISE Logo Forum
    • Categories
    • Register
    • Login

    Optimizing for UI Timers [EXCITEMENT!]

    Scheduled Pinned Locked Moved Solved Scripting
    5 Posts 4 Posters 188 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.
    • clevername27C
      clevername27
      last edited by clevername27

      I've got two kinds of GUI components that run on timers called from the UI Note-On callback.

      • callAfterDelay().
      • fade() (which I assume is a timer inside HISE).

      Now let's say I make the parent panel of those UI components invisible. I no longer need those timers to run. What happens?

      I'm guessing the HISE fade API will check if it's visible, and if not, won't run. I'll keep calling it from the Note-On callback, but the overhead will be negligible

      But my manual calls will still activate the callAfterDelay timer. So I would need to:

      1. Have a global variable to check in the UI Note-On callback.
      2. Have a function call I make from the Note-On callback to request whether the timer should be started. I'm guessing this has a lot more overhead than checking a global variable—but it means I don't need yet another global variable.

      Any thoughts on this?

      Thank you.

      LindonL 1 Reply Last reply Reply Quote 0
      • Adam_GA
        Adam_G
        last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • LindonL
          Lindon @clevername27
          last edited by

          @clevername27 said in Optimizing for UI Timers [EXCITEMENT!]:

          I've got two kinds of GUI components that run on timers called from the UI Note-On callback.

          • callAfterDelay().
          • fade() (which I assume is a timer inside HISE).

          is "fade()" here

          .fadeComponent(bool shouldBeVisible, int milliseconds)

          ??


          Now let's say I make the parent panel of those UI components invisible. I no longer need those timers to run. What happens?

          I'm guessing the HISE fade API will check if it's visible, and if not, won't run. I'll keep calling it from the Note-On callback, but the overhead will be negligible

          But my manual calls will still activate the callAfterDelay timer. So I would need to:

          1. Have a global variable to check in the UI Note-On callback.
          2. Have a function call I make from the Note-On callback to request whether the timer should be started. I'm guessing this has a lot more overhead than checking a global variable—but it means I don't need yet another global variable.

          Any thoughts on this?

          it really depends on what you are trying to achieve in these "manual calls", is there some reason you wouldnt just use a panel timer, and have it check (in the timer itself) if its panel is visible or not and then stop itself if its not visible...???

          Thank you.

          HISE Development for hire.
          www.channelrobot.com

          clevername27C 1 Reply Last reply Reply Quote 1
          • clevername27C
            clevername27 @Lindon
            last edited by

            @Lindon Thank you - checking for visibility before making the call sounds like the answer - cheers. (And yes on fadeComponent.)

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

              @clevername27 You could probably also use a broadcaster here to watch for changes in visibility.

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

              1 Reply Last reply Reply Quote 1
              • clevername27C clevername27 has marked this topic as solved on
              • First post
                Last post

              41

              Online

              1.7k

              Users

              11.7k

              Topics

              102.1k

              Posts