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 1396301 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

WSH Panel Mod script discussion/help

Reply #3700
Very helpful post
Thanks, I followed your instructions and it works. I will try to figure out some things myself and maybe post again if I can't work it out.

WSH Panel Mod script discussion/help

Reply #3701
Falstaff - Getting an overflow error. Hard to reproduce but here is what shows up in console.

Error: WSH Panel Mod (JSPlaylist v1.0.4 by Br3tt aka Falstaff >> http://br3tt.deviantart.com): Microsoft JScript runtime error: Overflow

File: C:\Users\***\Desktop\foobar2000\wsh_br3tt\jsplaylist\js\WSHheaderbar.js

Ln: 162, Col: 13


This happens often enough to make me think it needs looking into.

WSH Panel Mod script discussion/help

Reply #3702
prompt me how to add a menu option:
Save All Playlists?

just save one selected playlist is clear: fb.SavePlaylist ();

In the "Playlist switcher" there is an option "Save All as...".
as add to my "wsh script", menu option "Save All as..."?

WSH Panel Mod script discussion/help

Reply #3703
Code: [Select]
fb.RunMainMenuCommand("File/Save all playlists...");




WSH Panel Mod script discussion/help

Reply #3704
Falstaff - Getting an overflow error. Hard to reproduce but here is what shows up in console.

Error: WSH Panel Mod (JSPlaylist v1.0.4 by Br3tt aka Falstaff >> http://br3tt.deviantart.com): Microsoft JScript runtime error: Overflow

File: C:\Users\***\Desktop\foobar2000\wsh_br3tt\jsplaylist\js\WSHheaderbar.js

Ln: 162, Col: 13

This happens often enough to make me think it needs looking into.


thanx for reporting, it should be fixed with the fresh v1.0.7 just uploaded, tell me more asap please

WSH Panel Mod script discussion/help

Reply #3705
JSPlaylist v.107


Great work - very exciting!

One thing I'm having trouble with - my existing title formatting used to group Various Artists no longer works. (header 1 left)

such as:

$if($strstr(%album artist%,Various Artists),Various Artists,%artist%)
or
$if($strcmp($meta(album artist,0),Various Artists),Various Artists,%artist%)

instead every track is individually listed instead of grouped?

WSH Panel Mod script discussion/help

Reply #3706
Falstaff

This solved problem of default wallpaper:

line 334
wallpaperpath: window.GetProperty("CUSTOM Default Wallpaper P",".\\wsh_br3tt\\jsplaylist\\images\\default.jpg"),

replace to


wallpaperpath: window.GetProperty("CUSTOM Default Wallpaper Path", fb.ProfilePath+"\\wsh_br3tt\\jsplaylist\\images\\default.jpg"),


I check this version on portable and user_profiles_enabled configurations.
No need in absolute path more!

WSH Panel Mod script discussion/help

Reply #3707
JSPlaylist v.107


Great work - very exciting!

One thing I'm having trouble with - my existing title formatting used to group Various Artists no longer works. (header 1 left)

such as:

$if($strstr(%album artist%,Various Artists),Various Artists,%artist%)
or
$if($strcmp($meta(album artist,0),Various Artists),Various Artists,%artist%)

instead every track is individually listed instead of grouped?


you are not clear for me ...
1) you tell me that the titleformat for the text header 1 left is not working ? i've tested it it works, but why testing if %album artist% = 'Various Artist' to display %album artist% else %artist% ??? the %album artist% TAG already to that alone ! just put %album artist% and if its is not set (like 'Various Artists or VA or ...) then it's %artist% that is used

2) then you say that every track of your VA album is not trouped ! That point has link at all with the TF header 1,2,3,or4, but with GroupBy Title format field and of course, by that fact that all your tracks of the VA album have something like 'Various Artists' in the TAG %album Artist%



WSH Panel Mod script discussion/help

Reply #3708
Falstaff

This solved problem of default wallpaper:

line 334
wallpaperpath: window.GetProperty("CUSTOM Default Wallpaper P",".\\wsh_br3tt\\jsplaylist\\images\\default.jpg"),

replace to


wallpaperpath: window.GetProperty("CUSTOM Default Wallpaper Path", fb.ProfilePath+"\\wsh_br3tt\\jsplaylist\\images\\default.jpg"),


I check this version on portable and user_profiles_enabled configurations.
No need in absolute path more!


sure this work, but i'd never said i want always use a relative path and this mod don't allow me or anyboby else to use an absolute path anymore. So i prefer keeping the actual way which allows both

WSH Panel Mod script discussion/help

Reply #3709
why testing if %album artist% = 'Various Artist' to display %album artist% else %artist% ???


I use %album artist% a lot, not only for Various Artists, that is why I also need a conditional check - I only want them grouped when "Various Artists" exists.

so maybe $strstr or $strcmp don't work with your panel?

WSH Panel Mod script discussion/help

Reply #3710
^of course $functions work. perhaps you're not understanding the fact that the display settings are completely independent of the title formatting used to actually group the tracks. this is different if you're used to being forced to group by what you see in other playlist viewers.

WSH Panel Mod script discussion/help

Reply #3711
this is different if you're used to being forced to group by what you see in other playlist viewers.


thanks Marc,

If I'm understanding you correctly, the grouping logic of the conditional is not happening before the actual display, so individual tracks still get displayed?

any idea if there would be an alternate technique to achieve something similar to what I'm trying to do with either of these?

$if($strstr(%album artist%,Various Artists),Various Artists,%artist%)
or
$if($strcmp($meta(album artist,0),Various Artists),Various Artists,%artist%)

WSH Panel Mod script discussion/help

Reply #3712
your grouping code needs to go in the Title Format box, not in any of of the Header dialogs. also, be aware that changes made here are not applied instantly. you have to right click the column headers and re-select the current grouping pattern for the changes to take effect.

edit: btw, if you think making these changes and then have to exit the settings panel and right clicking the columns header to re-apply the group is too much like hard work(!), the please add your voice to mine and maybe falstaff will add something in the settings panel???

NOW, maybe using the settings groups tab to select the active pattern (listbox index) is better ... i'have to think about it. If other people have an opinion, i hope they will give it


WSH Panel Mod script discussion/help

Reply #3714
your grouping code needs to go in the Title Format box, not in any of of the Header dialogs. also, be aware that changes made here are not applied instantly. you have to right click the column headers and re-select the current grouping pattern for the changes to take effect.


[head-slap] gotcha - of course; that's what I get for playing with this stuff early before I go to work.

 

thank you both!


WSH Panel Mod script discussion/help

Reply #3715
marc2003: I'm trying to change a few things. It goes slowly, but now at least my paint function is as I want it. It looks like this, so I'm getting three icons for all but one lastfm_mode, which gets two :
Code: [Select]
function on_paint(gr) {
    p.draw_background(gr);
    p.left_text(gr, li.header_text(), p.title_font, p.textcolour_hl, 6, 6, p.w - 12, 24);
    gr.DrawLine(5, 29, p.w - 5, 29, 1, p.textcolour_hl & 0x45ffffff);
    li.text_x = li.lastfm_mode == 1 ? 40 : 60;
     
  for(var i = 0; i < Math.min(li.items, li.rows); i++) {
        p.draw_image(gr, img, li.x, li.y + 16 + (i * li.row_height), 16, 16)
        p.draw_image(gr, img2, li.x, li.y + 16 + (i * li.row_height), 56, 16)
        if  (li.lastfm_mode == 1);
        else p.draw_image(gr, img3, li.x, li.y + 16 + (i * li.row_height), 96, 16);
        p.left_text(gr, li.names[i + li.offset], p.list_font, p.textcolour, li.x + li.text_x, li.y + 15 + (i * li.row_height), li.text_width, li.row_height);
    }
    }
If you'd like to help with some of these points it'd be appreciated.

1. How do I get a clean "+" in the adress bar instead of "%2B" when I try to replace spaces? I am trying to imitate a search, but it searches for pluses instead of spaces as it stands %2B instead of + in the adress bar. I'm trying with .replace(/ /g, '+')
2. I'd like to use the last.fm link function on a button instead. I figured out a way, but It'd be much cleaner if I could point to what you already use for clicking the text. As I expected, moving "else li.lbtn_up(x, y);" didn't work
3. Is it still possible to open spotify through this? I tried to look after the code in my old scripts, but I had deleted that as I didn't use it then 
4. You helped me three years ago to get the autoplaylists to go to the same playlist, called similar. But the names have changed since, and I get some error with the break; line http://www.hydrogenaud.io/forums/index.php...mp;#entry788010
5. Just a small cosmetic thing. But now the mouse pointer turns to a hand when I hover the text, not the buttons. I don't need the tooltips or the hand actually, but it would be nice to have unity.
6. Also a small cosmetic thing, but I'd like it to read for instance just "similar artists" instead of "%artist%: similar artists", as I use four panels at the same timeand already have that info elsewhere. So how would I cut from the colon in "li.header_text()"?

Of course most of this I will probably find out eventually by JFGI, that's what I'm doing slowly, just thought I'd ask, if you have the time.

WSH Panel Mod script discussion/help

Reply #3716
Falstaff

Is there a way to make State display only the playing icon? I find the checks distracting, and to be honest, prefer the older playlists method. The highlighted items are enough to let me know I have something selected.

EDIT: I just realized this may cause problems with playback queue. :/

WSH Panel Mod script discussion/help

Reply #3717
Falstaff

Is there a way to make State display only the playing icon? I find the checks distracting, and to be honest, prefer the older playlists method. The highlighted items are enough to let me know I have something selected.

EDIT: I just realized this may cause problems with playback queue. :/


overflow crash fixed ?

WSH Panel Mod script discussion/help

Reply #3718
Falstaff

Is there a way to make State display only the playing icon? I find the checks distracting, and to be honest, prefer the older playlists method. The highlighted items are enough to let me know I have something selected.

EDIT: I just realized this may cause problems with playback queue. :/


overflow crash fixed ?


Hi Fakstaff,
the overflow crash is still there. I had it yesterday eve again, even with your new release. I will drop the console output in here later today when I am back home


WSH Panel Mod script discussion/help

Reply #3720
Falstaff

Is there a way to make State display only the playing icon? I find the checks distracting, and to be honest, prefer the older playlists method. The highlighted items are enough to let me know I have something selected.

EDIT: I just realized this may cause problems with playback queue. :/


overflow crash fixed ?


Hi Fakstaff,
the overflow crash is still there. I had it yesterday eve again, even with your new release. I will drop the console output in here later today when I am back home


surprising but maybe due to another place in the code, i'm aware of the console report, thanx in advance

WSH Panel Mod script discussion/help

Reply #3721
@sylla, restore the mouse lbtn up function back to its default like this....

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


now add these 2 functions at the end of the script.

Code: [Select]
li.move = function(x, y) {
    this.index = Math.floor((y - this.y - 15) / this.row_height) + this.offset;
    this.in_range = this.index >= this.offset && this.index < this.offset + Math.min(this.rows, this.items);
}

li.lbtn_up = function(x, y) {
    switch(true) {
        case !this.trace(x, y):
        case this.up_btn.lbtn_up(x, y):
        case this.down_btn.lbtn_up(x, y):
        case !this.in_range:
        case x < this.x:
            break;
        case x < this.x + 20:
            //do something with first button
            break;
        case x < this.x + 40:
            //do something with second button.
            break;
        case this.lastfm_mode != 1 && x < this.x + 60:
            //do something with 3rd button
            break;
        case x > this.x + this.text_x && x < this.x + this.text_x + Math.min(this.names_widths[this.index], this.text_width):
            //text was clicked
            var i = 0;
            var playlist_name = "Similar";
            while(i < fb.PlaylistCount) {
                if (fb.GetPlaylistName(i) == playlist_name) fb.RemovePlaylist(i);
                else i++;
            }
            fb.CreateAutoPlaylist(fb.PlaylistCount, playlist_name, "artist HAS " + this.names[this.index]);
            fb.ActivePlaylist = fb.PlaylistCount - 1;
            break;
    }
}


untested but will hopefully work. you can this.urls[this.index] to get the last.fm url.

WSH Panel Mod script discussion/help

Reply #3722
Is there a way to make State display only the playing icon? I find the checks distracting, and to be honest, prefer the older playlists method. The highlighted items are enough to let me know I have something selected.


i've already fixed this for myself as i didn't like it either. you can download my modified file here

http://pastebin.com/muqLm6K5

you need to save it as WSHplaylist.js in the wsh_br3tt\jsplaylist\js folder

@falstaff, i was wondering if you have anything on your to-do list or is everything done now? the resason i ask is because i was thinking about sharing a last.fm mod version like i did last time where people can use the mood column to directly love/unlove tracks on last.fm.

WSH Panel Mod script discussion/help

Reply #3723
yep, my todo list is not empty yet.

WSH Panel Mod script discussion/help

Reply #3724
ok, that's cool. i'll wait until you're done.

i have a feature suggestion and that's for the middle mouse button to toggle the playlist manager on/off. i've already implemented it for myself but i think it would be nice feature for everyone.