Connexion rapide:  

Forum: VirtualDJ Technical Support

Sujet XML Variables in Skin and Database

Ce topic est ancien et peut contenir des informations obselètes ou incorrectes.

Is there any way to use the value of a variable from the skin.xml file in the database.xml file? For example, suppose I have a variable that changes value when a button is clicked. I would like the 'action' of a poi to be different depending upon the value of this variable.

I have tried setting the action of the button in the skin.xml file to the variable X like this:
action="toggle 'X"
Then, I set the action for a poi in the database.xml file to depend on the value of X, like this:
Action="X ? os2l_button 'Button_1' : os2l_button 'Button_2'"

But, this doesn't seem to work. Is there any way to use global variables or something like that to make this possible? Any thoughts would be appreciated. Thanks!
 

Posté Mon 29 Jul 19 @ 5:49 pm
NicotuxHome userMember since 2014
 

Posté Mon 29 Jul 19 @ 6:18 pm
locoDogPRO InfinityModeratorMember since 2013
SteveWestPalm wrote :

Then, I set the action for a poi in the database.xml file to depend on the value of X, like this:
Action="X ? os2l_button 'Button_1' : os2l_button 'Button_2'"


Action="var 'X' 1 ? os2l_button 'Button_1' : os2l_button 'Button_2'"
 

Posté Mon 29 Jul 19 @ 7:15 pm
The most important thing here is that you use local (per deck) variables.
toggle 'MyVar' will change/alter the variable named 'MyVar' only on the deck the action was executed.
Therefore if your button belongs to a deck (let's say deck 1) it will alter 'MyVar' only on deck 1 and action POI's that run on deck 2 won't see the change.

However, toggle '$MyVar' will toggle a GLOBAL variable (unique variable on the entire program)
Please note that 'MyVar' and '$MyVar' are actually 2 different variables. Changing the global variable '$MyVar' does not change/ has effect on local 'MyVar' variables.
In this case your POI's should also query the global variable:
var_equal '$MyVar' 1 ? this : that
 

Posté Tue 30 Jul 19 @ 8:03 am


(Les anciens sujets et forums sont automatiquement fermés)