Quick Sign In:  

Forum: VirtualDJ Skins

Topic: [SKIN DEVELOP] how to add VJScript working with key value?

This topic is old and might contain outdated or incorrect information.

In my skin I put many key functions, like a slider that use the key_smooth.
One of my buttons is the reset key for deck.
I want make this button blinks when the key of deck value is diferent of 0.
This is the XML of this button:

<button action="deck 1 key 0">
<size width="49" height="35"/>
<pos x="452" y="591"/>
<down x="+0" y="+1050"/>
</button>
<visual source="XXXXXX ? off : blink" type="onoff">
<size width="49" height="35"/>
<pos x="452" y="591"/>
<down x="+0" y="+1050"/>
</visual>

In place of XXXXXXX, I already try many possibilities, nothing work:

deck 1 key 0 ? off : blink
deck 1 keyoffset 0 ? off : blink
deck 1 %keyoffset 0 ? off : blink
deck 1 key_modifier 0 ? off : blink
get `deck 1 key` 0 ? off : blink
get `deck 1 keyoffset` 0 ? off : blink
get `deck 1 %keyoffset` 0 ? off : blink
get `deck 1 key_modifier` 0 ? off : blink
var_equal`get deck 1 key` 0 ? off : blink
var_equal`get deck 1 keyoffset` 0 ? off : blink
var_equal`get deck 1 %keyoffset` 0 ? off : blink
var_equal`get deck 1 key_modifier` 0 ? off : blink
param_equal `get deck 1 key` 0 ? off : blink
param_equal `get deck 1 keyoffset` 0 ? off : blink
param_equal `get deck 1 %keyoffset` 0 ? off : blink
param_equal `get deck 1 key_modifier` 0 ? off : blink
param_equal `deck 1 get key` 0 ? off : blink
param_equal `deck 1 get keyoffset` 0 ? off : blink
param_equal `deck 1 get %keyoffset` 0 ? off : blink
param_equal `deck 1 get key_modifier` 0 ? off : blink
get `deck 1 key` param_equal 0 ? off : blink
get `deck 1 keyoffset` param_equal 0 ? off : blink
get `deck 1 %keyoffset` param_equal 0 ? off : blink
get `deck 1 key_modifier` param_equal 0 ? off : blink

Anybody help me?
 

Posted Thu 17 Jan 13 @ 7:01 am
djdadPRO InfinityDevelopment ManagerMember since 2005
You dont need the <visual> element

Try this..
<button action="deck 1 key 0 ? off & deck 1 key 0 : blink & deck 1 key 0">
<size width="49" height="35"/>
<pos x="452" y="591"/>
<down x="+0" y="+1050"/>
<selected x="+0" y="+1050"/>
</button>
 

Posted Thu 17 Jan 13 @ 9:03 am
Thank you for help!
But your code also did not work properly.
The button was blinking all the time (regardless if the deck 1 key is equal to zero or not).
I also tried some variations, without success (the button was also always blinking):

<button action="deck 1 key 0 ? off & deck 1 key 0 : blink & deck 1 key 0">
<button action="deck 1 key 0 ? off : blink & deck 1 key 0">
<button action="deck 1 key 0 & deck 1 key 0 ? off : blink">
<button action="deck 1 key param_equal 0 ? off : blink & deck 1 key 0">
<button action="deck 1 key 0 ? off & nothing : blink & deck 1 key 0">
<button action="deck 1 key 0 ? nothing : blink & deck 1 key 0">
 

Posted Thu 24 Jan 13 @ 1:52 pm
djdadPRO InfinityDevelopment ManagerMember since 2005
it should work if you were using key instead of key_smooth. I have tried it and i know it does.
But using key_smooth hmm, might not work.
 

Posted Thu 24 Jan 13 @ 8:39 pm
I think the problem is not the use of the slider with key_smooth value because I monitor all the deck key values with a few textzones and they work very well together with the slider key_smooth:

<textzone deck="1">
...
<text font="arial" size="20" color="#00FFFF" align="right" weight="bold" format="%keyoffset"/> or `get key_modifier` (for integer rounded)
...
<text font="arial" size="20" color="#00FFFF" align="left" weight="bold" format="%Pkey"/>
...
<text font="arial" size="20" color="#00FFFF" align="left" weight="bold" format="%Pcamelot"/>
...
</textzone>

I have even buttons that change the key in integer values ​​and everything works in harmony (all the key commands with key_smooth command):

key +1
<button action="deck 1 key +0.1">
...
key -1
<button action="deck 1 key -0.1">
...

I think the only problem is to pass to the button, somehow, by the "key" command if the deck key value is 0 or not (in the same way that textzones receive this key values and they work well with %keyoffset, %Pkey, %Pcamelot or even the script `get key_modifier` that work similar to the %keyoffset, but showing rounded integer values​​, the %keyoffset show fractional values​​, a wonder). And not to mention the deck itself that accepts and works with all key and key_smooth variations commands together without making confusion between them.
 

Posted Fri 25 Jan 13 @ 6:19 am
Forgot to mention that if the problem was caused by possible fractional values ​​near zero created by key_smooth, they should be overridden by the command deck 1 0 key, do not you think?
Moreover, %keyoffset would show the fractional number instead of 0.
I think also, to move the slider key_smooth, at least at some point should hit and return the value zero rounded.
 

Posted Fri 25 Jan 13 @ 6:31 am


(Old topics and forums are automatically closed)