How to add textbutton for context menu command to sort playlist? |
![]() ![]() |
How to add textbutton for context menu command to sort playlist? |
Mar 11 2013, 03:15
Post
#1
|
|
![]() Group: Members Posts: 72 Joined: 30-June 12 From: England Member No.: 101088 |
I'm trying to link text buttons like Title | Album | Rating | etc so when clicked they sort by the field. I can't use COMMAND:Edit/Sort/Randomize or any other sort field because it simply does not work. Is there a way to do it by ELPlaylist, how can I make a command to link to the sort context menu there? Please see screenshot.
For example this code can be used to make a button to access the context menu "Quicksearch for same/Year $imagebutton($add($get(QS.button.left),74),$get(QS.button.top),15,15,$get_ps_global(image.path)'/icons/date_off.png',$get_ps_global(image.path)'/icons/date_on.png',CONTEXT:'Quicksearch for same/Year';REFRESH) But ELPlaylists context menu above the main one on right click doesn't seem to work?? TLDR: Does anyone know how to make a sort by column like in the screenhsot work? It would make foobar2000 so much better and intuitive with large libraries.
This post has been edited by Bratman: Mar 11 2013, 03:49 |
|
|
|
Mar 11 2013, 10:49
Post
#2
|
|
![]() Group: Members Posts: 3265 Joined: 27-January 05 From: England Member No.: 19379 |
i think your button doesn't work because ELplaylist is a 3rd party component. PSS can only execute menu commands that are part of foobar itself.
|
|
|
|
Mar 11 2013, 23:32
Post
#3
|
|
![]() Group: Members Posts: 72 Joined: 30-June 12 From: England Member No.: 101088 |
i think your button doesn't work because ELplaylist is a 3rd party component. PSS can only execute menu commands that are part of foobar itself. That sucks big time, is there not some hack/cheat way to do it? Some sort component panel out there? Foobar should have a built in sort. |
|
|
|
Mar 12 2013, 00:15
Post
#4
|
|
![]() Group: Members Posts: 3265 Joined: 27-January 05 From: England Member No.: 19379 |
standard buttons (in default UI - not sure about columns) and keyboard shortcuts should be able to run the edit>sort commands but you have to make sure your playlist has focus first.
|
|
|
|
Mar 12 2013, 01:37
Post
#5
|
|
![]() Group: Members Posts: 72 Joined: 30-June 12 From: England Member No.: 101088 |
standard buttons (in default UI - not sure about columns) and keyboard shortcuts should be able to run the edit>sort commands but you have to make sure your playlist has focus first. Hmm that's not gonna work for me, it's annoying because facets has this feature and I think if CUI had it too then I wouldn't need to use DUI. I guess wsh panel mod is the only way to create this feature in columns ui? |
|
|
|
Mar 12 2013, 01:45
Post
#6
|
|
![]() Group: Members Posts: 3265 Joined: 27-January 05 From: England Member No.: 19379 |
yup, that'll do it.
|
|
|
|
Mar 12 2013, 01:52
Post
#7
|
|
![]() Group: Members Posts: 72 Joined: 30-June 12 From: England Member No.: 101088 |
So third party components can be accessed by wsh? Shame I don't have much experience of how to use it. Where would I start?
|
|
|
|
Mar 12 2013, 02:07
Post
#8
|
|
![]() Group: Members Posts: 3265 Joined: 27-January 05 From: England Member No.: 19379 |
you can't access the ELplaylist only context commands but it can run the edit>sort commands. it can do this because it can give the playlist focus - unlike PSS. i've only tested this in default UI but it should work in columns UI as well. just edit the image path and sort command.
sample script: CODE img = gdi.Image(fb.ProfilePath + "path\\to\\image.png"); function on_paint(gr) { gr.DrawImage(img, 0, 0, img.Width, img.Height, 0, 0,img.Width, img.Height); } function on_mouse_lbtn_up(x, y) { plman.SetActivePlaylistContext(); fb.RunMainMenuCommand("Edit/Sort/Reverse"); } if you want a "hover" image, i can change the code for that. This post has been edited by marc2003: Mar 12 2013, 02:08 |
|
|
|
Mar 12 2013, 03:37
Post
#9
|
|
![]() Group: Members Posts: 72 Joined: 30-June 12 From: England Member No.: 101088 |
Thanks marc! I get a crash with that code in columnsui, I entered the correct path img = gdi.Image(fb.ProfilePath + "images\\foonate\\sort.png");
Yes please that would be great I might use that, is there a way to do this with text? So clicking 'genre' will highlight the font? If not image is fine. Edit I found a way to do it using buttons, I forgot about these. I've set up text links under main menu command group with separators it works really well but the only problem is limited fields to sort by, anyway to add more fields like last added? This post has been edited by Bratman: Mar 12 2013, 03:59 |
|
|
|
Mar 12 2013, 08:55
Post
#10
|
|
![]() Group: Members Posts: 3265 Joined: 27-January 05 From: England Member No.: 19379 |
file>preferences>advanced>display>standard sort patterns.
name=sort pattern make sure it's separated from the previous entry by a ; |
|
|
|
Mar 12 2013, 17:24
Post
#11
|
|
![]() Group: Members Posts: 72 Joined: 30-June 12 From: England Member No.: 101088 |
Wow it worked! That is amazing thanks marc I looked there too but missed it, you're the only guy that has replied to my query and you've really helped me out. I have been wanting this for a long time after seeing facets. Now graphical browser and playlist can be sorted by most played and many other filters.
There is one more thing I can't get the sort fields to sort by ascending or descending when clicking most played or rated. This means all the top rated is at the bottom where you can't see it, is there anyway to reverse the sort like in the picture with five star at the top? file path=%path_sort%;artist=%artist%|%date%;album artist=%album artist%;album=%album%|%discnumber%|%tracknumber%;track number=%discnumber%|%tracknumber%;title=%title%;date=%date%;added=%added%;genre=%genre%;rating=%rating%;play count=%play_count%;last played=%last_played%|%date% Looking at that using %rating% GREATER 3 SORT DESCENDING BY %rating% doesn't work neither does SORT BY DESCENDING %rating% The default queries have | for example artist=%artist%|%date% does that mean it's sorting by artist first then date?
This post has been edited by Bratman: Mar 12 2013, 17:25 |
|
|
|
Mar 12 2013, 17:54
Post
#12
|
|
![]() Group: Members Posts: 3265 Joined: 27-January 05 From: England Member No.: 19379 |
query syntax won't work. you use that when querying the library/playlist usually via search dialogs.
you need to stick with standard title formatting when setting your sort patterns. reversing numbers is easy enough. CODE $sub(5,%rating%) QUOTE The default queries have | for example artist=%artist%|%date% does that mean it's sorting by artist first then date? yup. |
|
|
|
Mar 12 2013, 23:17
Post
#13
|
|
![]() Group: Members Posts: 72 Joined: 30-June 12 From: England Member No.: 101088 |
Awesome thanks again that worked. I didn't think of using the #sub code that's neat. So query syntax is for the whole library and standard formatting is for active playlists, I have both now I was going to remove the autoplaylists for most played, rated, last added etc but that does the whole library so it's still useful rather than having to select the entire library in filters.
I've settled on this so far. CODE length=%length%;file path=%path_sort%;artist=%artist%;album artist=%album artist%;album=%album%|%discnumber%|%tracknumber%;track number=%discnumber%|%tracknumber%;title=%title%;date=%date%;added=$sub(99999999999999,$replace(%added%,'-',,':',,' ',));rating=$sub(5,%rating%)|%album%;play count=$sub(999,%play_count%);last played=$sub(99999999999999,$replace(%last_played%,'-',,':',,' ',)) I don't think there is any other sort by fields I need, do you know any good ones? |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 20th May 2013 - 01:18 |