Two attachToComponentValue broadcasters, one component
-
I briefly came across this a few days ago and mentioned it here.
At the time I thought it was a limitation of the broadcaster system that only one broadcaster of a given type could be attached to an individual component.
But today I again ran into a situation where it would be ideal to have multiple broadcasters for the same component so I thought I would dig a little deeper.
Looking at the source code I can see the
attachedListeners
is an array, and theattachToComponentValue
function just appends a new broadcaster to the array, also within HISE both broadcasters do fire aton init
just not when the component's value changes.So this leads me to believe that all the groundwork is there for multiple broadcasters for a component, but that there is probably a tiny change required in the source to make it work... I'll keep digging but if @Christoph-Hart have any suggestions I would be grateful.
Here's my test snippet:
HiseSnippet 971.3ocsV8taaaCDmxNZqQ6OXEXO.D5StcAo1xtNIqXHdwwYynModSdACXnnfljJlKxjBTTY0sneqO.8caOA6MXuAaGkjikWbW67Z8GLvw6Nd+tej72oQZEkmlpzHGuwyS3HmO0MbtzLs+ThPhFdLx4VtSni4oFzQySHoobFxwo92Y85r8Vn7e+4gGQhIRJe4RHz4JAk+HwLgY4pi58PQb7IDFerXVkn6zaHUI6qhUY.Rp61DkPnWRtfeFwFVMWz2SRmhbtqay62ky2qcDiQZ2l0sa2C1+fNGzhD0rCYRqtGzInydA6uWDx4iFvDFkNzPL7TjyVGoXyCmp9MYQANWjJlDysFsPgPkKV9DULy1h1UQ8mJhYiVPQoHXWFsjvpWPXeo6oBl350WRbeQtC7xLpRfN0VEd0WAdspBulUf2ZfjSEHsUAjtsaHUKRLK8Xwym3NTZ35HBbNUEJEwhp855t8UPDRytyHWxOQCFWmQitMatCF96NOvy6d2CejVQXTRJ3Fy3QBovHTRO3TL0fuhnwPWYveCdf7BgjuKUyg9rRRMdgGF6KX9eM12Fp+NVah9hTXkewmplknj.T72A6eEINi6+j7HLjhHdh2KsHwl5toby.IAXqeHimwaDQhS4kvjXLD5TrQg4WA6F1xOEIU3Yrp+hJctsJM7enTMoksp9qtEQBMzPwB.7RttbOXrGUtPCfcxaDatQYRpkNZbcarCNuIti2K71FH4TULe2DsPZZ3OdP33V.Kf+pxXdPQq8tRxA+GX4f+GzbvFwyAuOH5f0xzAaBSGbSldwdfUxyTF9ikMxS16kd3+oqnn05y9rQqhiAvsN2VsN8+VhMjYylv0UgtMP387phDtuYQhpZXzhWwUBTIGB2cdbBW9lT1PkO8sBJknBB0jKm74kxIgwBFWiDfpwG6le7gxAboNNtc6e+PzOM7XhgrXafcDpRBWaD1Fv4X9UvTgBUpscOlmdoQkjGa4wGzju0h9rqGbz6W6Me4TDVO3FRRn34KPTu+34u5PzM0GAkYEKKlXVUt1NTqzAb7rhFoUGTlJLyqNz68lF96JDus6HggNc8Xr1ZvHbL7g.ikS99L2AQQbpYI.2x8je9CyXNzOpxLB4EmRLZAbAv8rrYgvWKP4P0kRdr84gSM6E4B6lVaKCDxkrbi+B9U5rk01ozYqENQyHTs5ozhq+1Yq2JeE.Sx7uCYa2Ss13Uu2m+aFLp+oT5pa0MRLXSSr8llXmMMw6uoI1cSSbuMMw8e6IZ+RruMynlU7rAgNczfbcJGmhQZ42VQ+MPXFm7B
-
Ah I see, each component only has one valueListener, well that's annoying. So I make this thread a feature request instead :)
-
Haha! Got it to work, I've turned valueListener into an Array! I just need to do a little bit of cleanup and I'll make a PR. :)
-
@d-healey well done.
-
-
@d-healey Great job, David. Thanks.
That Pull Requests tab looks a bit depressing, though - lots of good stuff there.