What is a way around button callbacks not working when they're assigned to a processorId?
-
So I don't think this is a bug, I think this is just me not understanding something. Basically I have a button that is assigned to a processorId - because when the button is on I set a DSPnetwork parameter to 1.0, and when it is off, I set it to 0.0.
But when you assign a processorId in this way, button callbacks stop firing off. I'm sure I've read on the forum that this is intentional.
But my question is, how do I work around this??
As of yet, I've not actually managed to set a DSPnetwork parameter to a value from my code. Don't know if I'm just failing hard there; if anyone has a snippet, that would be much appreciated!
Is this where I have to get into broadcasters, so I can broadcast my button state to multiple places at once???
Any other thoughts?
-
Think I answered my own question.
https://docs.hise.dev/scripting/scripting-api/broadcaster/index.html
*Value changes
On the first look this doesn't sound particularly interesting because the value callback was already accessible through setControlCallback() , however if you're using processorId / parameterId properties it will not fire so this gives you the chance to add additional, "non-exclusive" callbacks for UI thingsSee: attachToComponentValue()*
-
@Orvillain said in What is a way around button callbacks not working when they're assigned to a processorId?:
I've not actually managed to set a DSPnetwork parameter to a value from my code
This is the usual way, but broadcaster is also a good choice.
-
@d-healey said in What is a way around button callbacks not working when they're assigned to a processorId?:
@Orvillain said in What is a way around button callbacks not working when they're assigned to a processorId?:
I've not actually managed to set a DSPnetwork parameter to a value from my code
This is the usual way, but broadcaster is also a good choice.
Yeah I've tried it before, and things weren't flushing through properly. That was earlier in the week though, and a lot of coffee and sleep deprivation has passed through my brain, so I can't really remember the details!
I think I'll investigate the broadcaster approach, because it seems really useful.
-
@Orvillain said in What is a way around button callbacks not working when they're assigned to a processorId?:
As of yet, I've not actually managed to set a DSPnetwork parameter to a value from my code.
fxReference.setAttribute(fxReference.parameterName, value) is not working for you?
You would call this from the knob callback.