HISE Logo Forum
    • Categories
    • Register
    • Login

    How Does Code Execute Before onInit?

    Scheduled Pinned Locked Moved Unsolved General Questions
    1 Posts 1 Posters 101 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

      It appears that onInit runs twice when I choose "Compile All Scripts". And things seem to be executing during onInit in sequences that I can't make sense of.

      When I compile every Script manually, I see what I expect to see in the Console, and no reported errors.

      If I "Compile All Scripts", I see—in the blink of an eye:

      1. A few of the Console print logs that execute as my plugin boots up.
      2. A HISE error message about undeclared Components (which absolutely were declared).
      3. The Console clears again!
      4. I see print logs that execute as my plugin boots up (including some of the same that just appeared).
      5. No error messages.

      (I had to take numerous screenshots until I got the timing just right to see what was in the Console before it clears again.)

      This seemed to have happened once I started loading a default Preset. And my guess is that API threads are passively executing simultaneously, and not finishing when or how I expect them to (as with the SampleMap Callback, which was eventually replaced with the Broadcaster).

      I don't think is a HISE bug, but something is going on with the order of operations that maybe I should know, but don't? I'm sure it's something I can fix on my end, but I am baffled.

      Thank you for any ideas.


      Below is the Console log if I disable clearing it.

      The very first statement in onInit is to print "INIT EXECUTES!" to the Console. But it's not the first thing logged!!!! Instead, it's a whole bunch of other stuff, mostly that I cannot fathom could ever be executed, and isn't even in OnInit.

      So…I'm probably doing something wrong.

      cc29be98-84bc-4f26-acc7-f73619a14c19-image.png


      If I don't disable clearing the Console at the start of onInit, I see this in the Console:

      c1a38c07-21fc-4f03-8d53-e83991e0cdfc-image.png


      But when I load the project, I get different output:

      20c1357e-6037-4b48-b2e3-2331df041301-image.png


      Here is the code;

      3b35c512-df54-4438-a1c8-04a4a6fda2bb-image.png

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

      26

      Online

      1.7k

      Users

      11.9k

      Topics

      103.6k

      Posts