Quick Sign In:  

Forum: VirtualDJ Skins

Topic: [SKIN DEVELOP] red blinking remain time?

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

In the development of my skin, I would like to include a "REMAIN TIME" that red blinks when it's reaching near the end of the song. My current code (that is copied and is the same in the default skin) is:

<textzone deck="1">
...
<text font="arial" size="19" color="#00FFFF" align="right" weight="bold" format="\62 %Pleft"/> NOTE: \62 is a caracter ">"

For can do this, I think I need to use more robust code, as a VDJScript.
Using the search feature of the site (with the words "remain time"), found nothing about it, just a mention on page below stating that one of the new features of VDJ 7.0.1 is:

http://www.virtualdj.com/wiki/VirtualDJv7.0.1.html
new VDJScript action "get time [elapsed|remain|total|loopin|loopout|cueX] [absolute] [{resolution}]"

So, the most I got was, replacing the part "\62 %Pleft" for "`deck 1 get time remain`" an integer indicating the remaining time in milliseconds.
So far so good. Now I need to turn this into minutes and seconds.
The problem: I could not do anything with this number. Here are my failed attempts to work with it:

"`deck 1 get time remain {2}`"
"`deck 1 get time remain 2`"
"`deck 1 get time remain 3`"
"`param_mod 2 deck 1 get time remain`"
"`deck 1 param_mod 2 get time remain`"
"`param_multiply 0.001 & get time remain`"

Any idea so I can continue?
 

Posted Fri 25 Jan 13 @ 7:35 am
I managed to progress at most to here:

`get time_min remain`:`get time_sec remain`:`get time remain & param_multiply 0.01 & param_cast integer & param_mod 10`

I was not able to use the verbs VDJScripts along with this code (to build macros and make the red blink text if it is less than a certain value).

Another thing that I was tried in vain to add a leading zero when the number has only one digit (the counter fiddled annoyingly when the numbers alternate between tens and units (2 digits and 1 digit)).

I tried things like this:

`time_sec remain param_smaller 10 ? get text '0' & get time_sec remain : get time_sec remain`
`time_sec remain param_smaller 10 ? \0get time_sec remain : get time_sec remain`

I'm giving up for now.
Going back to the old: format="\62 %Pleft"
:'(
 

Posted Fri 25 Jan 13 @ 11:25 am
djjbPRO InfinityMember since 2004
Hi, I think this is what you want...

Two panels with the same remain time display. one red and one black.
Black is on when red is off. And red is blinking when remain time is 30 sec.



<panel id="rt0" group="remain" visible="skin_panel 'rt1' on ? false : true">
<size width="60" height="13"/>
<pos x="300" y="455"/>
<down x="+0" y="+0"/>
</panel>

<textzone panel="rt0" deck="1">
<size width="60" height="12"/>
<pos x="300" y="455"/>
<up x="+0" y="+0"/>
<text font="Tahoma" size="12" color="#000000" align="center" format="%Pleft"/>
</textzone>

<panel id="rt1" group="remain" visible="deck 1 loaded ? deck 1 songpos_remain 30000ms ? blink 500ms : false">
<size width="60" height="13"/>
<pos x="300" y="455"/>
<down x="+0" y="+0"/>
</panel>

<textzone panel="rt1" deck="1">
<size width="60" height="12"/>
<pos x="300" y="455"/>
<up x="+0" y="+0"/>
<text font="Tahoma" size="12" color="#FF0000" align="center" format="%Pleft"/>
</textzone>


Best regards,
John
 

Posted Fri 25 Jan 13 @ 9:02 pm
Dodge57PRO InfinityMember since 2009
or more simply :

<button action="deck 1 loaded ? deck 1 songpos_remain 30000ms ? blink 500ms : false">
<size width="66" height="26"/>
<pos x="1200" y="514"/>
<selected x="869" y="1300"/>
</button>
 

Posted Fri 25 Jan 13 @ 9:31 pm
djjbPRO InfinityMember since 2004
Also a good idea.
After reading the post again, i see he wants a blinking button with the text remain time.
 

Posted Fri 25 Jan 13 @ 9:58 pm
In my skin I just used a few pannels, each with a different color that changes from green to yellow to orange to red then blinks depending on the time remaining. It was done as above but with the pannels being shown based on 'songpos_remain ##%' It is very effective at catching your attention when you need to
 

Posted Sat 26 Jan 13 @ 4:59 am
Very good ideas.
Before I could return to the topic and read your help, I ended up having an simply idea, similar to the Dodge57.
Not exactly the desired solution initially, making the blinking text itself, but to create the illusion that it is flashing, using an inoperative button that blinks with the background color over the text in foreground.
The result was very good, except for the fact that it does not become red when it's flashing.
I took to improve the idea with two different blinking times and speeds (blinking for 1 minute remaining and blinking fast for 20 seconds remaining):

<textzone deck="1">
<size width="90" height="20"/>
<pos x="408" y="149"/>
<text font="arial" size="19" color="#00FFFF" align="right" weight="bold" format="\62 %Pleft"/>
</textzone>
<button action="deck 1 songpos_remain 20000ms ? blink 1000ms : deck 1 songpos_remain 60000ms ? blink 2000ms">
<size width="90" height="20"/>
<pos x="408" y="149"/>
<down x="+0" y="+1050"/>
<selected x="+0" y="+1050"/>
</button>

Many thanks for your help!
 

Posted Mon 28 Jan 13 @ 12:07 pm
djjb, I ended up to test your idea. Perfect! Exactly what I was looking for. Thank you! ;-)
 

Posted Tue 29 Jan 13 @ 6:15 am
djjbPRO InfinityMember since 2004
you're welcome
 

Posted Fri 01 Feb 13 @ 1:38 pm
cetopiHome userMember since 2014
I'm trying something like this too, I have to texts, one is visible all time, in red, then I'd like to have a yellow one, that blinks when <60, and blinks faster when <30
it works with the first part:

<textzone action="display_time">
<text action="get_time"/>
</textzone>

<panel visible="songpos_remain 45000ms ? blink 1000ms : false">
<textzone action="display_time">
<text action="get_time"/>
</textzone>
</panel>


any clue how the double condition works in a single line? I'm messing but can't get it to work
 

Posted Thu 05 Jun 14 @ 9:48 am
Dodge57PRO InfinityMember since 2009
this is a copy of my script ( http://fr.virtualdj.com/addons/16344/Black_Millenium_v4.html )

<pannel group="remain1" id="DUR1a" visible="var '$PAGE' 0 ? deck 1 loaded ? deck 1 songpos_remain 80000ms ? off : on">
<size width="85" height="15"/>
<pos x="775" y="30"/>
<down x="775" y="1089"/>
<up x="775" y="1089"/>
</pannel>
<textzone pannel="DUR1a" deck="1">
<size width="85" height="15"/>
<pos x="775" y="30"/>
<up x="775" y="1089"/>
<text dx="0" dy="1" font="Tahoma" size="14" color="#82877F" align="left" format="`deck 1 loaded ? get text 'Rem :' `%Pleft"/>
<text2 dx="0" dy="1" font="Tahoma" size="14" color="#318C34" align="left" format="`deck 1 loaded ? get text 'Rem :' `%Pleft"/>
<text3 dx="0" dy="1" font="Tahoma" size="14" color="#EADE70" align="left" format="`deck 1 loaded ? get text 'Rem :' `%Pleft"/>
</textzone>

<pannel group="remain1" id="DUR1b" visible="var '$PAGE' 0 ? deck 1 loaded ? deck 1 songpos_remain 40000ms ? blink 500ms : deck 1 songpos_remain 80000ms ? on : off">
<size width="85" height="15"/>
<pos x="775" y="30"/>
<down x="775" y="1089"/>
<up x="775" y="1089"/>
</pannel>
<textzone pannel="DUR1b" deck="1">
<size width="85" height="15"/>
<pos x="775" y="30"/>
<up x="775" y="1089"/>
<text dx="0" dy="1" font="Tahoma" size="14" color="#B73838" align="left" format="`deck 1 loaded ? get text 'Rem :' `%Pleft"/>
</textzone>
 

Posted Thu 05 Jun 14 @ 10:27 am
cetopiHome userMember since 2014
Thanks!
I will have a look on that and try to learn something.
I made it work with this too:


<textzone action="display_time">
<text action="get_time"/>
</textzone>

and this panel over it, starts blinking slowly, and faster later:

<panel visible="songpos_remain 45000ms ? songpos_remain 20000ms ? blink 500ms : blink 1500ms : false">
<textzone action="display_time">
<text action="get_time"/>
</textzone>
</panel>
 

Posted Thu 05 Jun 14 @ 11:52 am
djdadPRO InfinityDevelopment ManagerMember since 2005
FYI, and until we come up with a Wiki page for the version 8 Skin Engine...
- <textzone> can have action too.
So you can have ... <textzone action=".........."> etc.
- You can have different texts when the action of a button is On, off or down...
<button action=".....">
<pos ..... />
<text ........ color="black" format="sometext"/>
<textselected ...color="white" format="sometext_or_other_text"/>
<textover ... ... />
<textdown .../>
</button>

so now, you have multiple ways to make a text blinking or do whatever you want, without having to use panels

E.g. try..
<button action="songpos_remain 30000ms ? blink : off" >
..
..
<text ..... color="white" format="%Pleft"/>
<textselected ...color="black" format="%Pleft"/>
</button>
 

Posted Thu 05 Jun 14 @ 2:14 pm
Learn something new every day!! ;-)
 

Posted Thu 05 Jun 14 @ 2:58 pm
Dodge57PRO InfinityMember since 2009
they are absolutely brilliant new script! I look forward see the wiki!

cetopi, my script is not what you wanted ?
 

Posted Thu 05 Jun 14 @ 8:47 pm


(Old topics and forums are automatically closed)