快速登录:  

Forum: VirtualDJ Skins

话题: For a searched file, how can I navigate to it in the browser
nilaymkPRO InfinityMember since 2019
I am trying to implement a widget such that when I search a song and select it, I want to navigate to its containing folder AND have that song selected in that folder.

So far I have:
- a custom `textzone`

<textzone class="textzone" fontsize="14" x="+470" y="+0" height="25" width="650" align="left" weight="bold" tooltip="`get_browsed_filepath`" textaction="get_browsed_filepath" action="browser_gotofolder"/>


- When I search a song and I select it in the browser, the textzone will show its full path with `get_browsed_filepath`.
- When clicked, it will go to the containing folder with `browser_gotofolder`.

Issue:
- This will go to the folder (yay!), but then select the first file in that folder (boo!).

What I want:
- Some way to navigate to that folder and select the file that I originially got with `get_browsed_filepath`.
- In other words I want to implement `browsed_file_reveal` but in VDJ browser instead of explorer.

Quesion:
How do I do this?

cheers Nilay
 

发表时间 Tue 26 Mar 24 @ 11:55 pm
locoDogPRO InfinityModeratorMember since 2013
save something from the file as a string variable then use a rsi to loop thru the tracks, testing; saved thing against info from current thing.
 

发表时间 Wed 27 Mar 24 @ 12:10 am
nilaymkPRO InfinityMember since 2019
hey @locodog

Thanks for the tip. Here's what I did:


<textzone class="textzone" fontsize="14" x="+470" y="+0" height="25" width="650" align="left" weight="bold" tooltip="Go to: `get_browsed_filepath`" textaction="get_browsed_filepath"
action="repeat_stop 'find_file' & set_var '$current_file_path' `get_browsed_filepath` & browser_gotofolder & browser_window 'songs' & repeat_start_instant 'go_to_top' 0.1ms & browser_scroll 'top' ? repeat_stop 'go_to_top' & repeat_start_instant 'find_file' 0.1 & var_equal '$current_file_path' `get_browsed_filepath` ? repeat_stop 'find_file' : browser_scroll +1 : browser_scroll 'top'"
/>


Seems to work as intended ok BUT:
- It's a bit slow (and visually ugly) as the GUI gets updated and each browser_scroll +1 the browser_gotofolder & browser_scroll 'top' doesn't work (possible a bug in VDJ) if the "browsed song" in the search is in the currently "browsed_folder". The only way I could get it to work is to use an rsi (see `go_to_top` rsi) that keeps retrying browser_scroll 'top'


This would be a nice feature if this was somehow natively available in VDJ with a single verb browser_gotofile
 

发表时间 Wed 27 Mar 24 @ 8:35 pm
locoDogPRO InfinityModeratorMember since 2013
A few things
1 rsi's are speed limited to about 30ms, they don't run any faster even if you use a lower time
2 browser_gotofolder will take some amount of time to get there, usually a wait 100ms is enough, [browser is its own engine]
3 you could speed it up by expanding
 : browser_scroll +1 : 


to repeat the earlier query, 10 times, 20 times, not pretty code but who's looking?
 : browser_scroll +1 & var_equal '$current_file_path' `get_browsed_filepath` ? repeat_stop 'find_file' : browser_scroll +1 & AGAIN AND AGAIN : 


For a personal skin there is a trick you can use with multibutton or using a virtualFX for "zero time repeats" [button pushes itself if it hasn't found what it wants]
the skin engine doesn't like these running more than ~1000 times [about 1300ish last time I checked] it makes the skin think it's in an unresolvable loop so it crashes.
I've used them without problem [added a counter and on repeat 1000 just let it rest 50ms]
 

发表时间 Wed 27 Mar 24 @ 9:08 pm
nilaymkPRO InfinityMember since 2019
Cheers @locodog...

- putting the 100ms wait after browser_gotofolder helped and now it's very reliable
- repeating browser_scroll + 1 & ... for few times really made it fast (and code ugly :-) )

here it is:

action="repeat_stop 'find_file' & repeat_stop 'go_to_top' & set_var '$current_file_path' `get_browsed_filepath` & browser_gotofolder & wait 100ms & browser_window 'songs' & repeat_start_instant 'go_to_top' 1ms & browser_scroll 'top' ? repeat_stop 'go_to_top' & repeat_start_instant 'find_file' 1ms & var_equal '$current_file_path' `get_browsed_filepath` ? repeat_stop 'find_file' : browser_scroll +1 & var_equal '$current_file_path' `get_browsed_filepath` ? repeat_stop 'find_file' : browser_scroll +1 & var_equal '$current_file_path' `get_browsed_filepath` ? repeat_stop 'find_file' : browser_scroll +1 & var_equal '$current_file_path' `get_browsed_filepath` ? repeat_stop 'find_file' : browser_scroll +1 & var_equal '$current_file_path' `get_browsed_filepath` ? repeat_stop 'find_file' : browser_scroll +1 & var_equal '$current_file_path' `get_browsed_filepath` ? repeat_stop 'find_file' : browser_scroll +1 : browser_scroll 'top'"


- I'm too lazy to do the button trick otherwise I'll spend more time scripting than mixing :-P.

thanks a ton for all the help.
 

发表时间 Thu 28 Mar 24 @ 12:12 am