A few more broadcaster questions - and possible bugs
-
Probably for @Christoph-Hart
attachToOtherBroadcaster
what's the purpose of the transform function and what if any parameters does it need?Can I attach one broadcaster to multiple other broadcasters and is there a way to de-attach them?
What would I use
attachToNonRealtimeChange()
for?What does
removeAllSources()
do?The documentation for the reset function says
This resets the value to the default values passed into the constructor and sends a message to all listeners.
How do we pass default values to the constructor?
-
I'm experimenting and poking around in the source code to try and solve these mysteries.
In this example I have two broadcasters, one attached to the other, the second one also has a listener. I have a button which changes the parameter of the first broadcaster. When this happens I'd expect the listener of the second broadcaster to fire, but it doesn't.
I also can't unattach the second broadcaster from the first, I tried both
removeListener
andremoveSource
.HiseSnippet 910.3ocsV8uaSjCD1aZWDYueHPhGfU6esEhhxlKzF.g.RZJWzQaitzCgDBgb75jX0csWY6EHppOg7xvavci8toYCMpThzk+HJim4alO+YOiyHofPUJgD43c1hLJx4WcGufqm2eNlwQCOD4bW2IjynJMp2hLrRQiQNN67ZiWm56hre91K5gSvbBc0RHzaELB8MrTld0pid4ewRRNBGSOikVI5NubHQv6KRD4.S1wsEJCSNGOidB1DVMWzehUyQNOzMNpSzztD79ci5zlPZ28f1O4.BEOcJc+nGePmtS6LESZ0F4bmAwLsPNVi0TEjzdh3EimK9Lun.ukoXSRnFiHzXnxEKi5OmkDOZornPHmcGsRj1oPjdf6wrX1UquRrtm0g+JDUEMmZ2Dkh9InjSEJsaAktu6XhjkoW4wvmewcHWSkfjPWiJEwhpkWysu.hfqalhOmdjDLtBQ39sZ0vG9Zum44AmOJs+DRj+y8Gvmw3zlDIE1H8jBbLAq.PgWvhepe.DTPCerbl5o9uOPY1sAe3xpIo8sIIs2bR.GMwZMlL+Lwo54TYUrPoa3OMmSzLAO7K6cwkM70xbZC+f.CArfiieCChlapE3OHkpwAUfYK1ddW3UGzFkHg1LSx35vfkv.54+H+hvdlmcm4w3Iv14pj3K38x0ZAOxnuRQRHQjlI3fR2v+S3j7hB.7soMOffXWERGjskmIyn59KgEFTlvf8ZpLqaSaebRxDnWI76qGPpJb4DgldJOzVSuK87+dWSmtQek4JATpM41zDKuIfg77zITY0crIP3R65cB2410IPJjkJAJ3C4L8oYzR6iDIwla3lee89FTotZ5fJYHDp11+76k8OEpHhAIotaojhrzu5vMz+L7PrFuLQPNg5jQkZlY63bH8SvvuhFy5tGRUmqEY1XKOLAE3VT1ufbbc9JTsElez0NA8ZM9vHGQbdBVu9bHyD5RGvQxZM+lFbthoWTcB9OwvoV23voaKEuu6HllLeybr1F3HH1+evwxQ5+l6.3MDhdEA208n2ssyu+Ak+uE4ZFe1wXsjYNjOIOcL7zGgBUmyoIJy4cMyE1B6VFaiBLlxisF+K7ozYjw1ozYzRmnTLQJ9Ho3Zt4Qi6ZWA3D29nZc2iM19a31cJ7F1GIj0S00.1daA9GaKvNaKvGus.2eaAdv1Br6OFn4uX7pbsHsnsAgNdz.6zHGmAbLbCzdaE8eWY1xAB
Edit 1:
removeAllListeners
works but notremoveListnener
.Edit 2:
removeListener
does work, but you have to pass in the entire object used to create the second broadcaster, you can't just pass the broadcaster or ID, I guess because we're not attatching it like a regular listener. This means the object needs to be declared separately to the broadcaster which is not ideal. -
Another possible bug, or lack of documentation:
const bc2 = Engine.createBroadcaster({id: "bc2", args: ["state"]}); bc2.addListener({}, "meta1", function(state) { Console.print("Listener1: " + state); }); bc2.addListener({}, "meta2", function(state) { Console.print("Listener2: " + state); }); bc2.removeListener("");
This removes listener 1, but I don't know why...
-
@d-healey said in A few more broadcaster questions - and possible bugs:
the second broadcaster to fire, but it doesn't.
Think I've fixed this one - https://github.com/christophhart/HISE/pull/664
-
@d-healey You are the gift that keeps on giving.