HISE Logo Forum
    • Categories
    • Register
    • Login

    Call an inline function from another inline function?

    Scheduled Pinned Locked Moved General Questions
    6 Posts 2 Posters 319 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.
    • bendursoB
      bendurso
      last edited by bendurso

      I have a callback for a knob used within a namespace (First).

      I want to pass the value of this knob to another inline function located in a different namespace (Second).

      However, HISE crashes when I try to do this. Could the issue be that I am calling an inline function from within another inline function? If I change the second inline function to a regular function, everything works fine.

      Example:

      namespace First
      {
      
      inline function onKnob1Control(component, value)
      {
      	Second.UpdateValue();
      };
      
      Content.getComponent("Knob1").setControlCallback(onKnob1Control);
      }
      
      
      namespace Second
      {
      const var Knob1 = Content.getComponent("Knob1");
      
      inline function UpdateValue()
      {
              Knob1.getValue();
              // Do something
      };
      
      }
      
      
      
      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @bendurso
        last edited by

        @bendurso that looks funky, whats the end goal?

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

        bendursoB 1 Reply Last reply Reply Quote 0
        • bendursoB
          bendurso @d.healey
          last edited by

          @d-healey In the first namespace, I assign a function to the knob.

          In the second namespace, I use the knob's value for a different purpose.

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

            @bendurso you should use a value broadcaster in the second namespace - or in both if you're using my fork.

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

            d.healeyD bendursoB 2 Replies Last reply Reply Quote 1
            • d.healeyD
              d.healey @d.healey
              last edited by

              I think the reason for the crash is because you don't have a reference to the knob in the first namespace.

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

              1 Reply Last reply Reply Quote 0
              • bendursoB
                bendurso @d.healey
                last edited by bendurso

                @d-healey said in Call an inline function from another inline function?:

                you should use a value broadcaster in the second namespace - or in both if you're using my fork.

                I watched your video about the broadcaster a few days ago, but I hadn't tried it out until now. Hehe. I just tried it, and it worked :)

                @d-healey said in Call an inline function from another inline function?:

                I think the reason for the crash is because you don't have a reference to the knob in the first namespace.

                Edit: I just realized that the crash was due to something else in the main knob (it was the knob I had posted a few days ago about unload and load the convolution reverb to update the setRange). https://forum.hise.audio/topic/11188/audiofile-setrange-won-t-increment/6?_=1734032060483

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

                10

                Online

                1.7k

                Users

                11.8k

                Topics

                103.1k

                Posts