Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: WSH Panel Mod script discussion/help (Read 1387298 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

WSH Panel Mod script discussion/help

Reply #2900
In your autoplaylists WSH panel mod, is it possible to "SORT DESCENDING BY"


i assume you're talking about either my last.fm similar artists or last.fm charts script? right click the panel>configure and replace this function right at the end...

Code: [Select]
function on_mouse_lbtn_up(x, y) {
    li.lbtn_up(x, y);
}


with

Code: [Select]
function on_mouse_lbtn_up(x, y) {
    if (li.lastfm_link == "autoplaylist" && li.in_range && x > li.x + li.text_x && x < li.x + li.text_x + Math.min(li.names_widths[li.index], li.text_width)) {
        fb.CreateAutoPlaylist(fb.PlaylistCount, li.names[li.index], li.queries[li.index] + " SORT DESCENDING BY %date%");
        fb.ActivePlaylist = fb.PlaylistCount - 1;
    } else {
        li.lbtn_up(x, y);
    }
}


@colagen, i don't know of any WSH script. facets and/or esplaylist can display your library in a grid view showing all covers. obviously you don't have much control over appearance. you can enable/disable/customise text and that's about it.

WSH Panel Mod script discussion/help

Reply #2901
Quote
i assume you're talking about either my last.fm similar artists or last.fm charts script? right click the panel>configure and replace this function right at the end...


Nope marc2003, I talk about your autoplaylists script this one :



Is it possible to sort descending by with this script ?

WSH Panel Mod script discussion/help

Reply #2902
you must be joking? 

you set that yourself when you create the query. also, you can edit existing queries. check the icon tooltips when you hover you mouse over the panel.

make sure you edit the main query, not the sort pattern. the sort pattern dialog only accepts standard title formatting, not the query syntax.

WSH Panel Mod script discussion/help

Reply #2903
Hello guys, got a question here.

I'm trying to implement AutoDJ/iTunesDJ button for my layout and I've gotten this far:
with Random pools plugin I made a playlist that's automatically being filled up with tracks depends on few priority rules (excluding some genres, considering rating etc.), then with Playlist Attributes I modify playback order of this particular playlist and remove played tracks to keep it nice and clean.

So at this point what I want is to create a button that would select this "Auto DJ" playlist and start playback.

I tried to make such a button with PSS script,
Code: [Select]
$textbutton(0,$sub(%_height%,15),%_width%,18,AutoDJ,AutoDJ,COMMAND:View/Switch to playlist/Auto DJ,fontcolor:250-250-250,fontcolor:170-220-255)

but it didn't work, so can somebody please assist me with creating WSH panel with button like this?

Thinking about that again... It would also be really cool if that button could remove all the tracks from that playlist except the last one (before starting playback). Is that even possible?

EDIT: oh yes, this is what I've done so far:
Code: [Select]
function on_mouse_lbtn_down(){
    if(DJButton.Down()){
        var pl_dj;
        for (var i = 0; i < plman.PlaylistCount; i++) {
            if (plman.GetPlaylistName(i) == "Auto DJ") {
                //return i;
                pl_dj = i
            }
        }
        fb.ActivePlaylist = pl_dj;
    }
}

So it selects this playlist, but how do I focus (lets say last item) from this playlist and start playback?

WSH Panel Mod script discussion/help

Reply #2904
Code: [Select]
var items = plman.GetPlaylistItems(plman.ActivePlaylist);
plman.ExecutePlaylistDefaultAction(plman.ActivePlaylist, items.count - 1);

WSH Panel Mod script discussion/help

Reply #2905
Code: [Select]
var items = plman.GetPlaylistItems(plman.ActivePlaylist);
plman.ExecutePlaylistDefaultAction(plman.ActivePlaylist, items.count - 1);

Great, thanks, man, playback works!

And the other part of my question concerning removing tracks from the playlist... here's what I did:
Code: [Select]
    if(DJButton.Down()){
        var pl_dj;
        
        for (var i = 0; i < plman.PlaylistCount; i++) {
            if (plman.GetPlaylistName(i) == "Auto DJ") {
                pl_dj = i;
                break;
            }
        }
        plman.ActivePlaylist = pl_dj;
        var items = plman.GetPlaylistItems(plman.ActivePlaylist);
        plman.ExecutePlaylistDefaultAction(plman.ActivePlaylist, items.count - 1);

        //var itc = fb.PlaylistItemCount(plman.ActivePlaylist)
        for (var i = 0; i < items.count; i++) {
            if (i < (items.count - 10)) {
                plman.SetPlaylistSelectionSingle(plman.ActivePlaylist, i, 1);
                plman.RemovePlaylistSelection(plman.ActivePlaylist);
                }
        }
    }
}

aaand it somewhat works, but the playback doesn't _always_ start, when i have some items selected from this playlist it removes more than it's required and doesn't start the playback.

There must be a better and more efficient way of doing this, that's what I tried:
Code: [Select]
        var pl_dj;
        
        for (var i = 0; i < plman.PlaylistCount; i++) {
            if (plman.GetPlaylistName(i) == "Auto DJ") {
                pl_dj = i;
                break;
            }
        }
        plman.ActivePlaylist = pl_dj;
        var items = plman.GetPlaylistItems(plman.ActivePlaylist);
        plman.ExecutePlaylistDefaultAction(plman.ActivePlaylist, items.count - 1);

        var tracks = new Array()
        for (var i = 0; i < items.count; i++) {
            tracks.push(items.item(i));
        }
        for (var i = 0; i < (tracks.length - 10); i++) {
            plman.SetPlaylistSelection(plman.PlaylingPlaylist, tracks[i], 1)
            plman.RemovePlaylistSelection(plman.PlaylingPlaylist);
        }
        tracks.length = 0;
    }
}

aaaand it didn't work :/ (Invalid procedure call or argument Ln: 83, Col: 13 [plman.SetPlaylistSelection(plman.PlaylingPlaylist, tracks, 1) <-- this line] )
So what's the proper way of doing this ?

Once again, sorry for my lack of JS knowledge, it's been quite a while since I've done any coding, not to mention I've never touched JS...

WSH Panel Mod script discussion/help

Reply #2906
@colagen, i don't know of any WSH script. facets and/or esplaylist can display your library in a grid view showing all covers. obviously you don't have much control over appearance. you can enable/disable/customise text and that's about it.


I did something finally today, it's quite a harsh edit of the coverflow script, the scrollbar behave a little bit oddly now, and some features won't work anymore, i did this only for myself so i won't go further
But if someone here want a basic cover browser and isn't afraid of bugs, the code is here. Personally i use it with a column UI "genre" filter on the left, it's quite eye candy

WSH Panel Mod script discussion/help

Reply #2907
plman.PlaylingPlaylist


Playling should be Playing. there was typo in the file interface.api (inside the component folder) which provides auto-completion in the editor. the latest version of the component doesn't have this problem.

also, i'd use this to play the last track and remove everything else....

Code: [Select]
var items = plman.GetPlaylistItems(plman.ActivePlaylist);
plman.ExecutePlaylistDefaultAction(plman.ActivePlaylist, items.count - 1);
plman.ClearPlaylistSelection(plman.ActivePlaylist);
plman.SetPlaylistSelectionSingle(plman.ActivePlaylist, items.count -1, true);
plman.SetActivePlaylistContext();
fb.RunMainMenuCommand("Edit/Selection/Crop");

WSH Panel Mod script discussion/help

Reply #2908
But if someone here want a basic cover browser and isn't afraid of bugs, the code is here. Personally i use it with a column UI "genre" filter on the left, it's quite eye candy


for something with such a simple appearance, you might as well use EsPlaylist. you can have it bound to a playlist but i prefer to have it display my library.


WSH Panel Mod script discussion/help

Reply #2909
for something with such a simple appearance, you might as well use EsPlaylist. you can have it bound to a playlist but i prefer to have it display my library.


Yes, i've saw that, but i'm more confortable with WSH than the pseudo-code of esplaylist, and wsh allow me to have exactly the behaviour or the options i want, (well, at the expense of the time spent to code them myself)
i'll probably edit this script later to browse by artist by default, and by albums of the selected artist when i'll click on an artist or something like that ...

WSH Panel Mod script discussion/help

Reply #2910
plman.PlaylingPlaylist


Playling should be Playing. there was typo in the file interface.api (inside the component folder) which provides auto-completion in the editor. the latest version of the component doesn't have this problem.

also, i'd use this to play the last track and remove everything else....

Code: [Select]
var items = plman.GetPlaylistItems(plman.ActivePlaylist);
plman.ExecutePlaylistDefaultAction(plman.ActivePlaylist, items.count - 1);
plman.ClearPlaylistSelection(plman.ActivePlaylist);
plman.SetPlaylistSelectionSingle(plman.ActivePlaylist, items.count -1, true);
plman.SetActivePlaylistContext();
fb.RunMainMenuCommand("Edit/Selection/Crop");


woah thanks for a quick reply, that works much better! 

It was pretty much last thing I needed to 'complete' my layout (yeah right...)

WSH Panel Mod script discussion/help

Reply #2911
Marc, this is great, i tested plugin foo_youtube.dll with your thumbs, and it can display ''artist image'' and ''bio text'' if i use my ''google mode', and enter %title% in artist format.
There's no need to have taged files at all, for me this is great..

My question, is it possible to set, that your script first look in %artist% if not find, then to look in %title%. Something like: %artist% | %title% etc..

WSH Panel Mod script discussion/help

Reply #2912
no. my scripts only use sources where a single artist is required. supplying anything else isn't going to retun any results. the fact you've modded yours with a "google mode" means you're on your own if you want to change it.

WSH Panel Mod script discussion/help

Reply #2913
no. my scripts only use sources where a single artist is required. supplying anything else isn't going to retun any results. the fact you've modded yours with a "google mode" means you're on your own if you want to change it.


I was thinking if it support foobar title formatting, and it works.
I use this: $if(%artist%,%artist%,%title%)
Thanks..


WSH Panel Mod script discussion/help

Reply #2915
I can not find any information on how to properly use plman.InsertPlaylistItems(playlistIndex, base, handles[, select])

Can someone give me an example how to use it (lets say I want to add currently selected or playing track to the specific playlist)?

Code: [Select]
        if (items.count < 1) {
            var handles = fb.GetSelections(0);
            plman.InsertPlaylistItems(pl_dj, 0, handles);
        }




WSH Panel Mod script discussion/help

Reply #2916
this code on it's own works for me.

Code: [Select]
selection = fb.GetSelections(0);
plman.InsertPlaylistItems(plman.ActivePlaylist, 0, selection);


this is testing the active playlist but if you're using a different one, you may want to switch focus to it so you can see your results. also remember that using 0 as the base will put the selection at the start of the playlist. use plman.PlaylistItemCount(idx) if you want to append to the end.

WSH Panel Mod script discussion/help

Reply #2917
Switching focus did the trick for me, thanks again marc.

Getting InsertPlaylistItems to work finally helped me making a button to queue tracks not to the playback queue list but rather to PlayingPlaylist, which is what I'm used to with other players like MediaMonkey & MusicBee! <3

WSH Panel Mod script discussion/help

Reply #2918
Anyone knows how to merge the thumbs script and last.fm/wikipedia script from marc2003? Together it will look pretty nice I think. Thanks!

WSH Panel Mod script discussion/help

Reply #2919
Welp, not needed anymore. I found out I can add vertical splitters

It works pretty nice now, thanks for the scripts marc2003!



The only annoying thing is the little white bar on top of the picture. Any idea what that is?
Seems to be the seperator of the vertical splitter, any way to remove that?

WSH Panel Mod script discussion/help

Reply #2920
And I got the white line fixed by using a stack splitter. Thanks to tedgo for the tip


WSH Panel Mod script discussion/help

Reply #2921
use panel stack splitter instead. you must already be using it already because there are no visible borders around the other edges.

edit: what timing. 

WSH Panel Mod script discussion/help

Reply #2922
use panel stack splitter instead. you must already be using it already because there are no visible borders around the other edges.

edit: what timing. 




Btw, the DarkOne (v3) theme uses a pretty nice faded transition for front cover/back cover etc. It gives it a nice smooth effect. Do you think you can apply that to the thumbnail.txt?

I think the code is in here: http://pastebin.com/4qr9wZZF

 

WSH Panel Mod script discussion/help

Reply #2923
Hi marc need your help my prince! A friend using the now playing script says he isn't getting images? The console reads

WSH Panel Mod: Warning: Could not load file C:\Users\Penfold\AppData\Roaming\foobar2000\user-components\foo_uie_wsh_panel_mod\jscript.api

WSH Panel Mod script discussion/help

Reply #2924
that missing file doesn't affect functionality - all it does is provide auto-complete when typing in the editor dialog. but here is how to install components properly so you won't see that error: http://wiki.hydrogenaudio.org/index.php?ti...all_a_component

as for the now playing script not downloading, check the console for errors? check the right click menu options because automatic downloads are off on fresh installs. i've done this because it's so slow now. also, browse the last.fm site to make sure there are images for that artist.