Quick Sign In:  

Forum: VirtualDJ Plugins

Topic: Secondary Rotation PLUGIN - cue_play

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

Hello guys,

I have been working on a skin for the NS7II / NS7III but have reached a roadblock and stopped developing for a while. I wanted to make a skin that had dual platters with adjustable speed control for secondary rotation. I had to incorporate hundreds of line of "hack" coding to get it to work. That is until Don Moir helped me to create a companion plugin that will allow for a global secondary rotation value to be assign to each deck.

It works very well... and without the need for "Hack" Coding.....
However, there is one problem that we can not figure out. I don't want the secondary rotation to animate when Cue_Play is triggered. "Cue_play" is essentially the same as "Play", so the outer rim animates anytime something is played. We would like to know how to get the plugin to not trigger "play" when "cue_play" is pressed so that the outer rim is stationary.

This is a small problem in the plugin that we do not know how to address. Is there anyone that could help please?





 

Posted Mon 29 Feb 16 @ 8:20 pm
There's no way currently to determine that programmatically I'm afraid.
You can tweak your skin buttons and your controller mapper to capture cue preview, but users with a different mapper or different device will see the movement that you're trying to prevent when previewing a cue.
 

Posted Tue 01 Mar 16 @ 1:11 am
It is ok if cue_play triggers play. The problem is it appears cue_play is not a state. Querying the value of it is does no good (or any cue value it appears). I am no controller or script or mapper expert, but VDJ does know it is in a cue mode or maybe not :) Not sure what querying that state has to do with mappers controllers. Is there anything like when the cue button is down to achieve this? like while_pressed etc. that might work for this case.
 

Posted Tue 01 Mar 16 @ 9:50 pm
The states VirtualDj recognizes are two:

1) Playing
2) Paused

There is no "cued" state
cue ? as a verb will return true when the position of the song matches exactly the position of the cue-point.
In theory, cue ? can return true for a brief moment even if the deck is playing.

Now for cue preview (when you hold down cue button to preview the track) you can set a variable and check that variable on your code

cue & set 'cuebuttondown' while_pressed

Now you can do a query like this:

play ? var 'cuebuttondown' ? deck is previewing cue : deck is playing normally : deck is paused

A more "complete" code would be:

play ? var 'cuebuttondown' ? deck is previewing cue : deck is playing normally : cue ? deck is cued (paused on a cue-point) : deck is paused
 

Posted Wed 02 Mar 16 @ 11:59 am
Did not seem to work. Ideally this is done from plugin since that is what is controlling the variables so we have initially in c++ terms:

SendCommand ("deck 1 cue & deck 1 set 'cuebuttondown' while_pressed"); I have no clue if this is correct :)

Then during normal processing query the state of play and cuebuttondown

curbuttondown is always one using above logic.

So more to the story I am sure but what i don't know.
 

Posted Wed 02 Mar 16 @ 6:29 pm
I noticed before that the cue_play, cue, etc. toggle on and off at times but tracking that did not do any good. It would work sometimes and sometimes not.
 

Posted Wed 02 Mar 16 @ 7:01 pm
SBDJPRO Infinity Member since 2006
You can't use while_pressed from SendCommand since there is no up/down state. You would emulate this using your own state variables.

You wouldn't be controlling the cue action from your plugin though (which is what you're doing with the command deck 1 cue), you'd be controlling it from the mapper and/or skin. It would be useless otherwise.
 

Posted Wed 02 Mar 16 @ 8:43 pm
Perhaps it was my mistake
On controller and skin the action used for cue button could be
PhantomDeejay wrote :

cue & set 'cuebuttondown' while_pressed

And now on your plug-in you could do a query like this

PhantomDeejay wrote :

play ? var 'cuebuttondown' ? deck is previewing cue : deck is playing normally : deck is paused

A more "complete" code would be:

play ? var 'cuebuttondown' ? deck is previewing cue : deck is playing normally : cue ? deck is cued (paused on a cue-point) : deck is paused

 

Posted Wed 02 Mar 16 @ 9:51 pm
Ok thanks... We will see if that line of reasoning can work.

Also sort of a minor detail is, can skins setup and restore a user setting? This is easy of course on plugin side to do but I have been curious why no states are saved for a skin. Like my volume control etc. So assuming you could save and restore from a skin, I had recommended to Jamey that he set an initial value for some variable and it appears that may not be available for saving and restoring for a skin. Is that correct? I can do this from plugin side but curious about it from skin side.
 

Posted Thu 03 Mar 16 @ 10:06 am
deleted

 

Posted Thu 03 Mar 16 @ 10:07 am
Yes, user can strore variables from skin that are saved among sessions.
All you need to do is add a "@" in the beginning of the variable's name.

However please note that in order to set master volume on a different level you need to query the variable and then set the volume on skin's init
Also another thing to consider is that some controllers send their position data on init on the software and thus they change the default values.
This behavior will override your setting.

In other words:
You store a variable '@$MyMasterVolume' 0.75
On skin's init you use this code: get_var '@$MyMasterVolume' & master_volume

This will set master volume at 75%

However if the user connects a controller that sends his master volume knob data on VirtualDj, the value you set on skin init will be overridden by the controllers position.
 

Posted Thu 03 Mar 16 @ 12:06 pm
Ok cool, was just using volume as an example. I am not doing the real skin by the way but I have a skin that I am using for testing. So we would have initially some undeclared global variable such as @$somevariable In the skins oninit somevariable would be read and range checked. Valid values are in the range of about .06 to 1. If previously undeclared it would be zero and some default would be set such as .12 which should all work out well.
 

Posted Thu 03 Mar 16 @ 12:29 pm
Variables can have ANY number stored in them.
An undeclared variable (not stored e.t.c.) is always 0

So, a "stored" variable could be 1, 23, 0.56 , -19 e.t.c. And it could be even 0

I don't know exactly what you're after for, but working with variables to store "user settings" is pretty much straight forward.

Let's say that you want to save whether or not video was active when user shut down VirtualDj and restore the video state when user starts the software.

You would store a global persistent variable called '@$VideoWindow'
In order to save the state you have two options:
1) Save the state when you open/close the video from the skin. This means that you must alter the action on master video window from "video" to "video & video ? set '@$VideoWindow' 1 : set '@$VideoWindow' 0"
2) Use the <ONEXIT /> element of skin, keyboard or any controller mapping. In this case you just query the state of video window and store the value "video ? set '@$VideoWindow' 1 : set '@$VideoWindow' 0"

When VirtualDj starts you simply query the value and decide to start or not the video window: var_equal '@$VideoWindow' 1 ? video on : nothing

It is not necessary to use "1" for on if you wish (depending on what you want to do)

You could also use this code with the same results:
video ? set '@$VideoWindow' 5 : set '@$VideoWindow' 0
var_equal '@$VideoWindow' 5 ? video on : nothing

Or you could even go the other way round:
You could also use this code with the same results:
video ? set '@$VideoWindow' 5 : set '@$VideoWindow' 0
var_equal '@$VideoWindow' 0 ? nothing : video on

The last example uses another perspective. If the stored value is 0 it won't do anything (it won't start the video). On all other cases it will start the video Window. This means that you can use the '@$VideoWindow' variable to store other "states"/things as well
 

Posted Fri 04 Mar 16 @ 11:29 am
It's looking gorgeous! Thanks to you all.
 

Posted Fri 04 Mar 16 @ 8:14 pm


(Old topics and forums are automatically closed)