Call an inline function from another inline function?
-
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 }; }
-
@bendurso that looks funky, whats the end goal?
-
@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.
-
@bendurso you should use a value broadcaster in the second namespace - or in both if you're using my fork.
-
I think the reason for the crash is because you don't have a reference to the knob in the first namespace.
-
@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