Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: Mapping question

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

PachNPRO InfinityMember since 2009
I tried this, but realized browsed_file_color is only a setter.

browsed_file_color 'red' ? browsed_file_color 'reset' : browsed_file_color 'red'

Then I tried different approaches of something like this:

get_browsed_color 'red' ? browsed_file_color 'reset' : browsed_file_color 'red'
get_browsed_color & param_equal 'red' ? browsed_file_color 'reset' : browsed_file_color 'red'
get_browsed_color param_equal 'red' ? browsed_file_color 'reset' : browsed_file_color 'red'
param_equal get_browsed_color 'red' ? browsed_file_color 'reset' : browsed_file_color 'red'

None of this worked, soooo... help please :)
 

Posted Mon 26 Feb 18 @ 8:41 am
djdadPRO InfinityDevelopment ManagerMember since 2005
param_equal "`get_browsed_color`" "red" ? this : that

There is a similar example in the param_equal action description (how to use actions with param_ actions )
 

Posted Mon 26 Feb 18 @ 9:19 am
PachNPRO InfinityMember since 2009
Thanks for you response.
I saw that example, but unless I'm doing something else wrong, this won't work for me.

That is the action I believe should work. Setting the color does work, resetting does not:
param_equal "`get_browsed_color`" "red" ? browsed_file_color "reset" : browsed_file_color "red"


I also tried it with ' instead of ` but that didn't work either.
 

Posted Mon 26 Feb 18 @ 10:03 am
It works fine here:

<item text="Clear" action="browsed_file_color 'reset'" check="param_equal '`browsed_file_color`' 'transparent'"/>

notice that the action is
browsed_file_color 'reset'

and the query is
param_equal '`browsed_file_color`' 'transparent'

So, most likely you want to map your button to something like this:

param_equal '`browsed_file_color`' 'red' ? browsed_file_color 'reset' : browsed_file_color 'red'

PS: As you can see I'm NOT using get_browsed_color for the query
 

Posted Mon 26 Feb 18 @ 12:04 pm
PachNPRO InfinityMember since 2009
Okay, got it... Thank you.

It indeed has to be

param_equal '`browsed_file_color`' 'red' ? browsed_file_color 'reset' : browsed_file_color 'red'

and not

param_equal '`get_browsed_color`' 'red' ? browsed_file_color 'reset' : browsed_file_color 'red'

But that opens up another question for me: What is the return value of "get_browsed_color"? There is no description in the program and as I understand it, it returns a color.

 

Posted Mon 26 Feb 18 @ 12:14 pm
It returns the color, as color, not text.
Therefore you need to cast it into text before you're able to query it.
When you use it on a custom button as query the casting is done automatically. But when you use it inside a more complex script, you have to cast it to the correct format before you use it
 

Posted Mon 26 Feb 18 @ 12:37 pm


(Old topics and forums are automatically closed)