Skip to main content

Topic: WSH Panel Mod script discussion/help (Read 844233 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
WSH Panel Mod script discussion/help
Reply #2525
add this function to your wsh panel script

function on_mouse_rbtn_up(x, y) {
    return true;
}

  • drm200
  • [*]
WSH Panel Mod script discussion/help
Reply #2526
thanks.  adding that fixed the problem ... I'm not sure how I could have figured that out on my own ...

  • mire777
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2527
Hi ExtremeHunter, last time I tried your spinning disk script (for the current version of wsh panel mod, the rotation wan't as smooth as I expected. Is it possible to simulate the effect on this website: http://fanart.tv/artist/477b8c0c-c5fc-4ad2...uuren-van-armin (scroll down to the CDART section)?



I don't see problem in animation. You can simulate that smooth efect from website..
I got the same speed and smooth like in website..

Go to script and set ''angle += 1''
, and  ''var rotationInterval = 15;'' .

Set rotationInterval speed how you like..
Hope that helps..
  • Last Edit: 09 August, 2013, 11:55:20 AM by mire777

  • mire777
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2528
I made a modified xch4nge menu, which allows you to easily add as much panel and WSH scripts in CUI, as you want: http://mire777.deviantart.com/art/xch4nge-...oobar-359868460
But I noticed that when you starting foobar, if you have a lot of WSH panel, it parsing all WSH script together at startup.. Even if you don't have all that panel active, it start all WSH, and thus slows down the rising time.
Is there a way to make something, which would specify to raise only selected WSH scripts in selected panel at startup, and others to be inactive?
Or to specify that in each script separately ?
I'm trying to find a way to disable-enable installed WSH script at startup...
  • Last Edit: 10 August, 2013, 06:02:20 AM by mire777

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2529
you can try the delay load checkbox in the editor. but having numerous scripts really shouldn't affect startup time much at all. i guess it depends on what your script does. i have 17 scripts in my layout and it adds 0.2 seconds to the startup time compared to without. that's nothing in the grand scheme of things.

  • mire777
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2530
you can try the delay load checkbox in the editor. but having numerous scripts really shouldn't affect startup time much at all. i guess it depends on what your script does. i have 17 scripts in my layout and it adds 0.2 seconds to the startup time compared to without. that's nothing in the grand scheme of things.

Well i have 12 scripts, and startup time is 0.04 sec. It's nothing, but it would be good to add something, that would (disable-enable) script that I don't use that often.
Maybe some WSH client, with dropdown menu, then i can choose, what script i want to use in that panel..
But I don't know if it would help at all..

  • mire777
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2531
Marc, i edited your script to show 'album art' on my WSH 1.4.2. , and it works beautifuly. There's no better script anywhere. No image distortion at all, like in other script i try.
But i have small problem, when i click on button in xch4nge to enlarge panel, image  for a short shaking, then stop.
It happens especially when the image is large..
Do you know what causes this? And can you help me to  fix this?

Here is script: http://pastebin.com/pCTpyvDD

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2532
But i have small problem, when i click on button in xch4nge to enlarge panel, image  for a short shaking, then stop.


i have no idea what you mean by this. all i know is that my script behaves just like any other panel when resized normally in a standard default UI or columns UI layout. i'm certainly not downloading the theme to test it.

perhaps the issue is with the panel stack splitter code used to resize panels? have you tried other panels in its place?

  • mire777
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2533
But i have small problem, when i click on button in xch4nge to enlarge panel, image  for a short shaking, then stop.


i have no idea what you mean by this. all i know is that my script behaves just like any other panel when resized normally in a standard default UI or columns UI layout. i'm certainly not downloading the theme to test it.

perhaps the issue is with the panel stack splitter code used to resize panels? have you tried other panels in its place?



I tested, it behaves normal in DUI, but in xch4nge it has some interaction with WSH panel stack splitter, because it has fast resizing..
Sorry I bothered you with that...

  • kjllmeplz
  • [*]
WSH Panel Mod script discussion/help
Reply #2534
May I ask a question, How to show or hide a Columns UI panel using WSH script ?

  • Falstaff
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2535
May I ask a question, How to show or hide a Columns UI panel using WSH script ?


quick reply on the way to do it but not a full example (not time and no example on the hand ... just how i've done it in my skin TECH for example ==> http://br3tt.deviant.art)

So, the only way i've found (and use) is to use file as parameters, to share/update panel status between a WSH panel (the WSH panel create the file, update its status on action in the WSH panel) and a Panel Stack Splitter in Columns UI (use the $findfile command to read the file created from WSH panel to get the value of the status, 0 panel is to hide (cf. $showpanel ... commands , read Panel Stack Splitter help file for more information)

that's it.

for example, if i want to hide/show a panel like "album list", in the WSH panel, i create in a settings folder (i.e foobar2000/WSH_settings/) the file "albumlist_0"
and in the PSS panel, i get the last character of the filename that begins with "albumlist_" with $right($findfile(albumlist_*),1) and so i retrieve "0" or "1", depending of that value with a $select, i execute a $showpanel_c(...) set to visible or hidden of the album list panel...

tips, when updating the file from WSH, to force Panel Stack Splitter to refresh, you have to code in the WSH panel a Pause & Play foobar2000 command
there is the function i use to do it:
Code: [Select]
function RefreshBG() {
    if(fb.IsPlaying||fb.IsPaused) {
        fb.RunMainMenuCommand("Playback/Play or Pause");
        fb.RunMainMenuCommand("Playback/Play or Pause");
    } else {
        fb.RunMainMenuCommand("Playback/Play");
        fb.RunMainMenuCommand("Playback/Stop");
    }
}

HTH
  • Last Edit: 19 August, 2013, 02:53:45 PM by Falstaff

  • kjllmeplz
  • [*]
WSH Panel Mod script discussion/help
Reply #2536
@Falstaff : Thanks you so much!
  • Last Edit: 20 August, 2013, 01:14:47 AM by kjllmeplz

  • hkg196418
  • [*]
WSH Panel Mod script discussion/help
Reply #2537
I am sorry, May I ask is it possible to drag&drop new songs like below?

for example:

playlist before drag&drop
1. SONG ONE
2. SONG TWO

playlist after drag&drop (I want to drop "SONG THREE" between "SONG ONE" and "SONG TWO")
1. SONG ONE
2. SONG THREE
3. SONG TWO

but not
1. SONG ONE
2. SONG TWO
3. SONG THREE

I am now viewing the old replies on this post, but it's very long, hope anyone can help me.

thank you very much
  • Last Edit: 29 August, 2013, 06:28:47 PM by hkg196418

  • Noose6767
  • [*]
WSH Panel Mod script discussion/help
Reply #2538
Could someone tell me where to download the latest samples from please ?
(I think i'm interested in thumbs.txt and last fm bio etc)

The links I've found here seem to be down

Thanks a lot

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2539
here: https://dl.dropboxusercontent.com/u/22801321/wsh/samples.zip

make sure to check the readme. also, i saw your other post about reading the contents of a text file. there is a script in here called simple text reader which can do that.

  • derty2
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2540
ExtremeHunter

I've been playing around again with your Spinning Disc Image Viewer script, version 2013-08-08, which you pasted online here [pastebin.com] .

I've been editing your script for the past few hours, trying to create a context menu having these three items:
------------------------------
Open folder of this disc
Open folder of this panel
Configure...

-------------------------------

The context menu works except for one problem . . . . . Selecting "Open folder of this disc" opens the "Now Playing" folder and the active track is selected in Windows Explorer.
Unfortunately, this is not what I want . . . . . What I want is to open the folder containing the current spinning disc image and the image is selected in Windows Explorer.
Here is the code I have added to your script:
Code: [Select]
var WshShell = new ActiveXObject("WScript.Shell");
var fso = new ActiveXObject("Scripting.FileSystemObject");
MF_GRAYED = 0x00000001;
MF_STRING = 0x00000000;

function on_mouse_rbtn_up(x, y) {
    metadb = fb.GetNowPlaying();
    var folder_path_disc = metadb ? metadb.Path : "";    
    var folder_path_panel = fb.ProfilePath + "user-addons\\wsh-spinning-disc-image";
    var _menu = window.CreatePopupMenu();
    var idx = 0;
    _menu.AppendMenuItem(fso.FileExists(folder_path_disc) && metadb ? MF_STRING : MF_GRAYED, 1,  "Open folder of this disc");
    _menu.AppendMenuSeparator();
    _menu.AppendMenuItem(fso.FolderExists(folder_path_panel) && metadb ? MF_STRING : MF_GRAYED, 2,  "Open folder of this panel");
    _menu.AppendMenuSeparator();    
    _menu.AppendMenuItem(MF_STRING, 100, "Configure...");
    idx = _menu.TrackPopupMenu(x, y);
    if (idx == 1) try {
        WshShell.Run("explorer /select," + "\"" + folder_path_disc + "\"");        
        }            
        catch(e) { }
    if (idx == 2) try {
        WshShell.Run("explorer /n," + folder_path_panel);        
        }            
        catch(e) { }        
    if (idx == 100) window.ShowConfigure();
    _menu.Dispose();
    return true;    
}


NOTES:
I use foobar2000 in portable mode.
All default resources used for this panel are contained in one folder: "<fb2k_dir>\user-addons\wsh-spinning-disc-image\"
All disc image targets for the script are placed at the same location as the tracks.

ONE MORE QUESTION:
If I was to add one more context menu item named Help, and if this is selected a Message Box pops up with some text,
does anybody have the code for doing this?
  • Last Edit: 11 September, 2013, 07:03:10 PM by derty2

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2541
Code: [Select]
fb.ShowPopupMessage("Some help text.", "Window title");


you can put in \n if you want line breaks. i'll let Extremehunter answer the rest.

edited: i forgot you can customise the window title as well but it's optional. if you omit it, it will just display WSH Panel Mod.
  • Last Edit: 11 September, 2013, 07:26:27 PM by marc2003

WSH Panel Mod script discussion/help
Reply #2542
  • Last Edit: 12 September, 2013, 06:44:07 AM by ExtremeHunter

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2543
i think derty2 was asking for it to work in portable mode. this line of code only works on a standard install.

Code: [Select]
var folder_path_panel = WshShell.ExpandEnvironmentStrings("%APPDATA%") + "\\foobar2000\\user-addons\\wsh-spinning-disc-image";


you should use fb.ProfilePath as that caters for both scenarios. it points to %appdata%\foobar2000 when running a standard foobar install. if running a portable install, it points directly at the foobar2000 program folder.

WSH Panel Mod script discussion/help
Reply #2544
I know fb.ProfilePath .

I misunderstood  "<fb2k_dir>\user-addons\wsh-spinning-disc-image\"

I tried to access default installation %appdata% <fb2k_user_profile_dir> from portable version
  • Last Edit: 12 September, 2013, 08:23:23 AM by ExtremeHunter

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2545
Quote
<fb2k_dir>


i'd assume that to mean the program folder, not %appdata%\foobar2000.

your code would only work if his portable install was inside his %appdata% folder. why hardcode something when you have the flexibility to let people use whatever mode they like and if using portable mode, they can put their foobar folder anywhere and it will just work.

edit: i see you've edited your post. hopefully it's cleared up now.
  • Last Edit: 12 September, 2013, 08:27:20 AM by marc2003

  • mire777
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2546
Sorry for the stupid questions, but i need help.
Which function to call to cycle image. I want to cycle the front, back and icon image, and set time delay for that.
Here is script: http://pastebin.com/jvQ9z6Jc

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2547
this might work (untested)

Code: [Select]
window.SetInterval(function() {
    a.id++;
    if (a.id > 4) a.id = 0;
    a.metadb_changed();
}, 5000);


the 5000 is milliseconds. you can edit that bit.

  • mire777
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2548
this might work (untested)

Code: [Select]
window.SetInterval(function() {
    a.id++;
    if (a.id > 4) a.id = 0;
    a.metadb_changed();
}, 5000);


the 5000 is milliseconds. you can edit that bit.


I got error: object doesn't suport that property or metod. i guess that is because i use wsh 1.4.2.

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #2549
Code: [Select]
var timer = window.CreateTimerInterval(5000);

function on_timer() {
    a.id++;
    if (a.id > 4) a.id = 0;
    a.metadb_changed();
}