Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: get_decks during skin init
NicotuxHome userMember since 2014
Here is another bug to be added to the list of get_decks bugs :
Using get_decks during skin init (for instance in conditions in a way to do per decks things at init) always return 1 the first time the skin loads whatever the number of decks the skin defines
Looks like decks are open after the skin is loaded once

Current known bugs :

First one mimics old behavior : any new open deck is not increasing get_decks result but registers deck ID instead (this was previously a session permanent value and as such somehow usable but second bug now prevents the workarounds to work)
Note that "deck all get_deck" can display correct max value but can't be get as a variable or a parameter

Second one does the opposite of new one : reloading or switching skin/layout resets result of get_decks to the number of decks the skin defines missing current real value (making things as strange as deck 4 playing but only 1 and 2 accessible because get_decks reporting 2) this value can't be used as a reference as direct access to the extra deck(s) is still possible
Looks like the number of decks the skin defines overwrites the real decks numbers

Would be fine to get at least a get_decks giving some correct values
why not with an extra parameter,
i.e.:
get_decks (whatever default value)
get_decks 'count' (real number of open decks)
get_decks 'skin' (working at load time)
get_decks 'highest' (old behavior)
and a deck_open or deck_exists query
 

Posted Wed 18 Aug 21 @ 4:20 pm
AdionPRO InfinityCTOMember since 2006
Maybe you didn't read the description of get_decks?
"get the total number of decks of the current skin"

It is indeed only initialized at the end of loading the skin, but since you wrote the skin you probably already know what you wrote next to nbdecks="" so it's not that useful to have it available during loading of the skin.

There is indeed no way to get the total number of decks in use, but for a specific deck you could query "deck x get_deck x" i guess. How would you use the total number of decks?
 

Posted Wed 18 Aug 21 @ 4:47 pm
NicotuxHome userMember since 2014
Yes the "new" description contains "of current skin"
but in reality this is true only once the skin is loaded after what it still return the higher ID

The goal is to create skin with floating decks so that no extra window create at load time
The other goal is in videoskin option menu select only existing decks to be display in a video visual
both only need a condition with "get_decks & param_cast & parameter_greater n"

the use of number of decks in use as "deck x get_deck x" is ok, this allow to stop to look for next deck once count is reached - I go on testing a 2 control deck skin with one deck per... stem ;)
And an extended pad for samplerbanks as a keyboard that needs dynamic decks
 

Posted Wed 18 Aug 21 @ 5:05 pm
AdionPRO InfinityCTOMember since 2006
Since there's not really a way to add elements dynamically, you'd still need a section for each deck specifically, so I'm still not sure about the advantage of knowing the total number of decks. You'd just need to query if a specific deck exists in order to show that section no?

Also using it at skin load time doesn't seem very useful, since for a skin the controllers will not have been initialized either (and even for video skin it's still possible to load new decks after the skin is already loaded)
 

Posted Wed 18 Aug 21 @ 5:35 pm
NicotuxHome userMember since 2014
difficult to explain everything... (and reveals the answer to another known issue making VDJ sometime crashing while switching skin many times)

"get the total number of decgks of the current skin" is the RECENT
but DOES ALWAYS NOT MATCH reality SPECIALLY @ oninit and anywhere during load time :\
In no way the current number reported is something useful there :
- 1 whatever nbdecks can be at first start
- what nbdecks reported in previous skin after that (whatever new nbdecks can be in newly selected skin)

so that a basic example is better

<oninit action="show_window testwindow on"/>

<define class="deckbutton" placeholders="*decknb,*size=30" x="+[SIZE]+4*[DECKNB]+142" y="4" height="[SIZE]" width="[SIZE]" action="holding ? show_window padpage[DECKNB] : show_window padpage[DECKNB] ? show_window padpage[DECKNB] : show_window turntable[DECKNB]" rightclick="show_window padpage[DECKNB]">
<up color="#7f7f7f" shape="square" border="yellow" border_size="2" radius="3"/>
<over color="#5f5f5f" shape="square" border="yellow" border_size="2" radius="3"/>
<selected color="beige" shape="square" border="yellow" border_size="2" radius="3"/>
<text fontsize="21" align='center' dx="1" width="[SIZE]" height="[SIZE]" overcolor="#a1a1a1" color="beige" text="[DECKNB]" localize="false"/>
<textselected fontsize="21" align='center' dx="1" width="[SIZE]" height="[SIZE]" overcolor="#a1a1a1" color="black" text="[DECKNB]" localize="false"/>
</define>

<define class="testwindow" width="1*34+34" height="38" name="testwindow" color="yellow" border="red" condition="get_decks &amp; param_cast int &amp; param_equal 1"/>
<define class="testwindow" width="2*34+34" height="38" name="testwindow" color="yellow" border="red" condition="get_decks &amp; param_cast int &amp; param_equal 2"/>
<define class="testwindow" width="3*34+34" height="38" name="testwindow" color="yellow" border="red" condition="get_decks &amp; param_cast int &amp; param_equal 3"/>
<define class="testwindow" width="4*34+34" height="38" name="testwindow" color="yellow" border="red" condition="get_decks &amp; param_cast int &amp; param_equal 4"/>
<define class="testwindow" width="5*34+34" height="38" name="testwindow" color="yellow" border="red" condition="get_decks &amp; param_cast int &amp; param_equal 5"/>
<define class="testwindow" width="6*34+34" height="38" name="testwindow" color="yellow" border="red" condition="get_decks &amp; param_cast int &amp; param_equal 6"/>
<define class="testwindow" width="7*34+34" height="38" name="testwindow" color="yellow" border="red" condition="get_decks &amp; param_cast int &amp; param_equal 7"/>
<define class="testwindow" width="8*34+34" height="38" name="testwindow" color="yellow" border="red" condition="get_decks &amp; param_cast int &amp; param_equal 8"/>
<define class="testwindow" width="9*34+34" height="38" name="testwindow" color="yellow" border="Sango_iro" condition="get_decks &amp; param_cast int &amp; param_equal 9"/>
<define class="testwindow" width="10*34+34" height="38" name="testwindow" color="yellow" border="red" condition="get_decks &amp; param_cast int &amp; param_equal 10"/>
<define class="testwindow" width="11*34+34" height="38" name="testwindow" color="yellow" border="red" condition="get_decks &amp; param_cast int &amp; param_bigger 10"/>
<window class="testwindow" name="testwindow" color="yellow" border="red">
<panel x="-142">
<button class="deckbutton" decknb="…" action="load_skin"/> condition="get_decks &amp; param_cast int &amp; param_smaller 10"/>
<button class="deckbutton" decknb="1"/>
<button class="deckbutton" decknb="2" condition="get_decks &amp; param_cast int &amp; param_bigger 1"/>
<button class="deckbutton" decknb="3" condition="get_decks &amp; param_cast int &amp; param_bigger 2"/>
<button class="deckbutton" decknb="4" condition="get_decks &amp; param_cast int &amp; param_bigger 3"/>
<button class="deckbutton" decknb="5" condition="get_decks &amp; param_cast int &amp; param_bigger 4"/>
<button class="deckbutton" decknb="6" condition="get_decks &amp; param_cast int &amp; param_bigger 5"/>
<button class="deckbutton" decknb="7" condition="get_decks &amp; param_cast int &amp; param_bigger 6"/>
<button class="deckbutton" decknb="8" condition="get_decks &amp; param_cast int &amp; param_bigger 7"/>
<button class="deckbutton" decknb="9" condition="get_decks &amp; param_cast int &amp; param_bigger 8"/>
<button class="deckbutton" decknb="10" condition="get_decks &amp; param_cast int &amp; param_bigger 9"/>
</panel>
</window>
<window class="testwindow" name="testwindow" color="gold" border="red">
sorry for the colors, beige being originally deckcolor[DECKNB]
try it with different skins with different number of decks and switch decks and add extra decks

Related issue:
This may also explain the issue with wrong windows number wrong position and wrong size (not the one recorded in settings) applying to newly selected skin when switching skins making sometimes VDJ crash
The values are taken from "future previous (already current) skin" correct ones being available too late
A workaround (maybe usable as a fix) beind the double click bottom right of resize area (reset positions) to reload previously saved state for the newly selected skin once loaded
( a double load of the skin does overwrite these settings because the ones of previous skin are saved before to unload the skin, then the skin is reloaded)
 

Posted Sat 21 Aug 21 @ 1:32 am
AdionPRO InfinityCTOMember since 2006
Should be quite consistent. During loading of the skin, get_decks will be 0 if no other skin was loaded yet, or the last skin's number of decks otherwise.
During the skin's oninit and after, get_decks will return the number of decks declared in the skin.

Note that classes/define is translated during loading of the skin. So even though you show the window in oninit, it was already loaded before that. (and thus using a useless measure for get_decks)

It is therefore still not clear how you want to use this. If your intention is indeed the number of decks defined in the skin, then why the need to make it dynamic at all?
If your intention is to match the number of controller decks, or number of loaded decks then using defines and classes doesn't seem very useful either since at startup the controller may not be connected yet, and no songs would be loaded yet either.
Or you expect to reload the skin after every change in decks in use?
 

Posted Sat 21 Aug 21 @ 5:49 am