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

WSH Panel Mod

Reply #1450
Changelog:

v1.5.6
- FIX: 'Clear' button in Properties doesn't work since v1.5.5.

v1.5.5
- FIX: Fix a bug that preprocessor "tooltip" didn't work at all.
- ADD: Added GetColorScheme() method to IGdiBitmap interface.

==> please, consider to remove the FIX on tooltip added in V1.5.5, it makes WSH panel Mod unstable, may crashes (brutal with a black window named WSH Panel Mod that appear on freeze in the main foobar2000 window...

i hope all is fine for you, long time you are not been here.

Regards,

Br3tt

WSH Panel Mod

Reply #1451
Is there a foobar2000 javascript reference?

For example how should I know what properties "fb" object have? Or how to properly initiate a Button. And so on...

Thanks.

WSH Panel Mod

Reply #1452
Quote
what properties "fb" object have?


check interfaces.txt in the docs.

as for buttons, it's basically creating your own from scratch. at it's most simple you can draw an image/text and check the position of the mouse when it's clicked to trigger a function.

or you can write your own object. see tooltip.txt in the samples folder to get started.

WSH Panel Mod

Reply #1453
as for buttons, it's basically creating your own from scratch. at it's most simple you can draw an image/text and check the position of the mouse when it's clicked to trigger a function.

or you can write your own object. see tooltip.txt in the samples folder to get started.


Thanks.

Examined tooltip.txt. There is a constructor here:

Code: [Select]
function SampleButton(x, y, w, h, caption, func, tiptext) {
    // 'Constructor' stuff
    this.left = x;
    this.top = y;
    this.w = w;
    this.h = h;
    this.right = x + w;
    this.bottom = y + h;
    this.caption = caption;
    this.func = func;
    this.tiptext = tiptext;
...
}


But where is the object "SampleButton" declaration by itself? Where can I find the whole properties and functions list?

One more thing. What is this syntaxis?

Code: [Select]
ButtonStates = {
    normal: 0,
    hover: 1,
        down: 2,
    hide: 3
}


Could not find this initialization style in Java guides...

WSH Panel Mod

Reply #1454
Quote
But where is the object "SampleButton" declaration by itself?


right at the bottom in the on_size function.

and i think that other thing is just another custom bit of code written by the author. check the SimpleThemedButton sample.


WSH Panel Mod

Reply #1456
Nope. Its an array declaration.


and if you look inside the SampleButtons array, you'll find....

Code: [Select]
        stop: new SampleButton(5, buttonY, 60, 30, "Stop", function() {
            fb.Stop();
        },
        "Stop")


i don't really understand your 2nd point. like i said, it's custom code. it's what the author decided to do at the time. nothing more. there is no documentation other than the functions exposed in interfaces.txt and callbacks.txt. sometimes it hard to understand how it all works together which is why some samples have been bundled with the component. you may find they are not the most optimal way of doing things but it's a start.

remember you're not just limited to the built in functions. you can load activex objects to run external programs, manipulate files, access the internet, etc. that's all standard jscript which you can read about on MSDN.

WSH Panel Mod

Reply #1457
New to foobar this weekend  I've been on the couch for 9 hours now.

My question is about using last.fm to display pics and biographies. 

Even if the biography is showing the current artist bio, the artist pictures are replaced with folder art.

I can't figure this out!  Any advise would literally help me sleep tonight.

WSH Panel Mod

Reply #1458
vague post is vague. how is anybody supposed to know what you are talking about? i suppose you've found a last.fm script of some sort but unfortunately no one here is psychic enough to know which one.

also, you should probably post in this thread. this thread is really for component bug reports/feature requests/help with specific functions.

WSH Panel Mod

Reply #1459
i'm not sure whether it's worth reporting bugs as T.P doesn't seem to be around these days. hope he's ok.

i've found a problem with getting the name from a font object.

Code: [Select]
var font = window.GetFontDUI(0);
var name = font.Name;


for the majority of people, the name is going Segoe UI if their font is left at the default. i imagine most standard fonts are fine as well. no problem there.

but today someone reported that the function fails with Small Fonts. you get this error in the console....

Unable to get value of the property 'Name': object is null or undefined

upon checking the font properties, i see this...



looks like the Title has multiple values stored internally but WSH panel mod can't handle it. for now i'm catching errors and defaulting to a standard font.


WSH Panel Mod

Reply #1460
Marc (or anyone else): another quick request for some help with code 

My code for listing albums by compilations:

$if($strstr(%album artist%,Various Artists),
$puts(chr1,$upper($left(%album%,1)))
$if($strcmp($get(chr1),$lower($get(chr1))),$puts(chr1,'#'))
$get(chr1)[|%series%]|$swapprefix(%album%) ['('%date%')'][|'Disc '%disc number%][' - '%discname%]|[%tracknumber%. ]%track artist% - %title%' '['('%rating_stars%')'])

This lists compilations by letter, with all non-letters (i.e. numbers or symbols) listed under "#". It groups compilations by series then album.

I want to make one change but I'm not sure about the code - currently it moves the prefix to the end (which is what I want). However, it still lists the compilation under the letter of the prefix. For example, "The Summer of Love" is listed under the letter T as "Summer of Love, the".

I want it to be listed under the letter S as "Summer of Love, the". Any help with changing my code to do this? Many thanks!

WSH Panel Mod

Reply #1461
i have no idea why you've asked a bog standard album list title formatting question in this thread? 

but to answer it, you just need to use $swapprefix on the first instance of %album% in your code.

WSH Panel Mod

Reply #1462
I'm sorry I thought this is where I had asked it before! I remember you helping me out - thanks!

So like this?

$if($strstr(%album artist%,Various Artists),
$puts(chr1,$upper($left$swapprefix(%album%,1)))
$if($strcmp($get(chr1),$lower($get(chr1))),$puts(chr1,'#'))
$get(chr1)[|%series%]|$swapprefix(%album%) ['('%date%')'][|'Disc '%disc number%][' - '%discname%]|[%tracknumber%. ]%track artist% - %title%' '['('%rating_stars%')'])

It just lists in a long list and doesn't group by letter!

WSH Panel Mod

Reply #1463
It just lists in a long list and doesn't group by letter!


like this:

$if($strstr(%album artist%,Various Artists),
$puts(chr1,$upper($left($swapprefix(%album%),1)))
$if($strcmp($get(chr1),$lower($get(chr1))),$puts(chr1,'#'))
$get(chr1)[|%series%]|$swapprefix(%album%) ['('%date%')'][|'Disc '%disc number%][' - '%discname%]|[%tracknumber%. ]%track artist% - %title%' '['('%rating_stars%')'])

WSH Panel Mod

Reply #1464
Nice - thanks!!

WSH Panel Mod

Reply #1465
One other question - my sort by artist code looks like this:

$puts(artstr,$swapprefix($trim(%album artist%)))
$puts(chr1,$upper($left($get(artstr),1)))
$if($strcmp($get(chr1),$lower($get(chr1))),$puts(chr1,'#'))
$get(chr1)|$get(artstr)[|[%seriesyear% -] %series%]|[%date% - ]%album% ['('%copyright%', '%tdrl%')'][|'Disc '%disc number%][' - '%discname%]|[%tracknumber%. ][%track artist% - ]%title%'  '['('%rating_stars%')']

How can I get it to show the %tdrl% ONLY if it is different from the %date%? For example, if date and tdrl have the same value then %tdrl% should not be shown. But if they have a different value, then it should.

Thanks 

 

WSH Panel Mod

Reply #1466
just because i made the stupid mistake of answering your question last time doesn't mean you should continue to post completely off topic posts in this thread. 

WSH Panel Mod

Reply #1467
lol....aw...so whats the thread?

WSH Panel Mod

Reply #1468
search first. if you can't find anything related, start a new one in the General section. remember to use a descriptive thread title to keep the mods happy.

WSH Panel Mod

Reply #1469
Also: you might want to read the documentation on title formatting (html included within foobar installfolder linked to on multiple occasions throughout the program's preferences) and trying to figure this out yourself before searching(!) And asking....

WSH Panel Mod

Reply #1470
Not sure this has already be noticed by someone.  I have switched recently to Windows 8 (x64) and kept my old foobar2000 config (from W7 x64), with all WSHPM scripts.  They work as expected, except one thing.  The mouse wheel doesn't work in WSH panels any more.  More precisely, the delta of the on_mouse_wheel function is always 0.
In other words, this script prints some zeroes in the log when the wheel is activated:
Code: [Select]
function on_mouse_wheel(delta) {
    fb.trace(delta);
}

The wheel of my standard Microsoft mouse works correctly in all Windows programs and in Foobar2000, except in WSH panels.

The fact that the callback is called when the wheel is activated means that my mouse is correctly recognised, but the delta sent by the hardware is probably different than the delta of other mouses.  I've read somewhere that old mouses reports a specific delta value (maybe 64 and -64, but I don't remember), but recent mouses are more precise and may report small deltas such as 1.  That might be the case of my relatively recent mouse.  I guess that WSHPM divides the delta by 64 (or whatever) to convert it to 1 or -1, and that may be the reason why the result is always 0.  If it's the case, it it possible to fix that little bug in a forthcoming version?  Thanks in advance.

Also, I have not installed the M$ Mouse and Keyboard Center because imo it is useless, but iirc it was installed on my old system.  Could it be necessary?

WSH Panel Mod

Reply #1471
@r0lZ

similar problem already encoutered with some mouses, driver of the mouse to install to fix the problem... but right, the problem only occured in WSHPM, but as driver fix the issue, all is fine.

WSH Panel Mod

Reply #1472
Thanks, Falstaff.

According to the Device Manager control panel, my mouse did not need any driver.  But I have installed the M$ Mouse and Keyboard Center anyway.  (It's a pity btw.  I don't need its features, and it launches 7 additional programs at Windows startup!)  That was not sufficient to fix the problem.  I had to go to "Mouse And Keyboard Center -> Basic Settings -> Identify programs that don't scroll correctly" and select Foobar2000.  That fixed the problem, with a little drawback: now the non-WSH panels scroll more rapidly than before (approx 3 lines at a time instead of 1).  Not a big deal.

Furthermore, I've noticed that after a reboot, when F2K is launched immediately, the WSH panels do not scroll.  I have to wait at least one minute or so before they begin to work correctly.  I suppose it's because the Mouse and Keyboard Center takes a long time to start.

IMO, it's not really a driver issue.  The M&K Center is just an additional program to tune the mouse and keyboard behaviours with certain programs (mainly games), and should not be necessary for standard programs, such as F2K.  So, IMO, there is still something to fix in WSHMP.  Perhaps you should just test if the delta reported by the hardware is positive or negative, and convert it to 1 or -1 accordingly.  Just my 2 cents.

The issue is solved, that's right, but the fix is not perfect, and should not be needed.
Thanks anyway for the pointer.

WSH Panel Mod

Reply #1473
How do I get library RelativePath in wshpanel mod.
I`m coding "WSH libray search and viewer" but I don`t know how to get library RelativePath;
WSH library search

WSH Panel Mod

Reply #1474
@vothanhdat

you can't retreive it with WSH panel mod. the best way is to work with an autoplaylist that contains the whole library (e.g %path% PRESENT) and to browse it with plman.

HTH