Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: How to set the custom slider to a certain value
I want to have the custom slider in the standard "Pro"-Skin to be set to 100% (right) at start of VirtualDJ.

I read about the "OnInit"-element (found here http://www.virtualdj.com/wiki/Skin+OnInit.html).
This "element" is part of the skin sdk and need to be placed in the file of the skin.


In the skin itself I found this:
<panel name="@custom_[PANELNAME]" group="custom_[PANELNAME]" visible="yes" available="yes" displayname="Custom Buttons">
<panel class="area_tab" action1="skin_panelgroup 'custom_[PANELNAME]' +1" action2="skin_panelgroup_available 'custom_[PANELNAME]'" text="USER" localize="true"/>
<slider class="horfxslider" x="+26+10+17" y="+50-13-35+11" action="custom_button 5" rightclick="custom_button_edit 5" defaultvalue="0" />
<group name="custom_buttons" x="+24+10" y="+100-28-28-6">
<button class="button_main" x="+0" y="+0" width="55" height="28" action="custom_button 1" textaction="custom_button_name 1" rightclick="custom_button_edit 1" textcolor="textoff3"/>
<button class="button_main" x="+55+6" y="+0" width="55" height="28" action="custom_button 2" textaction="custom_button_name 2" rightclick="custom_button_edit 2" textcolor="textoff3"/>
</group>
<group name="custom_buttons2" x="+24+10" y="+100-28">
<button class="button_main" x="+0" y="+0" width="55" height="28" action="custom_button 3" textaction="custom_button_name 3" rightclick="custom_button_edit 3" textcolor="textoff3"/>
<button class="button_main" x="+55+6" y="+0" width="55" height="28" action="custom_button 4" textaction="custom_button_name 4" rightclick="custom_button_edit 4" textcolor="textoff3"/>
</group>
</panel>

There is a "horfxslider".


For this I have several questions:

1: How to set the value of the slider?
--------------------------------------------------------
custom_button 5 100%

...does not work.

2: How to seperate the slider of the left deck from the slider of the right deck?
---------------------------------------------------------
Currently when moving the left slider, the right slider is moving, too. I want to have them seperately.
 

Posted Sat 25 Feb 23 @ 12:27 pm
locoDogPRO InfinityModeratorMember since 2013
From your other related topic [please keep related stuff together]

this is what your silder sets,
set_var $myLeftSlider


so in turn this var will also set your slider
set $myLeftSlider 0.75
 

Posted Sat 25 Feb 23 @ 12:45 pm
I carefully seperated these topics, because ...
- the other topic is about "how to set a variable when moving the custom slider"
- this topic here is about "how to set the SLIDER (and also my variable) on startup of VirtualDJ"

But in case I misunderstand the mechanics in VirtualDJ, I tried to use your hint in the "Pro"-skin with
<oninit action="set $myLeftSlider 100%"/>


But this doesn't do the trick. Neither the slider is set to 100% nor my variable "$myLeftSlider", when I start VirtualDJ.
 

Posted Mon 27 Feb 23 @ 9:37 am
locoDogPRO InfinityModeratorMember since 2013
use the keyboard oninint instead
 

Posted Mon 27 Feb 23 @ 9:42 am
Or use onload instead oninit

oninit in Skins works only at the first open of a Skin.
onload in Skins works at every loading the Skin (open VDJ or change Skin)


<onload action="set $myLeftSlider 100%"/>


 

Posted Mon 27 Feb 23 @ 9:48 am
:D SUPER!! this works!

Conclusion (for others):
---------------------------------------
1: I RIGHTCLICK on the custom slider. > The "Button Editor" comes up. > There write
set $myLeftSlider


As I conclude this creates a new variable called "$myLeftSlider" (you can name it different if ou want) and every time you move the slider, it writes its value to this variable. AND it also binds the slider to the value of the new variable "$myLeftSlider". So if you change the value of the variable, it also changes the slider and its position.
You can also use this variable in the video skins (see https://www.virtualdj.com/forums/251204/General_Discussion/Use_the_value_of_the_custom_button_slider.html).

2: To set a variable on startup of VirtualDJ go to SETTINGS > MAPPING > ONINIT (in the List) and write there
set $myLeftSlider 100%


As mentioned before this not only sets the variable, it also changes the "value" of the SLIDER.

@Locodoc: Thank you!
 

Posted Mon 27 Feb 23 @ 10:06 am