bitfocus / companion-module-generic-osc

Companion Module
MIT License
3 stars 14 forks source link

Add Variable parsing #15

Closed CaptureMni closed 2 years ago

CaptureMni commented 2 years ago

With current version of companion variables go a big boost and seem quit useful to enable variable parsing so variables could be used as values or inside of addresses for the OSC modul.

This seems to be a functionality that the base companion application provides that need to be implemented by the modules.

This is supported but developers have to implement it on a per-field basis. this.parseVariables(string, cb); https://github.com/bitfocus/companion/issues/1248#issuecomment-706811208

(source of the parseVariables function) https://github.com/bitfocus/companion/blob/master/instance_skel.js#L218

If i can provide any assistance for getting this working let me know.

estilles commented 2 years ago

@CaptureMni Thanks for the request. This is already on my radar. Will work on this soon.

spiderjjr45 commented 2 years ago

Hello,

Can you add support to variables for the Path, and not just the Arguments?

For Companion, if you want to change the text or color of an item, you need to use /style/text/[PAGE]/[BUTTON] "New Text" or /style/bgcolor/[PAGE]/[BUTTON] 255 255 255

I need to be able to more dynamically update a button based on a variable. I have it set so when I click a button it stores that button's coords, then I have a pallette of colored buttons, so that when I click "Red", it colors the last button I pressed. But in order to do that, I need to use variables in the Path.

spiderjjr45 commented 2 years ago

@estilles should I open a new issue for the above?

estilles commented 2 years ago

No need @spiderjjr45. I'll be adding it on the same PR.

sledzik1984 commented 2 years ago

Any updates on that feature?