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

WSH Panel Mod

Reply #325
Does anyone know how to show/hide a panel with this component? 
I'm talking about a panel inside a PSS.
This question has nothing to do with WSH Panel Mod. Please ask for help in the PSS thread.

[/s]Forget it, I misunderstood the question.

WSH Panel Mod

Reply #326
Does anyone know how to show/hide a panel with this component? 
I'm talking about a panel inside a PSS.
This question has nothing to do with WSH Panel Mod. Please ask for help in the PSS thread.


Are you sure ?

xbh just ask if there is a method to show hide panels from a WSH panel, so, according to me this thread is not a bad place.
as answered to xbh in PM, the solution i use is to create settings files for each variable we want to share with PSS, then we just have to grab the filename in PSS to get the value shared, and so, this variable can be a boolean for controlling the visibility of a panel in PSS.

WSH Panel Mod

Reply #327
I have a question about the timer:
Is it enough to kill the timer in on_playback_stop(reason) or do i have to kill the timer in on_playback_new_track(metadb) as well before starting it again for the next track?

WSH Panel Mod

Reply #328
WSH Panel Mod 1.1.10 now released.

@tedgo:
You can also Kill a timer in on_timer(id), for example:
Code: [Select]
function on_timer(id) {
     if (id != g_timer.ID) window.KillTimer(id);
}

WSH Panel Mod

Reply #329
Thanks for the hint
But please forgive my oafishness:
Do you mean instead of on_playback_stop() and somewehere else or in addition?

At the moment i use:
Code: [Select]
var active, g_timer, g_interval;
g_timer_started = false;

function on_timer(id){
window.Repaint();
}

function on_playback_new_track(metadb) {
if (metadb) {
if (fb.PlaybackLength < 0 || metadb.RawPath.indexOf("FOO_LASTFM" ) == 0)
active = false;
else
active = true;
}

if (active && !g_timer_started) {
g_interval = Math.max(Math.round(fb.PlaybackLength/(ww/100)), 100);
g_timer = window.CreateTimerInterval(g_interval);
g_timer_started = true;
}

window.Repaint();
CollectGarbage();
}

function on_playback_stop(reason) {
if (g_timer_started) {
window.KillTimer(g_timer);
g_timer_started = false;
}

window.Repaint();
}

EDIT:
And it doesn't work since i have two timers in my original script (v_timer = window.CreateTimerTimeout(3000); for indicating volume changes for 3 seconds).
Every time i change volume, the g_timer stops, when adding your line to on_timer(id).

WSH Panel Mod

Reply #330
@tedgo:
Why not using function on_volume_change(val) callback?
And, if you are using multiple timers, you should take care:
Code: [Select]
if (id != timer1 && id != timer2) window.KillTimer(id)

WSH Panel Mod

Reply #331
I use the on_volume_change(val) callback like this:
Code: [Select]
function on_volume_change(val) {
    if (!v_change) {
        v_timer = window.CreateTimerTimeout(3000);
        v_change = true;
    }

    window.RepaintRect(ww-170, 43, 170, 27);
}

to create the timer.
i fear i don't understand (again... you now i'm not the best ins scripting...)

WSH Panel Mod

Reply #332
I'm having the "unresponsive"/"refuse to load" script errors, too.

WSH Panel Mod

Reply #333
not too hot, I know, but just in case there are people, who want an exact linear behaviour of the volume slider (like percentage of volume), here´s the code to use for the template:

Code: [Select]
function len2vol(len) {
return (Math.pow(len, (1 / 10)) * 100) - 100;
}

function vol2len(vol) {
return Math.pow((100 + fb.Volume) / 100, 10);
}


WSH Panel Mod

Reply #334
Is there a way to get system colours in WSH panel mod?

WSH Panel Mod

Reply #335
Not that I know. Would be cool though. It would be really nice if we could get CUI global colours too, please, if possible!

WSH Panel Mod

Reply #336
Hm, that's sad.
I thought i could make a very lightweight config (without PSS/ELPlaylist) after finishing DarkOne v1.6.
But that would need at least getting system colours because i don't want to use Pseudo transparency...

And i agree, CUI global colours would be cool too.

WSH Panel Mod

Reply #337
When I asked about accessing system colors earlier in the thread, this post is the answer I got. I haven't really tested it (since I ultimately went another way rather than trying to access system colors programmatically) but perhaps it'll be helpful.

WSH Panel Mod

Reply #338
Hm, that's sad.
I thought i could make a very lightweight config (without PSS/ELPlaylist) after finishing DarkOne v1.6.
But that would need at least getting system colours because i don't want to use Pseudo transparency...

And i agree, CUI global colours would be cool too.


No ELPlaylist ! How can you simulate a playlist in WSH, i'm very interested in that ?

 

WSH Panel Mod

Reply #339
Ey, thanks
Haven't known this was asked before.

But it doesn't work here...

EDIT:
@falstaff
No, not the playlist in WSH
Although a friend and i experimented with XAML...
I wanted to create a light config with NG Playlist
But for the buttons, display and seekbar i will stick on wsh panel mod.

EDIT2:
This works by calling the name instead of a number:
Code: [Select]
function Syscolor(color_name){
    var Shell = new ActiveXObject("WScript.Shell");
    var rgbcolor = Shell.RegRead("HKEY_CURRENT_USER\\Control Panel\\Colors\\" + color_name);
    var tempc = rgbcolor.split(" ");
    return (0xff000000|(tempc[0]<<16)|(tempc[1]<<8)|(tempc[2]));
}

(Taken from a script by xbullethammer)

Call it like: Syscolor("MenuBar");

WSH Panel Mod

Reply #340
@falstaff
No, not the playlist in WSH
Although a friend and i experimented with XAML...
I wanted to create a light config with NG Playlist
But for the buttons, display and seekbar i will stick on wsh panel mod.


i've planned to write a full WSH config too, but i keep ELPlaylist until WSH will be able to code a playlist itself (request for TP WANG for sure )

WSH Panel Mod

Reply #341
Would love to see such a possibility to code a playlist in wsh or a whole config
That was the reason for me and a friend to try creating an UI besides columns ui using xml (and wsh).
But we gave up since it was very power consumptive and slooooooooooooooooow...

WSH Panel Mod

Reply #342
Question again  :
I wanted to use the new MetaRemoveFiel(name) but haven't got luck.

Did i used it correctly?

var metadb = fb.GetNowPlaying();
var fileinfo = metadb.GetFileInfo();

fileinfo.MetaRemoveField("rating");

But nothing happens...
What did i made wrong?

WSH Panel Mod

Reply #343
@tedgo:
You need update it.
Code: [Select]
metadb.UpdateFileInfo(fileinfo);

However, it's not recommended, it better to use:
Code: [Select]
metadb.UpdateFileInfoSimple("rating", "");


WSH Panel Mod

Reply #344
Oh, okay thanks.
I thought its a better method to delete the uneeded field with your new MetaRemoveField.
So i'll keep on metadb.UpdateFileInfoSimple("rating","");

WSH Panel Mod

Reply #345
T.P Wang, what about those "unresponsive"/"refuse to load" script errors?

WSH Panel Mod

Reply #346
@T.P Wang
I just requested something on the PSS thread, but it appears that the developer of PSS is busy or something soo....

I was wondering if I can invoke or create popups from the main menu, I know that I can add every action one by one into my own popup, but it would be too awkward because it would need to be updated if the menus change... Digging through the interfaces.txt I saw that is possible get the contexmenu, is it possible to get the individual popups on the menu bar? if not, could you add a way to do that? Please?

Thanks!
<insert signature here>

WSH Panel Mod

Reply #347
Hey,

I'm trying to replace foo_run web buttons with a wsh panel. With some trial and error got it almost working, just can't figure out how to include title formatting "$replace(%album artist% %album%, ,+,&,and)" as var discogs2 in the below script. Any tips?
Code: [Select]
function on_mouse_lbtn_down(x, y) {
    var metadb = fb.GetFocusItem();

    if (metadb) {
        var fileInfo = metadb.GetFileInfo();
        var discogs = fileInfo.MetaValue(fileInfo.MetaFind("DISCOGS_RELEASE_ID"), 0);
        var discogs2 = fileInfo.???

        if (discogs)
            WshShell.run("http://www.discogs.com/release/" + discogs);
        else
            WshShell.run("http://www.discogs.com/search?type=all&q=" + discogs2);
    }
}

WSH Panel Mod

Reply #348
try this?

Code: [Select]
var discogs2 = fb.TitleFormat("$replace(%album artist% %album%, ,+,&,and)").Eval(true);

WSH Panel Mod

Reply #349
You might want it to eval with metadb:

var discogs2 = fb.TitleFormat("$replace(%album artist% %album%, ,+,&,and)").EvalWithMetadb(metadb);