HISE Logo Forum
    • Categories
    • Register
    • Login

    Memory persistence

    Scheduled Pinned Locked Moved Scripting
    7 Posts 3 Posters 557 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.
    • T
      TNTHM
      last edited by

      Does onInit fire every time the plugin is opened in the daw? Or does onInit fire once when an instance of the plugin is created in the daw?

      Is there a way to specify that some code should fire once when an instance of the plugin is created in the daw?

      If I initiate an instance of a plugin which has an empty object, object1, and then I modify that object to contain the string "I am an object", will that string remain in the object if I close the plugin gui in the daw?

      LindonL 1 Reply Last reply Reply Quote 0
      • LindonL
        Lindon @TNTHM
        last edited by

        @TNTHM said in Memory persistence:

        Does onInit fire every time the plugin is opened in the daw? Or does onInit fire once when an instance of the plugin is created in the daw?

        it fires each time the plugin is opened in the DAW

        Is there a way to specify that some code should fire once when an instance of the plugin is created in the daw?

        write a flag to a file saying your "once only ever" code has (or has not) run and check it on init to see if you need to run "once only ever" code

        If I initiate an instance of a plugin which has an empty object, object1, and then I modify that object to contain the string "I am an object", will that string remain in the object if I close the plugin gui in the daw?

        if widgets(like a label) are set to save in preset then the DAW will remember their state. Panels can have a data attribute- and you can keep objects in there...

        HISE Development for hire.
        www.channelrobot.com

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

          @Lindon no the plugin state remains persistent if you close and reopen the plugin UI and onInit gets only called once.

          Opening and closing the editor makes the same thing as opening and closing the interface preview - there is absolutely no data attached to the UI (with the exception of the webview).

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

            @Christoph-Hart - er I thought thats what I said...

            HISE Development for hire.
            www.channelrobot.com

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

              it fires each time the plugin is opened in the DAW

              That's a bit ambigous, it could also be understood as "everytime the plugin UI is opened in the DAW". Just making sure nobody's misunderstanding anything here :)

              T 2 Replies Last reply Reply Quote 3
              • T
                TNTHM @Christoph Hart
                last edited by

                @Christoph-Hart @Lindon Thank you for explaining and clarifying. I appreciate it.

                1 Reply Last reply Reply Quote 0
                • T
                  TNTHM @Christoph Hart
                  last edited by

                  @Christoph-Hart is it possible to routinely clear the plug-in memory usage without clearing the preset data? I see the method

                  Engine.getMemoryUsage()

                  Is there a way to use this to set a max threshold for memory usage?

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

                  27

                  Online

                  1.7k

                  Users

                  11.9k

                  Topics

                  103.3k

                  Posts