Is there a way to keep a variable's value even after you exit the application? How does VDJ remember my last picked Font size?
Posted Tue 11 Dec 12 @ 12:03 pm
VirtualDJ has no way currently to save any variables. However it can save the selected panel from a group. So if you have multiple panels as browsers with different font selected, it will save the last one selected when exit.
Posted Tue 11 Dec 12 @ 12:16 pm
Thanks for the quick response. Leveraging on the fact that VDJ remembers the last panel used, could I then assign a static value to my variable when VDJ loads and selects the last selected panel? For example:
<panel id="panel_A" group="grp_test" visible="true & set 'myvar' 1">
...
</panel>
<panel id="panel_B" group="grp_test" visible="false & set 'myvar' 0">
...
</panel>
I tried adding [set 'myvar' 1] within in the visible element of a panel but I could not make it work, could something around that idea work?
<panel id="panel_A" group="grp_test" visible="true & set 'myvar' 1">
...
</panel>
<panel id="panel_B" group="grp_test" visible="false & set 'myvar' 0">
...
</panel>
I tried adding [set 'myvar' 1] within in the visible element of a panel but I could not make it work, could something around that idea work?
Posted Tue 11 Dec 12 @ 12:43 pm
No but you can rebuild the variables ONINIT or even requery the panels when you need:
ONINIT action="skin_panel 'panel_A' on ? set 'myvar' 1 : skin_panel 'panel_B' on ? set 'myvar' 0"
Or you can alter your button's code to query the visibility of the panels:
Original code:
var_equal 'myvar' 1 ? play : var_equal 'myvar' 0 ? pause
Alternative code:
skin_panel 'panel_A' on ? play : skin_panel 'panel_B' on ? pause
ONINIT action="skin_panel 'panel_A' on ? set 'myvar' 1 : skin_panel 'panel_B' on ? set 'myvar' 0"
Or you can alter your button's code to query the visibility of the panels:
Original code:
var_equal 'myvar' 1 ? play : var_equal 'myvar' 0 ? pause
Alternative code:
skin_panel 'panel_A' on ? play : skin_panel 'panel_B' on ? pause
Posted Tue 11 Dec 12 @ 1:18 pm
ahhhhhh, ahhhhh, looks extremely interesting. I'll play with that when I get home. Many thanks for the pointers... :)
Posted Tue 11 Dec 12 @ 2:05 pm
:( unfortunately this did not work, apparently when the INIT function runs, the SKIN PANEL command returns the VISIBLE panel no matter which Panel was last used. I would have to assume that VDJ switches to the last used panel after INIT runs.
<INIT action="skin_panel 'font_size5' on ? toggle '$myvar' " />
<INIT action="skin_panel 'font_size5' on ? toggle '$myvar' " />
Posted Thu 13 Dec 12 @ 2:47 am
In order panels to load exactly the way you left them when you closed vdj, they need only to have visible="yes/no"
The init action should hten be like..
skin_panel 'a' on ? set 'var' 1 : skin_panel 'b' on ? set 'var' 2 ...etc
If you need the panels to define a var while using the skin, you need to also set the var with the buttons that change the panels ..like..
button action="skin_panel 'a' on & set 'var' 1"
If you add a query in the visible instead of just true/false, then once vdj loads it will display the panel that the visible returns true after the query
The init action should hten be like..
skin_panel 'a' on ? set 'var' 1 : skin_panel 'b' on ? set 'var' 2 ...etc
If you need the panels to define a var while using the skin, you need to also set the var with the buttons that change the panels ..like..
button action="skin_panel 'a' on & set 'var' 1"
If you add a query in the visible instead of just true/false, then once vdj loads it will display the panel that the visible returns true after the query
Posted Thu 13 Dec 12 @ 10:59 am
right, the part when VDJ loads the last used panel works fine; but what I'm saying is this:
<panel id="panel_A" group="set1" visible="yes">
...
</panel>
<panel id="panel_B" group="set1" visible="no">
...
</panel>
<INIT action="skin_panel 'panel_B' on ? toggle '$myvar' " />
*** when exit VDJ, the last active panel is "panel_B"
but when I open VDJ and the INIT runs, it always returns "panel_A" as the active panel, in other words, the query "skin_panel 'panel_B' on ?" will always return FALSE even if the last used panel was "panel_B". However, after the skin fully loads, the correct "panel_B" does load.
That's why I said that it seems like INIT runs even before VDJ has a chance to decide which panel to use.
<panel id="panel_A" group="set1" visible="yes">
...
</panel>
<panel id="panel_B" group="set1" visible="no">
...
</panel>
<INIT action="skin_panel 'panel_B' on ? toggle '$myvar' " />
*** when exit VDJ, the last active panel is "panel_B"
but when I open VDJ and the INIT runs, it always returns "panel_A" as the active panel, in other words, the query "skin_panel 'panel_B' on ?" will always return FALSE even if the last used panel was "panel_B". However, after the skin fully loads, the correct "panel_B" does load.
That's why I said that it seems like INIT runs even before VDJ has a chance to decide which panel to use.
Posted Thu 13 Dec 12 @ 1:28 pm