How to use Global Cables in fx plugin
-
I'm gonna use Global Cables for the first time in my fx project.
There are posts on the forum but does anyone have any suggestions on how I can get started?
-
@JulesV You can start with this:
-
@resonant Thanks!
-
Is it possible to use Global Cable in HarcodedMasterFX?
-
I think it struggles in that case, unless it was coded in c++
-
@griffinboy nope should be fine, I think the issue is if you load the compiled fx into a network instead if a hardcoded fx module.
-
@Christoph-Hart I can vouch for this I've been using them in my hard-coded fx without issue !
-
Yes I was also be able to load it in Hardcoded.
However, on initialization, it gives the error
undefined parameter
forthis.data.value
Why it does that?
const var MyPnl = Content.getComponent("MyPnl"); const var rm = Engine.getGlobalRoutingManager(); const var mc = rm.getCable("dlyDuckGR"); mc.registerCallback(function(value) { MyPnl.data.value = Engine.doubleToString(Engine.getDecibelsForGainFactor(value), 1); MyPnl.repaint(); }, AsyncNotification); MyPnl.setPaintRoutine(function(g) { g.setFont("Arial", (12)); g.setColour(Colours.white); g.drawAlignedText(this.data.value, [71, 0, 60, 20], "left"); });
-
@JulesV possibly a timing issue - the paint routine might be executing (on init) before the Global cable has had a chance to send a value, or before the panel has had a chance to load its data...try checking your this.data.value is defined...
-