Accesso rapido:  

Forum: VirtualDJ Skins

Topic: How can I make a button do stuff (in vdjscript) only if a certain audio file is loaded or playing?

Questo argomento è obsoleto e potrebbe contenere informazioni obsolete o errate.

How can I make a button do stuff (in vdjscript) only if a certain audio file is loaded or playing?

I'm trying to make a button that will only do something if, for example, X.mp3 is loaded on deck X, and do something else if X.mp3 is playing on deck X...
(So if X.mp3 is not loaded or playing, the button should not do anything...)

Can anyone give me some pointers?
I've tried all the syntaxes I could think of, but I can't make it work...
:(
 

Inviato Sat 11 Jul 15 @ 2:55 pm
locoDogPRO InfinityModeratorMember since 2013
yes,

load 'C:\tune.mp3' ? do something : nothing

or

get_filepath & param_equal "C:\tune.mp3" ? do something : nothing
 

Inviato Sat 11 Jul 15 @ 3:40 pm
I tried that, but it doesn't do what I need it to do, sorry. Thanks anyway!
I think I did not express myself accurately enough.
It's like this:
1. if deck x is not playing, then load x.mp3 on deck x and start playing
2. if deck x is playing x.mp3, then stop playing
3. if deck x is playing another mp3, then do nothing

...

This doesn't work:

action="deck X play ? deck X load 'C:\X.mp3' ? deck X stop & deck X unload : nothing : deck X load 'C:\X.mp3' & deck X play">

...and that's the most simpel, clean and logical syntax I can put together.
 

Inviato Sat 11 Jul 15 @ 4:14 pm
I've done some tests and I've discovered that, even in the most simple vdjscript constructions, I cannot make these conditions work:

deck x play ?
deck x load 'c:\x.mp3' ?
deck x get_filepath & param_equal 'c:\x.mp3' ?

Is it my computer, VDJ 7, or do they simply not work as conditions?

Does anyone know?
 

Inviato Sun 12 Jul 15 @ 4:45 am
PachNPRO InfinityMember since 2009
Well, this works for Version 8:

deck 1 play ? get_filepath & param_equal "D:\test.mp3" ? deck 1 stop : nothing : deck 1 load "D:\test.mp3" & play

In V7 it should be a bit different:
deck 1 play ? get filepath & param_equal "D:\test.mp3" ? deck 1 stop : nothing : deck 1 load "D:\test.mp3" & play

(Note the missing _ at "get filepath")
However, it is not working as it should.
It loads and playes the track, but it won't stop the deck if "get filepath & param_equal "D:\test.mp3".
I don't know why....
 

Inviato Sun 12 Jul 15 @ 6:47 am
Thanks for your input PatchN!
:)
Yes, I noticed that too: not being able to stop the track...
:(
Anyone else... any ideas or solutions?
 

Inviato Sun 12 Jul 15 @ 3:20 pm
Any of the ATOMIX team any idea as to why the stop function won't work in this syntax?

The short version:
action="deck X play ? get filepath & param_equal 'C:\X.mp3' ? deck X stop : nothing : deck X load 'C:\X.mp3' & deck X play">

The full version:
action="deck X play ? get filepath & param_equal 'C:\X.mp3' ? holding ? deck X sync : deck X stop & deck X unload : nothing : deck X load 'C:\X.mp3' & deck X goto_first_beat & deck X loop 4 & deck X play_sync_onbeat & deck X beatlock">

Any help will be truly appreciated. Honest.
 

Inviato Mon 13 Jul 15 @ 11:13 am
Apparently it's not working.

So much for vdjscript: sometimes, when using correct syntaxes, it will not work for some esoteric reason.
:(
 

Inviato Mon 13 Jul 15 @ 12:29 pm
Hmm... I've asked, begged, pleaded... I tried to be devious, provoking... Atomix devs are not easily fooled or seduced into helping one with scripting problems!
I understand, though. VDJ 8 development is of course the primary goal. But please don't forget about the DJ's that want to stick with VDJ 7...
 

Inviato Wed 15 Jul 15 @ 1:56 pm
If you want to stick with 7, that is OK, and they have provided some tweaks since 8 was released. However, 8 is now and the future. It is unrealistic to think that they will continue to support two versions forever. All software evolves, and we have to move on.
 

Inviato Thu 16 Jul 15 @ 2:01 pm
You're right of course... but I'm one of those guys who, once I've got what I need, stop looking for more...
:)

As in:
- If it ain't broke, don't fix it...
- I never cared for fashions, the latest, etc. I do my own thing...
- I know what I want and that's enough for me...
- I don't compare the neighbour's stereo/TV/car/house/garden/wife with mine to know if I'm satisfied...
- and so on...


 

Inviato Fri 17 Jul 15 @ 9:23 am
@ any of the moderators:
DJDAD explained to me that posts about skins and vdjscript should go in the skinning forum.
Please, feel free to move this post there.
I apologize for posting in the wrong section.
 

Inviato Sat 25 Jul 15 @ 3:14 am
I also stated this on another topic of yours, but here you go again:
VirtualDj 7 was not able to compare texts with VDJ Script. That's why your code doesn't work with VirtualDj 7.

get filename & param_equal 'this' will ALWAYS return FALSE
 

Inviato Wed 29 Jul 15 @ 11:31 am
I'm with 8 now, Phantom
:)
 

Inviato Fri 31 Jul 15 @ 1:51 pm
So Phantom, you say it isn't possible in VDJ7... but that it IS possible in VDJ8?

What would the correct code be, then?
Because this: deck 1 play ? get_filepath & param_equal "D:\test.mp3" ? deck 1 stop : nothing : deck 1 load "D:\test.mp3" & play won't let me stop it...
 

Inviato Thu 13 Aug 15 @ 6:29 am
Better try this new method:

param_equal "`get_filepath`" "D:\MyFolder\MySubfolder\Mysong.mp3" ? this : that
 

Inviato Mon 17 Aug 15 @ 9:40 am
:) THANKS!!!
I'll try that.
 

Inviato Mon 17 Aug 15 @ 10:51 am


(Vecchi argomenti e forum sono automaticamente chiusi)