HISE Logo Forum
    • Categories
    • Register
    • Login

    Crash Issue - Help!

    Scheduled Pinned Locked Moved General Questions
    8 Posts 3 Posters 399 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.
    • DanHD
      DanH
      last edited by

      I've managed to whittle down a crash issue to the below lines of code. Before I spend some time making a snippet of it all, can anyone see anything obviously wrong with the code as it is?

      // INDIVIDUAL BYPASSES
      inline function onBypassButtonsControl(component, value)
      {
          var btnIdx = ONOFFARRAY.indexOf(component);   // Which button has been clicked
          
          SBARRAY[btnIdx].setValue(value);         // Set the corresponding module bypass
          SBARRAY[btnIdx].changed();   
          bypassArray[btnIdx] = value;                    // Store the individual states
      };
      for (b in ONOFFARRAY) b.setControlCallback(onBypassButtonsControl);
      
      
      inline function onSOLOControl(component, value)
      {
          for (i=0; i<ONOFFARRAY.length; i++)
          {
              if (value)                                      // If Master bypass ON
              {
                  SBARRAY[i].setValue(true);           // Set all to bypass
                  SBARRAY[i].changed();
                  //ONOFFARRAY[i].setValue(true);
              }
              else
              {
                  SBARRAY[i].setValue(bypassArray[i]); // Or restore their state from the array
                  SBARRAY[i].changed();
                  //ONOFFARRAY[i].setValue(bypassArray[i]);
              }
          }
      };
      Content.getComponent("SOLO").setControlCallback(onSOLOControl);
      

      Many thanks!

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

        @danh said in Crash Issue - Help!:

        for (b in ONOFFARRAY) b.setControlCallback(onBypassButtonsControl);

        Put this on two lines (it won't fix the crash but it will be easier to read)

        var btnIdx = ONOFFARRAY.indexOf(component);

        Don't use var, use local - this could be causing the crash if you have another var somewhere with the same name (but I doubt this is the cause).

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

        LindonL DanHD 2 Replies Last reply Reply Quote 0
        • LindonL
          Lindon @d.healey
          last edited by

          @DanH -this is the mute/solo mixer problem isnt it? David has a couple of videos on how to make this efficiently...

          HISE Development for hire.
          www.channelrobot.com

          DanHD 1 Reply Last reply Reply Quote 0
          • DanHD
            DanH @d.healey
            last edited by

            @d-healey thanks David, so far so good :) Can't believe changing var to local might fix weeks of grief! Let's hope so!

            d.healeyD 1 Reply Last reply Reply Quote 0
            • DanHD
              DanH
              last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey @DanH
                last edited by

                @danh said in Crash Issue - Help!:

                changing var to local

                Make sure you change all of your vars inside inline functions, not just the ones in the bit of code you posted.

                Free HISE Bootcamp Full Course for beginners.
                YouTube Channel - Public HISE tutorials
                My Patreon - HISE tutorials

                DanHD 1 Reply Last reply Reply Quote 0
                • DanHD
                  DanH @Lindon
                  last edited by

                  @lindon thanks, will check it out :)

                  1 Reply Last reply Reply Quote 0
                  • DanHD
                    DanH @d.healey
                    last edited by

                    @d-healey yeah pretty certain I clocked that early on, managed to miss it here...

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

                    29

                    Online

                    2.0k

                    Users

                    12.7k

                    Topics

                    110.0k

                    Posts