登录:     


Forum: VirtualDJ Technical Support

Topic: Mapping question

由于该帖子已年深日久,可能包含陈旧过时或描述错误的信息。

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 :)
 

发表时间 Mon 26 Feb 18 @ 8:41 am
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 )
 

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.
 

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
 

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.

 

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
 



(陈旧帖子或论坛版块会自动关闭)