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

WSH Panel Mod script discussion/help

Reply #3000
you can't mimic the double clicking of the status bar in default UI as there is no menu command to do it. it's only possible with columns.


Had to ask directly and was promptly reminded that some things are hidden by default. Shift+click on View shows there is a menu item for this. Thought it might be useful for you if you get more silly question like mine in the future.

Thanks again for all your help.

WSH Panel Mod script discussion/help

Reply #3001
Shift+click on View shows there is a menu item for this.


if you're talking about show now playing then you're mistaken. that only shows a tooltip in the notification area. it does not make the cursor jump back to the playing track.

WSH Panel Mod script discussion/help

Reply #3002
Huh? "View/ Show Now Playing" works for me in DUI since ages. It behaves like the doubleclick on the statusbar and jumps to the playing track, even if I'm in another playlist.

I use your your WSH buttons script with: function() { fb.RunMainMenuCommand("View/Show Now Playing"); }, "Show Now Playing", true)

WSH Panel Mod script discussion/help

Reply #3003
you're both right. i tried a fresh portable install and it works. i guess some option or maybe other component is interfering on my main install? 

edit: file>preferences>display>default user interface>always show notification icon is the culprit. if i turn that off, it works as expected.

WSH Panel Mod script discussion/help

Reply #3004
Hi, I have a question for marc2003:

I'm using Simple Tag Reader for quite a good time now for showing lyrics and always worked perfect, but I was going to read some lyrics today and for no apparent reason it just shows a dot (.) instead of the lyrics.
I've tried using another tag and works perfect, it's not because of multiple lines inside the tag because it can display lyrics if I put them in "composer", for example. But it just not displays anything that is inside lyrics. If there is something written it displays a dot, and if not then a question mark, but that's normal.

Any ideas?
Thanks.

WSH Panel Mod script discussion/help

Reply #3005
Hi, I have a question for marc2003:

I'm using Simple Tag Reader for quite a good time now for showing lyrics and always worked perfect, but I was going to read some lyrics today and for no apparent reason it just shows a dot (.) instead of the lyrics.
I've tried using another tag and works perfect, it's not because of multiple lines inside the tag because it can display lyrics if I put them in "composer", for example. But it just not displays anything that is inside lyrics. If there is something written it displays a dot, and if not then a question mark, but that's normal.

Any ideas?
Thanks.

find out your "LargeFieldsConfig.txt" file (maybe in %appdata%\foobar2000 or your foobar2000's root path) and change three lines below:

Code: [Select]
defaultMetaMax=8000
#fieldSpam=lyrics
#fieldSpam=unsynced lyrics
A rose will bloom, it then will fade.

WSH Panel Mod script discussion/help

Reply #3006
Wouldn't it be better to remove those two entries from the fieldSpam list and add them to the fieldBasic list and leave the defaultMetaMax size set to 1000?

The basicMetaMax (which governs the size limit of the fieldBasic list) is set to 2000 and that should be big enough for most Latin-based alphabets, esp. when the lyrics are in English.

WSH Panel Mod script discussion/help

Reply #3007
I was going to read some lyrics today and for no apparent reason it just shows a dot (.) instead of the lyrics.


the reason is that you must have upgraded foobar to a new version. 1.3 and above have this new feature where certain tags are no longer cached by foobar's library/playlist mechanism. it's supposed to improve performance on large collections.

it's mentioned in the changelog here: http://www.foobar2000.org/changelog



WSH Panel Mod script discussion/help

Reply #3008
You are right marc2003, I've upgraded this week to the last version, but I did what elia_is_me says plus adding "fieldBasic=lyrics" in the Basic field section (no need for the "defaultMetaMax" change) and now it works perfect!!

Thanks to both!!

WSH Panel Mod script discussion/help

Reply #3009
Getting this error on a standard installation

Code: [Select]
Scripting Engine Initialization Failed (News / Reviews / Blogs by marc2003, CODE: 0x80020101)
Check the console for more information (Always caused by unexcepted script error).


Works fine on a portable installation. What am I doing wrong, it seems like I can not get anything to work on a standard installation that works fine on my portable.

Edit: Was missing common7.js and now that script works, at least that is one problem solved. Sorry!

Edit 2: You May be able to help me with this though

Code: [Select]
// ==PREPROCESSOR==
// @import "%fb2k_profile_path%marc2003\common7.js"
// @name "News / Reviews / Blogs"
// @author "marc2003"
// @feature "v1.4"
// @feature "watch-metadb"
// ==/PREPROCESSOR==

var p = new panel("News / Reviews / Blogs", ["remap", "metadb", "echonest"]);
var li = new list(6, 30, p.w - 12, p.h - 30);

on_item_focus_change();

function on_size() {
    p.size();
    li.w = p.w - 12;
    li.h = p.h - 30;
    li.size();
}

function on_paint(gr) {
    p.draw_background(gr);
    p.left_text(gr, p.artist + ": " + li.echonest_modes[li.echonest_mode], p.title_font, p.textcolour_hl, 6, 6, p.w - 12, 24);
    gr.DrawLine(6, 29, p.w - 6, 29, 1, p.textcolour_hl);
    switch(true) {
        case !p.metadb:
            p.centre_text(gr, "[no selection]", p.normal_font, p.textcolour, 0, 0, p.w, p.h);
            break;
        case li.items > 0:
            li.draw(gr);
            break;
        default:
            p.centre_text(gr, "[nothing found]", p.normal_font, p.textcolour, 0, 0, p.w, p.h);
            break;
    }
}

function on_metadb_changed() {
    li.metadb_changed();
}

function on_mouse_wheel(step) {
    li.wheel(step);
}

function on_mouse_move(x, y) {
    p.move(x, y);
    if (li.move(x, y)) return;
}

function on_mouse_lbtn_up(x, y) {
    if (li.lbtn_up(x, y)) return;
}


This displays the date as DAY-MONTH-YEAR what can I do to make it display it as MONTH/DAY/YEAR ?

WSH Panel Mod script discussion/help

Reply #3010
Does someone know how to access html ''class'' element?
I have to access: class ''name''.
I try to use this: getElementsByClass(String className) , but didn't work?

script i use is:
Code: [Select]
for (i = 0; i < data.length; i++) {
     if (data[i].href.indexOf("about:/tag/" + encodeURIComponent(START_ARTIST).replace("*","")) == 0) urls.push(data[i].href.replace(/about:\//,""));
}


html looks like this: <a class=''name'' href=''/music/metalica/''>

I must to determinate if before 'href' exist tag class=''name'', and to use only this 'href'..

WSH Panel Mod script discussion/help

Reply #3011
simply use className eg

Code: [Select]
var data = div.getElementsByTagName("a");
for (i = 0; i < data.length; i++) {
    if (data[i].className == "name") //do something
}

WSH Panel Mod script discussion/help

Reply #3012
simply use className eg

Code: [Select]
var data = div.getElementsByTagName("a");
for (i = 0; i < data.length; i++) {
    if (data[i].className == "name") //do something
}


Great, thanks Marc, it work

Code: [Select]
for (i = 0; i < data.length; i++) {
    if (data[i].className.indexOf("name") == 0)
    if (data[i].href.indexOf("about:/music/") == 0) urls.push(data[i].href.replace(/about:\//,"");
}


WSH Panel Mod script discussion/help

Reply #3013
Marc, I want to add "stop after current" button to your playback buttons script (simple one)
I tried to add this line in "b.update = function()" section, but script crashed after clicking on the button.

Quote
button8: new button(126, 0, 32, 32, {normal: "sac.png", hover: "sac_h.png"}, function() { fb.StopAfterCurrent(); }, "Stop After Current"),


I have added a few buttons before and they work. Is there a way to fix this button? 

is it possible to make stop after current button, which indicates whether the button is pressed or not

WSH Panel Mod script discussion/help

Reply #3014
try this...

Code: [Select]
button8: new button(126, 0, 32, 32, {normal: fb.StopAfterCurrent ? "sac_h.png" : "sac.png", hover: fb.StopAfterCurrent ? "sac.png" : "sac_h.png"}, function() { fb.StopAfterCurrent = !fb.StopAfterCurrent; }, "Stop After Current"),


WSH Panel Mod script discussion/help

Reply #3015
Thank you

Button works but highlighting does not. Button still turns gray after I press it and move cursor away. Highlights only after i manually pause song. Same with unchecking

WSH Panel Mod script discussion/help

Reply #3016
replace this bit...

Code: [Select]
function() { fb.StopAfterCurrent = !fb.StopAfterCurrent; }


with

Code: [Select]
function() { fb.StopAfterCurrent = !fb.StopAfterCurrent; b.update(); }

WSH Panel Mod script discussion/help

Reply #3017
Now it works perfectly. Thanks again 

WSH Panel Mod script discussion/help

Reply #3018
thinking about it, you should revert that code back to what it was before. now add this function at the end of the script.

Code: [Select]
function on_playlist_stop_after_current_changed() {
    b.update();
}


now the button image will also update if you change the setting from the Playback menu or preferences.


WSH Panel Mod script discussion/help

Reply #3019
Hey marc, any idea why your scripts don't see dynamic info from a radio stream accessed through an m-TAGS file? All I see is the static info from the m-TAGS file.

So is this a limitation of WSH Panel Mod or is it all your fault?

WSH Panel Mod script discussion/help

Reply #3020
edit: temporary link removed. permanent fix can be had by right clicking panel>Update script.

WSH Panel Mod script discussion/help

Reply #3021
Yeah, that's got it working. Thanks.

WSH Panel Mod script discussion/help

Reply #3022
i just realised that wasn't a proper fix i posted. it broke other things so i've reverted it. i'll need to look into this some more.

WSH Panel Mod script discussion/help

Reply #3023
I guess I didn't test it thoroughly enough because all the scripts I tried (almost all of them) functioned.

The Thumbs script initially worked but after you removed the link and I used "Update script", it crashed and will not work.

Anyway, I guess I'll continue to use the broken version as I really only want to use the scripts for information regarding artists I know nothing about (and I only hear those artists in radio streams). I won't stop using m-TAGS as it's very handy for tagging radio streams which otherwise would lack the info, have wrong info or point to the fact they were tagged by an idiot.

WSH Panel Mod script discussion/help

Reply #3024
can you provide a sample tags file pointing at a stream with dynamic titles because i'm not familiar with the component. then i can have a go at properly fixing it.