Solved Function Pointers for Fun and Profit?
-
I get that inline functions cannot be members of objects in HISE.
Does anyone know if I can set a data variable in a Panel component to point to an inline function? (And if so, what would be the syntax to assign the pointer, and the syntax to call the function?)
Thanks!
-
you are right that you cannot assign a object to a panel that contains a function however you can create objects that hold the keys for another object containing the functions.
We can use this trick to not store the functions directly but the 'keys' that refer to the function.
HiseSnippet 956.3ocsV02iaSCF2o8xzZggXR7AvZ+S6Ipt0TFCDHDkq2cnBb2pniSHgPa9RdRi4RrirctsJz9ZvmS9F.ONNMoYq61nRz+n0Ou+yOu4tPICAsVpHd8d55bf38g9KWKLIyRXbAY9IDuOx+bl1.Jpi0wqyYZMDQ77598VFd8NfT94u+1iYoLQHzvhPtTxCgehmwMMbWL8G4oomwhfmxy1R6GMcdnTLSlJKP7z0eLImEdMaEbAypVGeh2cNMhajpkFlAzDuCNVFsdYh7EBm9Wx07qRAKQ.YI5HG6yjoQVDa4RlkvSiVr4dqInWVzjE55xBeh+47HdM+lrwGWJf1Xw14CuNsgW2VvK3sAuc.IusfzANHce+kgJdtoQhEOef+bAVbhYXZean3zkz4G55OShZHLGkwtFNSgD0VL7wiGOhhec3W2u+CeHMBh4BfFWHBMbofZRXFZHSPuBveRSgHJWn4Q.kQkW8GPngJUTlRwV2GqbZSsoZ52P+y98rjAeEMNXj67D77jQ8ekKbZ1M.FCfdMr15H6QtHBdIMthpFIUg0xKmIfTZDyvphYIiSP5lXZsAi6fx3OXDECVg1EmXkLqku0UWkFKmTY4jANn5ByMLEcgMTAXb1jSWAlYxrbo.IF9.m3GfYS2oizf4RVZALrFi1LsBVUhezOU5sZidnXz0ZYJbTthi9bvh5qKkqQfQ+TpQYqcVVGVU3rEGtXUq6U+5K3uYU8n57xuaixaQ3jRg84hzVMBwACOzlaeMrsIrao2.z7WsCGLYmNXNkk0nzjRiqIkhKjF3IhgG1GsD8J80EEGuSY1hiRhsqpcJ1tzQcaFNTTjcEnFgkbrlTqHNI1d79Nuei2gtdksTTJlK3lmjCUz299I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