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

WSH Panel Mod script discussion/help

Reply #4050
View/Show now playing in playlist is what you want.

WSH Panel Mod script discussion/help

Reply #4051
Yes but activated from the menu or double clicking the status bar
Also i'm not clear if i can disable the grouping based on playlist names patterns (e.g. *singles* --> do not show any header and only specific columns)

WSH Panel Mod script discussion/help

Reply #4052
Yes but activated from the menu or double clicking the status bar


you've lost me there. the previous posts were specifically about the view menu commands??

Quote
Also i'm not clear if i can disable the grouping based on playlist names patterns (e.g. *singles* --> do not show any header and only specific columns)


from what i can gather, you can specify multiple grouping patterns and then enable/disable them based on playlist names (panel settings>groups). presumably having one of the groups set with an expanded row height set to 0 will work??

there are no options for filtering columns based on playlist name. IIRC someone has already asked falstaff on his DA page and he has no interest in it. i guess it's back to NGplaylist if you need that.

WSH Panel Mod script discussion/help

Reply #4053
here's an updated JSplaylist-mod with a few things i missed earlier - the main thing being it didn't register dragging playlist items on to the built in playlist manager as a time to create an undo point for the target playlist.

https://github.com/marc2k3/jsplaylist-mod/releases

make sure the whole zip is extracted and the main playlist panel is updated.

WSH Panel Mod script discussion/help

Reply #4054
Yes but activated from the menu or double clicking the status bar


you've lost me there. the previous posts were specifically about the view menu commands??

What I meant is that it does not work from the menu (View/Show Now Playing). It should produce the same effect as the "Show Now playing track" option available through right click in your columns header (... and btw expand the group if it is collapsed).

WSH Panel Mod script discussion/help

Reply #4055
View/Show now playing in playlist is what you want.


as the bolded text wasn't clear enough, perhaps this will help? 



show now playing is not related to playlist viewers and is something to do with tooltips in the notification area.

in your columns header


it's not mine. i only added a few lines of code to the thousands written by falstaff (HA username, br3tt on deviantart), the original author. i thought i was quite clear giving credit.


WSH Panel Mod script discussion/help

Reply #4057
I'm trying to pass RGB color value between WSH panels
I'm using following functions from br3tt  :
Code: [Select]
var ForReading = 1;
var ForWriting = 2;
var fso = new ActiveXObject("Scripting.FileSystemObject");

var sdir = fb.ProfilePath + "my_theme\\settings\\";

function read_option(opt, val) {
    var odir = sdir + opt + "\\";
    if (!fso.FolderExists(odir)) {
        fso.CreateFolder(odir)
    } else {
        var e = new Enumerator(fso.GetFolder(odir).Files);
        var s;
        for (; !e.atEnd(); e.moveNext()) {
            s = e.item();
            if (utils.PathWildcardMatch("*", s.Name)) {
                return s.Name
            }

        }

    }
    fso.CreateTextFile(odir + val, ForWriting);
    return val
}

function update_option(opt, val) {
    var odir = sdir + opt + "\\";
    if (!fso.FolderExists(odir)) {
        fso.CreateFolder(odir);
        fso.CreateTextFile(odir + val, ForWriting)
    } else {
        var e = new Enumerator(fso.GetFolder(odir).Files);
        var s;
        for (; !e.atEnd(); e.moveNext()) {
            s = e.item();
            if (utils.PathWildcardMatch("*", s.Name)) {
                fso.MoveFile(odir + s.Name, odir + val);
                break
            }

        }

    }
    return val
}


but when try to take that value as RGB color
Code: [Select]
p.textcolour = RGB(read_option("textcolour"));

It doesn't work
Does it because function output contain "" surounding them ??
Is there any other method to pass values between WSH panels??

WSH Panel Mod script discussion/help

Reply #4058
the RGB function expects 3 arguments separated by commas and each one should be a number between 0 and 255.

Code: [Select]
RGB(255, 0, 0)


and panels can communicate directly. look at window.NotifyOthers to send and on_notify_data to receive.

WSH Panel Mod script discussion/help

Reply #4059
the RGB function expects 3 arguments separated by commas and each one should be a number between 0 and 255.

Code: [Select]
RGB(255, 0, 0)

Just realized made a stupid mistake by passing arguments as a string :/
Quote
and panels can communicate directly. look at window.NotifyOthers to send and on_notify_data to receive.


This is really  nice , is there any reason callback function on_notify_data not get called?
I'm trying to change background color of YouTube Track Manager but seems like  on_notify_data function not even get called
but for your scripts it worked.

WSH Panel Mod script discussion/help

Reply #4060
on_notify_data gets triggered in all panels EXCEPT the one where you use window.NotifyOthers (hence the name )

WSH Panel Mod script discussion/help

Reply #4061
on_notify_data gets triggered in all panels EXCEPT the one where you use window.NotifyOthers (hence the name )

Of course ,
Sorry for the stupid questions.

WSH Panel Mod script discussion/help

Reply #4062
because i have column headers hidden in JSplaylist, i forgot that clicking them changed the sort order. i've now updated my jsplaylist-mod to account for this:

https://github.com/marc2k3/jsplaylist-mod/releases

make sure all files are extracted again and the script in the panel also gets updated.

now the previous order can be restored by using edit>undo or ctrl+z.

again all credit to falstaff/br3tt for the original script. 

WSH Panel Mod script discussion/help

Reply #4063
Hi,

Is there a way with WSH to open the tag editor window ("properties" in the context menu) for a track ? I found a way to display the context menu, which have the entry "properties", but i would like to access directly to this "properties" item.
Thanks!

WSH Panel Mod script discussion/help

Reply #4064
Hi,

Is there a way with WSH to open the tag editor window ("properties" in the context menu) for a track ? I found a way to display the context menu, which have the entry "properties", but i would like to access directly to this "properties" item.
Thanks!


Yes there is : fb.RunContextCommandWithMetadb("Properties", handle_or_handles, 0);

WSH Panel Mod script discussion/help

Reply #4065
This is superb. Tnx.

But I'm wondering can this thing be modified so it can fetch single covers instead of album art?

Submitting a panel that gets current album art from last.fm, which I use mainly for streams.

Extract rar to your profile folder.
In a new panel import lastfm_trackinfo_cover.txt
Right click panel and in properties add your last.fm api key.

http://goo.gl/r3kAOp


WSH Panel Mod script discussion/help

Reply #4066
This is superb. Tnx.

But I'm wondering can this thing be modified so it can fetch single covers instead of album art?

Submitting a panel that gets current album art from last.fm, which I use mainly for streams.

Extract rar to your profile folder.
In a new panel import lastfm_trackinfo_cover.txt
Right click panel and in properties add your last.fm api key.

http://goo.gl/r3kAOp



Sorry but the last.fm api returns only album art.

http://www.last.fm/api/show/track.getInfo

WSH Panel Mod script discussion/help

Reply #4067
This is superb. Tnx.

But I'm wondering can this thing be modified so it can fetch single covers instead of album art?


Sorry but the last.fm api returns only album art.


It would be good that we have all in one script.
Album (text + images), Artist (text + images)..
I wanted to do this, but i don't have time..

@Zoig you can fetch single covers if on last.fm web page you have that image...

WSH Panel Mod script discussion/help

Reply #4068
hey, I'm a newbie here, and i wanna learn more about wsh panel mod
I create foobar skin and this is the result

simply i want to make it like this


what code i should add?
please help, i've googling anywhere but have no result
if you could help me to add the blue baron the playing item, that would be great!

WSH Panel Mod script discussion/help

Reply #4069
YouTube Track Manager - new version

- Fixed YouTube searching due to changes at YouTube

- Added integrated artist search for album manager.

- Various other refinements.

- For information about YouTube Track Manager and a link to screenshot see here. For download of latest version (1.6) and full changelog see here.
 


WSH Panel Mod script discussion/help

Reply #4070
after some experiemeting with play buttons i finally almost found what i wanted. now the problem is that those freaking buttons wont get in to their desired place unless i right click > configure > apply in wsh box. they are just half way too left. this is a modification of T.P.Wang's SimpleThemedButton.txt with the special flavour of marc2003.
Code: [Select]
// vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et:

// ==PREPROCESSOR==
// @name "SimpleThemedButton"
// @author "T.P Wang"
// ==/PREPROCESSOR==

function RGB(r, g, b) {
    return (0xff000000 | (r << 16) | (g << 8) | (b));}

function RGBA(r, g, b, a) {
    return ((a << 24) | (r << 16) | (g << 8) | (b));}

ButtonStates = {
    normal: 0,
    hover: 1,
    down: 2,
    hide: 3
}

var DT_TOP = 0x00000000;
var DT_CENTER = 0x00000001;
var DT_VCENTER = 0x00000004;
var DT_WORDBREAK = 0x00000010;
var DT_CALCRECT = 0x00000400;
var DT_NOPREFIX = 0x00000800;

var bcolora = RGBA(100,100,100,155)
var bcolorb = RGBA (0,0,0,155,155)
var bcolorc = RGBA(100,100,100,100)
var bcolorhover1 = RGBA(110,110,110,155)
var bcolorhover2 = RGBA(5,5,5,155)
var grad = 91
var ww = window.Width
var wh = window.Height
var x = ww/2
var y = wh/16
var w = 100
var h = w*0.2
var fsize = w/5.83
var g_font = gdi.Font("Guifx v2 Transports", fsize);

function SimpleButton(x, y, w, h, text, fonClick, state) {
    this.state = state ? state : ButtonStates.normal;
    this.x = x;
    this.y = y;
    this.w = w;
    this.h = h;
    this.text = text;
    this.fonClick = fonClick;
   
    this.containXY = function (x, y) {
        return (this.x <= x) && (x <= this.x + this.w) && (this.y <= y) && (y <= this.y + this.h);
    }
   
this.changeState = function (state) {
        var old = this.state;
        this.state = state;
        return old;
    }
   
this.draw = function (gr) {
        if (this.state == ButtonStates.hide) return;
       
switch (this.state)
        {
        case ButtonStates.normal:
            gr.FillGradRect(this.x, this.y, this.w, this.h, grad, bcolora, bcolorb );
gr.DrawRect(this.x, this.y, this.w-1, this.h-1, 1,bcolorc);
break;
       
case ButtonStates.hover:
            gr.FillGradRect(this.x, this.y, this.w, this.h, grad, bcolorhover1, bcolorhover2 );
gr.DrawRect(this.x, this.y, this.w-1, this.h-1, 1,bcolorc);
break;
       
case ButtonStates.down:
            gr.FillGradRect(this.x+1, this.y+1, this.w-2, this.h-2, grad, bcolora, bcolorb );
            gr.DrawRect(this.x, this.y+1, this.w-1, this.h-2, 1,bcolorc);
break;
       
case ButtonStates.hide:
            return;
        }
    gr.GdiDrawText(this.text, g_font, RGB(200,200,200), this.x, this.y, this.w, this.h, DT_CENTER| DT_VCENTER | DT_CALCRECT | DT_NOPREFIX);
    }
   
this.onClick = function () {
        this.fonClick && this.fonClick();
    }
}

function drawAllButtons(gr) {
    for (var i in $buttons) {
        $buttons[i].draw(gr);
    }
}

function chooseButton(x, y) {
    for (var i in $buttons) {
        if ($buttons[i].containXY(x, y) && $buttons[i].state != ButtonStates.hide) return $buttons[i];
    }
   
return null;
}

var cur_btn = null;
var g_down = false;

// --------------------------

refreshPlayButton = function() {
$buttons = {
Previous: new SimpleButton(x-w-w/2-1, y, w, h, "5", function() {fb.prev();}),
PlayPause: new SimpleButton(x-w/2, y, w, h, (fb.IsPlaying ? (fb.IsPaused ? 1 : 2) : 1), function() { fb.PlayOrPause(); }),
Next: new SimpleButton(x+w/2+1, y, w, h, "6", function() {fb.next();})
}
window.Repaint();
}

refreshPlayButton();

// --- APPLICATION START

function on_paint(gr) {
    gr.DrawRect(x-w-w/2-3, y-2, w*3+5, h+3, 1, RGB(60,60,63))
    gr.FillSolidRect(x-w-w/2-2, y-1, w*3+4, h+2, RGBA(0,0,0,255))
drawAllButtons(gr);
}

function on_playback_stop() {
refreshPlayButton();
}

function on_playback_pause() {
refreshPlayButton();
}

function on_playback_starting() {
refreshPlayButton();
}

function on_mouse_move(x, y) {
    var old = cur_btn;
    cur_btn = chooseButton(x, y);
   
    if (old == cur_btn) {
        if (g_down) return;
    } else if (g_down && cur_btn && cur_btn.state != ButtonStates.down) {
        cur_btn.changeState(ButtonStates.down);
        window.Repaint();
        return;
    }
    old && old.changeState(ButtonStates.normal);
    cur_btn && cur_btn.changeState(ButtonStates.hover);
    window.Repaint();
}

function on_mouse_leave() {
    g_down = false;
    if (cur_btn) {
        cur_btn.changeState(ButtonStates.normal);
        window.Repaint();
    }
}
function on_mouse_lbtn_down(x, y) {
    g_down = true;
    if (cur_btn) {
        cur_btn.changeState(ButtonStates.down);
        window.Repaint();
    }
}
function on_mouse_lbtn_up(x, y) {
    g_down = false;
    if (cur_btn) {
        cur_btn.onClick();
        cur_btn.changeState(ButtonStates.hover);
        window.Repaint();
    }
}

// --- APPLICATION END

WSH Panel Mod script discussion/help

Reply #4071
@randomuser

if your problem is the placement of those buttons on resize, for sure it will never place them in the middle of the panel until you edit script and click apply, why ? because placement is relative to x,y values that are only set outside of a function so only set when you launch the script and they never change after
solution below, add on_size() callback and set variable depending of the width and height of the panel in it

HTH


Code: [Select]
// vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et:

// ==PREPROCESSOR==
// @name "SimpleThemedButton"
// @author "T.P Wang"
// ==/PREPROCESSOR==

function RGB(r, g, b) {
    return (0xff000000 | (r << 16) | (g << 8) | (b));}

function RGBA(r, g, b, a) {
    return ((a << 24) | (r << 16) | (g << 8) | (b));}

ButtonStates = {
    normal: 0,
    hover: 1,
    down: 2,
    hide: 3
}

var DT_TOP = 0x00000000;
var DT_CENTER = 0x00000001;
var DT_VCENTER = 0x00000004;
var DT_WORDBREAK = 0x00000010;
var DT_CALCRECT = 0x00000400;
var DT_NOPREFIX = 0x00000800;

var bcolora = RGBA(100,100,100,155)
var bcolorb = RGBA (0,0,0,155,155)
var bcolorc = RGBA(100,100,100,100)
var bcolorhover1 = RGBA(110,110,110,155)
var bcolorhover2 = RGBA(5,5,5,155)
var grad = 91
var ww, wh, x, y, w = 100, h, fsize = w / 5.83;
var g_font = gdi.Font("Guifx v2 Transports", fsize);

function SimpleButton(x, y, w, h, text, fonClick, state) {
    this.state = state ? state : ButtonStates.normal;
    this.x = x;
    this.y = y;
    this.w = w;
    this.h = h;
    this.text = text;
    this.fonClick = fonClick;
   
    this.containXY = function (x, y) {
        return (this.x <= x) && (x <= this.x + this.w) && (this.y <= y) && (y <= this.y + this.h);
    }
   
this.changeState = function (state) {
        var old = this.state;
        this.state = state;
        return old;
    }
   
this.draw = function (gr) {
        if (this.state == ButtonStates.hide) return;
       
switch (this.state)
        {
        case ButtonStates.normal:
            gr.FillGradRect(this.x, this.y, this.w, this.h, grad, bcolora, bcolorb );
gr.DrawRect(this.x, this.y, this.w-1, this.h-1, 1,bcolorc);
break;
       
case ButtonStates.hover:
            gr.FillGradRect(this.x, this.y, this.w, this.h, grad, bcolorhover1, bcolorhover2 );
gr.DrawRect(this.x, this.y, this.w-1, this.h-1, 1,bcolorc);
break;
       
case ButtonStates.down:
            gr.FillGradRect(this.x+1, this.y+1, this.w-2, this.h-2, grad, bcolora, bcolorb );
            gr.DrawRect(this.x, this.y+1, this.w-1, this.h-2, 1,bcolorc);
break;
       
case ButtonStates.hide:
            return;
        }
    gr.GdiDrawText(this.text, g_font, RGB(200,200,200), this.x, this.y, this.w, this.h, DT_CENTER| DT_VCENTER | DT_CALCRECT | DT_NOPREFIX);
    }
   
this.onClick = function () {
        this.fonClick && this.fonClick();
    }
}

function drawAllButtons(gr) {
    for (var i in $buttons) {
        $buttons[i].draw(gr);
    }
}

function chooseButton(x, y) {
    for (var i in $buttons) {
        if ($buttons[i].containXY(x, y) && $buttons[i].state != ButtonStates.hide) return $buttons[i];
    }
   
return null;
}

var cur_btn = null;
var g_down = false;

// --------------------------

refreshPlayButton = function() {
$buttons = {
Previous: new SimpleButton(x-w-w/2-1, y, w, h, "5", function() {fb.prev();}),
PlayPause: new SimpleButton(x-w/2, y, w, h, (fb.IsPlaying ? (fb.IsPaused ? 1 : 2) : 1), function() { fb.PlayOrPause(); }),
Next: new SimpleButton(x+w/2+1, y, w, h, "6", function() {fb.next();})
}
window.Repaint();
}

refreshPlayButton();

// --- APPLICATION START

function on_size() {
   
    ww = window.Width
    wh = window.Height
   
    if(!ww) return;
   
    x = ww/2
    y = wh/16
    h = w*0.2
    refreshPlayButton();
}

function on_paint(gr) {
    gr.DrawRect(x-w-w/2-3, y-2, w*3+5, h+3, 1, RGB(60,60,63))
    gr.FillSolidRect(x-w-w/2-2, y-1, w*3+4, h+2, RGBA(0,0,0,255))
drawAllButtons(gr);
}

function on_playback_stop() {
refreshPlayButton();
}

function on_playback_pause() {
refreshPlayButton();
}

function on_playback_starting() {
refreshPlayButton();
}

function on_mouse_move(x, y) {
    var old = cur_btn;
    cur_btn = chooseButton(x, y);
   
    if (old == cur_btn) {
        if (g_down) return;
    } else if (g_down && cur_btn && cur_btn.state != ButtonStates.down) {
        cur_btn.changeState(ButtonStates.down);
        window.Repaint();
        return;
    }
    old && old.changeState(ButtonStates.normal);
    cur_btn && cur_btn.changeState(ButtonStates.hover);
    window.Repaint();
}

function on_mouse_leave() {
    g_down = false;
    if (cur_btn) {
        cur_btn.changeState(ButtonStates.normal);
        window.Repaint();
    }
}
function on_mouse_lbtn_down(x, y) {
    g_down = true;
    if (cur_btn) {
        cur_btn.changeState(ButtonStates.down);
        window.Repaint();
    }
}
function on_mouse_lbtn_up(x, y) {
    g_down = false;
    if (cur_btn) {
        cur_btn.onClick();
        cur_btn.changeState(ButtonStates.hover);
        window.Repaint();
    }
}

// --- APPLICATION END

WSH Panel Mod script discussion/help

Reply #4072
thanks. now i have something to click on

WSH Panel Mod script discussion/help

Reply #4073
is it possible to have vertical volume bar which grows from bottom to top?

WSH Panel Mod script discussion/help

Reply #4074
is it possible to have vertical volume bar which grows from bottom to top?

nevermind, figured out this.

Code: [Select]
// vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et:

// ==PREPROCESSOR==
// @name "Volbar with GdiDrawText"
// @author "T.P Wang"
// ==/PREPROCESSOR==

// Flags, used with GdiDrawText
// For more information, see: http://msdn.microsoft.com/en-us/library/dd162498(VS.85).aspx
var DT_TOP = 0x00000000;
var DT_LEFT = 0x00000000;
var DT_CENTER = 0x00000001;
var DT_RIGHT = 0x00000002;
var DT_VCENTER = 0x00000004;
var DT_BOTTOM = 0x00000008;
var DT_WORDBREAK = 0x00000010;
var DT_SINGLELINE = 0x00000020;
var DT_EXPANDTABS = 0x00000040;
var DT_TABSTOP = 0x00000080;
var DT_NOCLIP = 0x00000100;
var DT_EXTERNALLEADING = 0x00000200;
var DT_CALCRECT = 0x00000400;
var DT_NOPREFIX = 0x00000800;
var DT_INTERNAL = 0x00001000;
var DT_EDITCONTROL = 0x00002000;
var DT_PATH_ELLIPSIS = 0x00004000;
var DT_END_ELLIPSIS = 0x00008000;
var DT_MODIFYSTRING = 0x00010000;
var DT_RTLREADING = 0x00020000;
var DT_WORD_ELLIPSIS = 0x00040000;
var DT_NOFULLWIDTHCHARBREAK = 0x00080000;
var DT_HIDEPREFIX = 0x00100000;
var DT_PREFIXONLY = 0x00200000;

function RGB(r, g, b) {
    return (0xff000000 | (r << 16) | (g << 8) | (b));
}

var g_font = gdi.Font("Tahoma", 12, 0);
var g_drag = 0;

function on_paint(gr) {
    var ww = window.Width;
    var wh = window.Height;
    var volume = fb.Volume;
    var pos = window.Height * ((100 + volume) / 100);
    var txt = (Math.ceil(volume)) + "dB";
    gr.FillGradRect(0, 0, ww, wh - pos, 0, RGB(240, 240, 240), RGB(190, 190, 190));
    gr.FillGradRect(0, wh - pos, ww, pos, 0, RGB(240, 240, 240), RGB(100, 230, 100));
    gr.GdiDrawText(txt, g_font, RGB(64, 64, 128), 0, 0, ww, wh, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
    gr.DrawRect(0, 0, ww - 1, wh - 1, 1.0, RGB(150, 150, 150));
}


function on_mouse_lbtn_down(x, y) {
    g_drag = 1;
}

function on_mouse_lbtn_up(x, y) {
    on_mouse_move(x, y);
    g_drag = 0;
}

function on_mouse_move(x, y) {
    if (g_drag) {
        var v = y / window.Height;
        v = (v < 0) ? 0 : (v < 1) ? v : 1;
        v = -100 * v;
        if (fb.Volume != v) fb.Volume = v;
    }
}

function on_mouse_wheel(delta) {
    if (delta > 0) fb.VolumeUp();
    else fb.VolumeDown();
}

function on_volume_change(val) {
    window.Repaint();
}