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 1399915 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

WSH Panel Mod script discussion/help

Reply #350
nope, not possible. re-creating it with your own custom menu is the only way.

WSH Panel Mod script discussion/help

Reply #351
Where can I find some scripts for displaying album art with some nice effects such as reflection or shadow?

WSH Panel Mod script discussion/help

Reply #352
Marc I was looking through your updated samples and noticed that you switched to DrawString from GdiDrawText. I wanted to know why because according to the docs the latter is faster.
Thanks

 

WSH Panel Mod script discussion/help

Reply #353
i changed because using MeasureString() to calculate text dimensions is accurate. using the gdi method isn't.

as for speed, could you really tell them apart if you had 2 panels side by side? i don't think so.

WSH Panel Mod script discussion/help

Reply #354
i changed because using MeasureString() to calculate text dimensions is accurate. using the gdi method isn't.

as for speed, could you really tell them apart if you had 2 panels side by side? i don't think so.

I noticed that with DrawString some characters overlap and hinting doesn't seem as good as GDIDrawText

WSH Panel Mod script discussion/help

Reply #355
overlapping characters? i've not seen that before. have you got a screenshot? (not that i could anything about it - i'm just curious)

WSH Panel Mod script discussion/help

Reply #356
overlapping characters? i've not seen that before. have you got a screenshot? (not that i could anything about it - i'm just curious)

I'll try to get one for you. Will have to re edit my script. Maybe it only happens with Segoe UI

WSH Panel Mod script discussion/help

Reply #357
Shouldn't we be able to do?
Code: [Select]
_menu.EnableMenuItem(ID, !fb.IsPlaying);

instead of
Code: [Select]
 _menu.EnableMenuItem(ID, fb.IsPlaying ? 0 : 1);


WSH Panel Mod script discussion/help

Reply #358
Hi,

is it possible to create a button for a masstagger script
and edit multiple files with it?

I Managed to do that to the now playing file, but not more than that one.

r3v0
<3 f00

WSH Panel Mod script discussion/help

Reply #359
@grimes

I have been enjoying using your cover browser script.

I did have a few issues with regard to getting working arrays.

tagarray[0]

in foobar2000: Library | Search | %tracknumber% IS 01 | Create Playlist

This did not fully work for me as I have a number of compilation albums that do not have track 01 where I have removed needless duplicate tracks.

I ended up creating a playlist of my whole library and using a text format in text tools as below with skip duplicate/repeating lines ticked.

"$cut(%path%,3)\$directory(%path%,6)\\$directory(%path%,5)\\$directory(%path%,4)\\$directory(%path%,3)\\$directory(%path%,2)\\$directory(%path%,1)\\",

Obviously the number of required paths will depend on the folder structure and the last comma still needs deleting.

tagarray[1]

Using the track pattern "%album%", yielded two problems. Firstly, albums with names such as "Heroes" ended up as ""Heroes"" which causes a script error. "\"Heroes\"" needs to be used instead. Secondly, there are problems when there is more than one album of the same name, e.g. I have several called Greatest Hits but by different artists, and with these the show playing album setting often fails to display the correct cover. I ended up creating a playlist of my whole library and using a track pattern of [%album artist%] -[ '['%date%']'][ %album%] with skip duplicate/repeating lines ticked in text tools. This is much more robust and ensures all have a unique name. I changed the var album definition accordingly.

Also if you end up playing tracks not in the array, e.g. something like a playlist generated by the last.fm plug-in, where the covers are available then no covers show at all in the cover browser. It may be worth considering showing at least the central cover for tracks not in the array but where the cover is available.

It's also a pity that you cannot click on a cover and send it to a playlist or select it in the playlist.

WSH Panel Mod script discussion/help

Reply #360
Also if you end up playing tracks not in the array, e.g. something like a playlist generated by the last.fm plug-in, where the covers are available then no covers show at all in the cover browser. It may be worth considering showing at least the central cover for tracks not in the array but where the cover is available.


Try to implement this feature. First Test-Version here: http://pastebin.de/5387

WSH Panel Mod script discussion/help

Reply #361
Don't know if this is possible but thought I'd ask anyway 'cos I'm totally new to scripting for WSH but trying to get to grips with it.

Basically, I've altered slightly a code from Tombarlow (thanks!) to use as a volume knob as follows -
Code: [Select]
function pos2vol(pos) {
return (50 * Math.log(0.99 * p + 0.01) / Math.LN10);
}

function vol2pos(v){
return (Math.pow(10, v / 50) - 0.01) / 0.99;
}

var vcol = window.InstanceType?window.GetColorDUI(0):window.GetColorCUI(1);
var bg = window.InstanceType?window.GetColorDUI(1):window.GetColorCUI(3);

var radius = 16;
var line = 3;
var offset = 3;

var voldrag = false;

var p = vol2pos(fb.Volume);
var ang = (3/4)*Math.PI + (3/2)*Math.PI*p;

function on_paint(gr)
{
//gr.FillSolidRect( 0, 0, ww, wh, bg);
gr.SetSmoothingMode(4);
//gr.DrawEllipse(offset, offset, 2*radius, 2*radius, line, vcol);
gr.DrawLine(radius*(1+Math.cos(ang))+offset, (radius)*(1+Math.sin(ang))+offset, radius+offset, radius+offset, line, vcol);
}

function on_size()
{
ww = window.Width;
wh = window.Height;
}

function on_mouse_lbtn_down(x,y)
{
voldrag = true;
p = vol2pos(fb.Volume);
y_old = y;
}

function on_mouse_lbtn_up(x,y)
{
voldrag = false;
}

function on_mouse_move(x,y)
{
if(voldrag)
{
p = p - (y-y_old)/80;
p = (p>1)?1:(p<0)?0:p;
fb.Volume = pos2vol(p);
y_old = y;
}
}

function on_mouse_wheel(delta)
{
p = p + delta/10;
p = (p>1)?1:(p<0)?0:p;
fb.Volume = pos2vol(p);
}

function on_volume_change(val)
{
p = vol2pos(val);
ang = (3/4)*Math.PI + (3/2)*Math.PI*p;
window.Repaint();
}


Which works great over a .png to give a vintage "knob" style volume control, but I'm now trying to do the same thing as a seekbar dial and I'm completely baffled as to where to even start

Anyone any ideas?

WSH Panel Mod script discussion/help

Reply #362
@grimes

Cover browser rc5. This is working nicely. The change to using path instead of album seems to make it unnecessary to use array [1], the album array, unless sorting by array [1] is considered essential.  At least I have it working fine without filling array [1] with the text previously displayed by this being directly retrieved using titleformatting.

A small bug is that the side reflection often disappears on track change. This seems to be a problem with evaluating: !(g_img2.Width * scale < ww - 0.01) in: if (reflectionside && !(g_img2.Width * scale < ww - 0.01)) as using: if (reflectionside) alone works fine.

Personally for tracks not in the array I prefer having something other than the stub images for img2, 3, 4 & 5. Currently I put the artist as img2 & 5 and repeated the front cover as img 3 & 4, but this is not necessarily ideal (I have no back, disc or icon images). Also if a track not in the array is playing and you interact with cover browser (e.g. mouse wheel scroll) it reverts to the array covers, which is fine, but it seems that you cannot then go back to the playing track cover.

WSH Panel Mod script discussion/help

Reply #363
@grimes

Thanks for cover browser rc6. All is working fine so far. May be the warning message something like "no stub image path defined in foobar2000 preferences" needs to go back in because if just one of the images is missing - especially for tracks not in the array - no images display. I had this problem initially and it took me a while to realise what was going on. The cursor change on mouse move over certain images with tracks not in the array is also somewhat confusing as it does nothing and it would be best if it did not happen.

WSH Panel Mod script discussion/help

Reply #364
Hello all,

im using Dark-One 1.6 theme by br3tt and i came across the cool component foo_menu_addons by Acropolis and i wanted to implement the A-B repat function in the interface on the WSH pane using JScript.

I put 4 buttons [E] [A] [R]

E to enable the repeat
A and B to set the markers
R to reset.

What i can do :
- A and B cannot be turned ON if E is not turned ON (and it works )
- Toggle A, B and E on and off (and works)
- When i press R the E button should stay enabled and toggle off only A and B ( i didnt do that yet but i think i can figure this out easily)

What i cant do:
- when i skip track E should get disabled and disable automatically also A and B markers. Anyone can help on this?

i used this code :

Code: [Select]
var A_on = {normal: imgPath + "AOn.png", hover: imgPath + "AOn.png"};
var A_off = {normal: imgPath + "AOff.png", hover: imgPath + "AOn.png"};
var a_tooltip = "Set A Marker";

var B_on = {normal: imgPath + "BOn.png", hover: imgPath + "BOn.png"};
var B_off = {normal: imgPath + "BOff.png", hover: imgPath + "BOn.png"};
var b_tooltip = "Set B Marker";

var E_on = {normal: imgPath + "EOn.png", hover: imgPath + "EOn.png"};
var E_off = {normal: imgPath + "EOff.png", hover: imgPath + "EOn.png"};
var e_tooltip = "Enable A-B";

var R_on = {normal: imgPath + "ROn.png", hover: imgPath + "ROn.png"};
var R_off = {normal: imgPath + "ROff.png", hover: imgPath + "ROn.png"};
var r_tooltip = "Reset A-B";

var a_sw = false;
var b_sw = false;
var e_sw = false;

function genAImageSrc() {
    return (a_sw & e_sw) ? A_on : A_off;
}
function switch_a() {
    a_sw = !a_sw;
    Buttons.A.alterImage(genAImageSrc());
    Buttons.A.repaint();
}

function genBImageSrc() {
    return (b_sw & e_sw) ? B_on : B_off;
}

function switch_b() {
    b_sw = !b_sw;
    Buttons.B.alterImage(genBImageSrc());
    Buttons.B.repaint();
}
function genEImageSrc() {
    return (e_sw) ? E_on : E_off;
}

function switch_e() {
        e_sw =!e_sw
        Buttons.E.alterImage(genEImageSrc());
        Buttons.E.repaint();
    if (!e_sw){    
                
                Buttons.A.alterImage(A_off);
                Buttons.A.repaint();    
                Buttons.B.alterImage(B_off);
                Buttons.B.repaint();    
    }
}

Buttons["E"] = new Button(0, 0, 13, 11, genEImageSrc(), function () { fb.RunMainMenuCommand("Playback/Repeat A-B/Enable");switch_e();}, e_tooltip);
Buttons["A"] = new Button(10, 0, 13, 11, genAImageSrc(), function () {fb.RunMainMenuCommand("Playback/Repeat A-B/Mark A");switch_a();}, a_tooltip);
Buttons["B"] = new Button(20, 0, 13, 11, genBImageSrc(), function () {fb.RunMainMenuCommand("Playback/Repeat A-B/Mark B");switch_b();}, b_tooltip);
Buttons["R"] = new Button(30, 0, 13, 11, R_off, function () {fb.RunMainMenuCommand("Playback/Repeat A-B/Reset");}, r_tooltip);


That's the first time i use JScript so dont blame me if the code is lame =P

Any help would be really appreciated

Thanks !
No Foobar? No music


WSH Panel Mod script discussion/help

Reply #366
Sorry
my bad, btw seems like i cant edit so...

 
@powernemo:

Dark-One 1.6 is a theme by tedgo, not me
No Foobar? No music

WSH Panel Mod script discussion/help

Reply #367
Ok, figured out myself
(any more elegant solution of course is much appreciated)

Code: [Select]
function genAImageSrc() {
    
    return (a_sw & e_sw) ? A_on : A_off;
}

function switch_a() {
    
    a_sw = !a_sw;
    if (a_sw) {A_active = true};
    Buttons.A.alterImage(genAImageSrc());
    Buttons.A.repaint();
}

function genBImageSrc() {
    
    return (b_sw & e_sw) ? B_on : B_off;
}

function switch_b() {
    
    b_sw = !b_sw;
    if (b_sw) {
        B_active = true
        if (!A_active) {     // That's cause if we press B before pressing A the song will start looping frm the beginning to marker B so we wanna turn on A (even if its not so necessary)
            A_active = true
            a_sw = true
            Buttons.A.alterImage(genAImageSrc());
            Buttons.A.repaint();
            }
        };
    Buttons.B.alterImage(genBImageSrc());
    Buttons.B.repaint();
}

function genEImageSrc() {
    
    return (e_sw) ? E_on : E_off;
}

function switch_e() {
    
        e_sw =!e_sw
        Buttons.E.alterImage(genEImageSrc());
        Buttons.E.repaint();

        if (!e_sw){    
                Buttons.A.alterImage(A_off);
                Buttons.A.repaint();    
                Buttons.B.alterImage(B_off);
                Buttons.B.repaint();    
        }
        if ((e_sw) & (A_active)) {
                Buttons.A.alterImage(A_on);
                Buttons.A.repaint();    
            }
        if ((e_sw) & (B_active) ){
                Buttons.B.alterImage(B_on);
                Buttons.B.repaint();    
            }
}

function reset_sw(){
    
        a_sw = false;
        b_sw = false;
        e_sw =false
        A_active = false
        B_active = false
        Buttons.A.alterImage(A_off);
        Buttons.A.repaint();    
        Buttons.B.alterImage(B_off);
        Buttons.B.repaint();    
        Buttons.E.alterImage(E_off);
        Buttons.E.repaint();

}

function on_playback_new_track(){
        
    reset_sw()
}

Buttons["E"] = new Button(0, 0, 13, 11, genEImageSrc(), function () { fb.RunMainMenuCommand("Playback/Repeat A-B/Enable");switch_e();}, e_tooltip);
Buttons["A"] = new Button(10, 0, 13, 11, genAImageSrc(), function () {fb.RunMainMenuCommand("Playback/Repeat A-B/Mark A");switch_a();}, a_tooltip);
Buttons["B"] = new Button(20, 0, 13, 11, genBImageSrc(), function () {fb.RunMainMenuCommand("Playback/Repeat A-B/Mark B");switch_b();}, b_tooltip);
Buttons["R"] = new Button(30, 0, 13, 11, R_off, function () {fb.RunMainMenuCommand("Playback/Repeat A-B/Reset");reset_sw();}, r_tooltip);
No Foobar? No music

WSH Panel Mod script discussion/help

Reply #368
Code: [Select]
function genAImageSrc() {

return (a_sw & e_sw) ? A_on : A_off;
}

function switch_a() {

a_sw = !a_sw;
if (a_sw) {A_active = true};
Buttons.A.alterImage(genAImageSrc());
Buttons.A.repaint();
}

function genBImageSrc() {

return (b_sw & e_sw) ? B_on : B_off;
}

function switch_b() {

b_sw = !b_sw;
if (b_sw) {
B_active = true
if (!A_active) { // That's cause if we press B before pressing A the song will start looping frm the beginning to marker B so we wanna turn on A (even if its not so necessary)
A_active = true
a_sw = true
Buttons.A.alterImage(genAImageSrc());
Buttons.A.repaint();
}
};
Buttons.B.alterImage(genBImageSrc());
Buttons.B.repaint();
}

function genEImageSrc() {

return (e_sw) ? E_on : E_off;
}

function switch_e() {

e_sw =!e_sw
Buttons.E.alterImage(genEImageSrc());
Buttons.E.repaint();

if (!e_sw){
Buttons.A.alterImage(A_off);
Buttons.A.repaint();
Buttons.B.alterImage(B_off);
Buttons.B.repaint();
}
if ((e_sw) & (A_active)) {
Buttons.A.alterImage(A_on);
Buttons.A.repaint();
}
if ((e_sw) & (B_active) ){
Buttons.B.alterImage(B_on);
Buttons.B.repaint();
}
}

function reset_sw(){

a_sw = false;
b_sw = false;
e_sw =false
A_active = false
B_active = false
Buttons.A.alterImage(A_off);
Buttons.A.repaint();
Buttons.B.alterImage(B_off);
Buttons.B.repaint();
Buttons.E.alterImage(E_off);
Buttons.E.repaint();

}

function on_playback_new_track(){

reset_sw()
}

Buttons["E"] = new Button(0, 0, 13, 11, genEImageSrc(), function () { fb.RunMainMenuCommand("Playback/Repeat A-B/Enable");switch_e();}, e_tooltip);
Buttons["A"] = new Button(10, 0, 13, 11, genAImageSrc(), function () {fb.RunMainMenuCommand("Playback/Repeat A-B/Mark A");switch_a();}, a_tooltip);
Buttons["B"] = new Button(20, 0, 13, 11, genBImageSrc(), function () {fb.RunMainMenuCommand("Playback/Repeat A-B/Mark B");switch_b();}, b_tooltip);
Buttons["R"] = new Button(30, 0, 13, 11, R_off, function () {fb.RunMainMenuCommand("Playback/Repeat A-B/Reset");reset_sw();}, r_tooltip);

next time you can use "codebox" bbtag and omit those horid long posts

WSH Panel Mod script discussion/help

Reply #369
Hi,

I was using marc2003's rating script but it's not working anymore, nor is another one i found in another topic. They both show up just fine but when i click on the stars to set a rating, nothing happens.

Is there any change I could have done in the settings to brake it ?



WSH Panel Mod script discussion/help

Reply #372
the script doesn't use quick tagger. what if you try and use the context menu "Playback Statistics>Rating"? if that entry isn't there, you need to enable it under preferences>display>context menu. (the script needs this enabled to work)

also, the tracks you're trying to rate must be monitored as part of the media library.

WSH Panel Mod script discussion/help

Reply #373
You're right. I had removed it from the context menu, I'd never figure that out lol.

Thanks

WSH Panel Mod script discussion/help

Reply #374
Is there a way to retrieve playlist sizes and lengths?

I want to create my own playlist switcher but, I need that information.
<insert signature here>