IPB

Welcome Guest ( Log In | Register )

120 Pages V  « < 115 116 117 118 119 > »   
Reply to this topicStart new topic
WSH Panel Mod script discussion/help.
marc2003
post Jan 24 2014, 08:19
Post #2901





Group: Members
Posts: 4326
Joined: 27-January 05
From: England
Member No.: 19379



QUOTE (jahtimes @ Jan 22 2014, 19:44) *
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
function on_mouse_lbtn_up(x, y) {
    li.lbtn_up(x, y);
}


with

CODE
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.
Go to the top of the page
+Quote Post
jahtimes
post Jan 24 2014, 10:33
Post #2902





Group: Members
Posts: 23
Joined: 24-March 11
Member No.: 89275



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 ?
Go to the top of the page
+Quote Post
marc2003
post Jan 24 2014, 10:39
Post #2903





Group: Members
Posts: 4326
Joined: 27-January 05
From: England
Member No.: 19379



you must be joking? rolleyes.gif

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.

This post has been edited by marc2003: Jan 24 2014, 10:41
Go to the top of the page
+Quote Post
Strigoy
post Jan 24 2014, 11:19
Post #2904





Group: Members
Posts: 5
Joined: 24-January 14
Member No.: 114186



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
$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
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?

This post has been edited by Strigoy: Jan 24 2014, 12:11
Go to the top of the page
+Quote Post
marc2003
post Jan 24 2014, 16:48
Post #2905





Group: Members
Posts: 4326
Joined: 27-January 05
From: England
Member No.: 19379



CODE
var items = plman.GetPlaylistItems(plman.ActivePlaylist);
plman.ExecutePlaylistDefaultAction(plman.ActivePlaylist, items.count - 1);


This post has been edited by marc2003: Jan 24 2014, 16:48
Go to the top of the page
+Quote Post
Strigoy
post Jan 24 2014, 22:16
Post #2906





Group: Members
Posts: 5
Joined: 24-January 14
Member No.: 114186



QUOTE (marc2003 @ Jan 24 2014, 16:48) *
CODE
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
    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
        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[i], 1) <-- this line] )
So what's the proper way of doing this ? smile.gif

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...

This post has been edited by Strigoy: Jan 24 2014, 22:42
Go to the top of the page
+Quote Post
colagen
post Jan 24 2014, 22:37
Post #2907





Group: Members
Posts: 18
Joined: 2-December 11
Member No.: 95540



QUOTE (marc2003 @ Jan 24 2014, 09:19) *
@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
Go to the top of the page
+Quote Post
marc2003
post Jan 25 2014, 02:17
Post #2908





Group: Members
Posts: 4326
Joined: 27-January 05
From: England
Member No.: 19379



QUOTE (Strigoy @ Jan 24 2014, 21:16) *
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
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");
Go to the top of the page
+Quote Post
marc2003
post Jan 25 2014, 02:53
Post #2909





Group: Members
Posts: 4326
Joined: 27-January 05
From: England
Member No.: 19379



QUOTE (colagen @ Jan 24 2014, 21:37) *
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.



This post has been edited by marc2003: Jan 25 2014, 02:55
Go to the top of the page
+Quote Post
colagen
post Jan 25 2014, 10:14
Post #2910





Group: Members
Posts: 18
Joined: 2-December 11
Member No.: 95540



QUOTE (marc2003 @ Jan 25 2014, 03:53) *
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 ...
Go to the top of the page
+Quote Post
Strigoy
post Jan 26 2014, 03:19
Post #2911





Group: Members
Posts: 5
Joined: 24-January 14
Member No.: 114186



QUOTE (marc2003 @ Jan 25 2014, 03:17) *
QUOTE (Strigoy @ Jan 24 2014, 21:16) *
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
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! rolleyes.gif

It was pretty much last thing I needed to 'complete' my layout (yeah right...) biggrin.gif
Go to the top of the page
+Quote Post
mire777
post Jan 26 2014, 10:41
Post #2912





Group: Members
Posts: 246
Joined: 9-June 12
Member No.: 100550



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..

This post has been edited by mire777: Jan 26 2014, 10:42
Go to the top of the page
+Quote Post
marc2003
post Jan 26 2014, 11:23
Post #2913





Group: Members
Posts: 4326
Joined: 27-January 05
From: England
Member No.: 19379



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.

This post has been edited by marc2003: Jan 26 2014, 11:24
Go to the top of the page
+Quote Post
mire777
post Jan 26 2014, 12:20
Post #2914





Group: Members
Posts: 246
Joined: 9-June 12
Member No.: 100550



QUOTE (marc2003 @ Jan 26 2014, 12:23) *
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..
Go to the top of the page
+Quote Post
mire777
post Jan 30 2014, 10:56
Post #2915





Group: Members
Posts: 246
Joined: 9-June 12
Member No.: 100550



Is last.fm remove artist images or what?
This is not first time to see this..

http://www.last.fm/music/2Pac/+images
Go to the top of the page
+Quote Post
Strigoy
post Jan 30 2014, 14:43
Post #2916





Group: Members
Posts: 5
Joined: 24-January 14
Member No.: 114186



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
        if (items.count < 1) {
            var handles = fb.GetSelections(0);
            plman.InsertPlaylistItems(pl_dj, 0, handles);
        }



Go to the top of the page
+Quote Post
marc2003
post Jan 30 2014, 18:30
Post #2917





Group: Members
Posts: 4326
Joined: 27-January 05
From: England
Member No.: 19379



this code on it's own works for me.

CODE
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.
Go to the top of the page
+Quote Post
Strigoy
post Feb 1 2014, 14:43
Post #2918





Group: Members
Posts: 5
Joined: 24-January 14
Member No.: 114186



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
Go to the top of the page
+Quote Post
Devrim
post Feb 13 2014, 04:07
Post #2919





Group: Members
Posts: 5
Joined: 21-May 08
Member No.: 53696



Anyone knows how to merge the thumbs script and last.fm/wikipedia script from marc2003? Together it will look pretty nice I think. Thanks!
Go to the top of the page
+Quote Post
Devrim
post Feb 13 2014, 04:53
Post #2920





Group: Members
Posts: 5
Joined: 21-May 08
Member No.: 53696



Welp, not needed anymore. I found out I can add vertical splitters biggrin.gif

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?

This post has been edited by Devrim: Feb 13 2014, 05:17
Go to the top of the page
+Quote Post
Devrim
post Feb 13 2014, 10:26
Post #2921





Group: Members
Posts: 5
Joined: 21-May 08
Member No.: 53696



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

Go to the top of the page
+Quote Post
marc2003
post Feb 13 2014, 10:27
Post #2922





Group: Members
Posts: 4326
Joined: 27-January 05
From: England
Member No.: 19379



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. tongue.gif

This post has been edited by marc2003: Feb 13 2014, 10:28
Go to the top of the page
+Quote Post
Devrim
post Feb 13 2014, 10:33
Post #2923





Group: Members
Posts: 5
Joined: 21-May 08
Member No.: 53696



QUOTE (marc2003 @ Feb 13 2014, 03:27) *
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. tongue.gif


biggrin.gif

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
Go to the top of the page
+Quote Post
Bratman
post Feb 14 2014, 04:34
Post #2924





Group: Members
Posts: 94
Joined: 30-June 12
From: England
Member No.: 101088



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

This post has been edited by Bratman: Feb 14 2014, 04:35
Go to the top of the page
+Quote Post
marc2003
post Feb 14 2014, 05:58
Post #2925





Group: Members
Posts: 4326
Joined: 27-January 05
From: England
Member No.: 19379



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.
Go to the top of the page
+Quote Post

120 Pages V  « < 115 116 117 118 119 > » 
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 19th April 2014 - 15:48