Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: Can sort order be saved PER playlist?
seanPRO InfinityMember since 2018
This post is part question part solution. I like to sort some of my playlists by BPM and some manually (Order column). If I enable keepSortOrder the selected sort order applies to ALL playlists. Its annoying because as I switch between these playlist I have manually select to sort by BPM or Order. It doesn't appear to be possible to keep the sort order on a per playlist basis?

I considered witting a script which checked the name of the playlist as I scroll through them and run browser_sort. But it doesn't appear possible to get the name of the currently selected playlist?

I do have one manual work around, if you create a new playlist and copy the content of a sorted playlist to it the "Order" column now matches the sorted playlist. Then you manually keep the playlist sorted when you add new tracks.

I've automated part of this with the following script, it basically copies the current playlist to the sideview where it orders it by bpm, you still have to copy the songs from the sideview back to the playlist as I couldn't figure out a way to automate that:
playlist_load & wait 100ms & show_splitpanel 'sideview' 50% & browser_window 'automix' & sideview_sort "bpm" & browser_window 'songs' & repeat_start_instant 'removeSong' 1ms `file_count` & browser_remove

Please be careful running this it does run browser_remove.
 

Posted Sun 17 Sep 23 @ 7:38 pm
locoDogPRO InfinityModeratorMember since 2013
get_browsed_folder returns the name of the thing pointed at in the folder tree

I figure folder properties [right click the folder] could have primary & secondary sorting saved there, but currently it doesn't.
 

Posted Sun 17 Sep 23 @ 8:04 pm
seanPRO InfinityMember since 2018
Oh I totally missed all the get_browsed_* verbs, thanks for pointing those out.

Here's a solution, put this script on your browse knob, rename your playlists so they contain the text (s) for example "House Bangers (s)" and this script will order those playlists by BPM:

browser_scroll &
browser_window "folders" ?
param_contains "(s)" `get_browsed_folder` ?
wait 1ms & browser_sort "+bpm" :
wait 1ms & browser_sort "+order"


I had to add wait 1ms to this, it works on my computer but if your system is slower you might have to increase this number.

I wish there was a way to make this work when you clicked on a playlists with your mouse? I haven't done much with themes yet so don't know if this would be possible.
 

Posted Mon 18 Sep 23 @ 7:26 am
locoDogPRO InfinityModeratorMember since 2013
wait or repeat_start scripts don't go that fast, about 30ms is the limit for the script engine, anything less is just saying "when the script engine is next available"
so 1ms does no harm, just don't plan anything time critical with it.

As for clicked on question, I don't think there's anything like "click on this in browser - then action happens"
that sort of thing would be the job of a repeat_start script [like a separate thread] always running in the background.

I did a post on rs & rsi scripts in repeat_start, repeat_start_instant, repeat_stop

I'm just writing something else up on a different topic, I've give you an example to get you started if you need it later today.
 

Posted Mon 18 Sep 23 @ 7:48 am
locoDogPRO InfinityModeratorMember since 2013
deck master repeat_start rsMySorter ? repeat_stop rsMySorter : set_var $lastFolder "" & repeat_start rsMySorter 100ms -1 & browser_window folders ? param_equal `get_var $lastFolder` `get_browsed_folder` ? SORTED ALREADY : 
param_contains "m3u" `get_browsed_folder_path` ? set $lastFolder `get_browsed_folder` & param_equal "myPlayist1" `get_var $lastFolder` ? YOUR DESIRED SORT OPTIONS FOR THIS M3U : param_equal "myPlayist2" `get_var $lastFolder` ? YOUR DESIRED SORT OPTIONS FOR THIS M3U : NOT A SPECIFIED M3U : NOT A M3U : NOT IN FOLDER TREE


Something like that
 

Posted Mon 18 Sep 23 @ 9:27 am
seanPRO InfinityMember since 2018
Your a legend thanks a heap.

Using your example I came up with the following which I've placed on my Keyboards ONINIT... are there any obvious flaws with this, I just noticed my implementation is a little different to yours where you use deck master and then stop the repeater.

repeat_start rsAutoSort 30ms &
browser_window 'folders' ?
param_equal `get_var $lastFolder` `get_browsed_folder` ?
nothing :
set_var $lastFolder `get_browsed_folder` &
param_contains "(s)" `get_browsed_folder` ?
browser_sort "+bpm" :
browser_sort "+order"
 

Posted Mon 18 Sep 23 @ 11:01 am
locoDogPRO InfinityModeratorMember since 2013
no all good, I always deliver these type of scripts for a custom button so you can test, turn on|off, & iterate easier, so I have the button logic and use deck master so any side custom button with do the toggle

I'd probably drop the rs speed to 100-150ms, ...30 ms... do you really need to act in 1/5th of a blink?
 

Posted Mon 18 Sep 23 @ 11:22 am