HISE Logo Forum
    • Categories
    • Register
    • Login

    Different repaint methods explaination please...

    Scheduled Pinned Locked Moved Unsolved Scripting
    10 Posts 4 Posters 446 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.
    • ChazroxC
      Chazrox
      last edited by

      Simple question....What is the difference between these three?

      .repaint();
      
      .sendRepaintMessage();
      
      .repaintImmediately();
      
      

      They all seem to do the same thing when I use them but im sure the nuances make a difference.

      Thanks! πŸ™

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

        @Chazrox

        .repaint() is asynchronous, which means it's not real-time, HISE will do it when it gets around to it.

        .repaintImmediately() says, stop everything and do the repaint now.

        The two above are for panels

        sendRepaintMessage() is asynchronous (like .repaint()) and can be used with all other components that use laf.

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

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

          @d-healey actually repaint and repaintImmediately do the same thing now - this distinction was before I rewrote the threading model. Both will execute the code on the scripting thread (and if the call is made on the scripting thread it will be executed right after the current function call), then a list of paint directives is created and sent to the UI thread where it renders the interface).

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

            @Christoph-Hart Api doc needs updating

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

            1 Reply Last reply Reply Quote 2
            • ChazroxC
              Chazrox @Christoph Hart
              last edited by

              @Christoph-Hart @d-healey Thank You πŸ™

              ustkU 1 Reply Last reply Reply Quote 0
              • ustkU
                ustk @Chazrox
                last edited by ustk

                I think repaintImmediately() can be considered deprecated for so long that it can be safely removed. A project that old won't open anyway with current versions for a thousand other reasons...

                @Christoph-Hart While we're around, is there an improvement in drawing in the paintRoutine function vs inline ? since they're both called from a non-inline? My guess is that at least what is called inside the inline will be faster, but the maybe not the rendering in the end...

                Panel.setPaintRoutine(function(g)
                {
                   var...
                });
                
                // versus
                
                Panel.setPaintRoutine(function(g)
                {
                   doSomething();
                });
                
                inline function doSomething()
                {
                    local...
                }
                

                Hise made me an F5 dude, browser just suffers...

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

                  @ustk Yeah I would just hide it in the api browser and autocomplete, then it can quietly disappear.

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

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

                    @ustk itβ€˜s a bit faster but the main advantage is that you can use local variables which are more tightly scoped.

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

                      I think repaintImmediately() can be considered deprecated for so long that it can be safely removed. A project that old won't open anyway with current versions for a thousand other reasons...

                      If I deprecate it I would have to make it so that it throws a compilation error at the script parsing stage, not only when it's actually called as this could go through unnoticed, but yeah I agree that this could be part of a nice cleanup session along with other things that are completely out of date

                      ustkU 1 Reply Last reply Reply Quote 3
                      • ustkU
                        ustk @Christoph Hart
                        last edited by

                        @Christoph-Hart isn't a laptop a mobile device by definition? lol πŸ˜†

                        Hise made me an F5 dude, browser just suffers...

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

                        24

                        Online

                        1.9k

                        Users

                        12.4k

                        Topics

                        108.4k

                        Posts