Skip to main content

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

0 Members and 1 Guest are viewing this topic.
  • Mod-Ular
  • [*]
WSH Panel Mod script discussion/help
Reply #1525
Testing without my volumeknob atm. That should eliminate all 'clumsy' n00b-WSH-scripts, the rest is clean stuff from you or marc2003, so i am afraid they're not gonna make a big difference.

  'list.item[...].id' is null or not an object File: <main> Ln: 1678, Col: 3

I think further removal of all the WSH-panels is not gonna solve it as those scripts should be fine. What do you think? Just do it, or start prepping my config to send?

I thought u needed my complete setup. Total foo folder is 'round 200MB zipped. Database.dat is 80 MB  But yeah noprob. I'm not afraid of sharing my artwork, that is no prob, but really component and config folders are enough? Just tell me what u need and i'll send you my setup.

/quickedit, BTW i noticed the script doesn't crash when i load it from scratch in a default WSHmod-panel. IT only crashes AFTER a startup on the 2nd track that plays.
  • Last Edit: 26 April, 2012, 03:21:47 PM by Mod-Ular

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1526
@Mod-Ular, to rule out other scripts/components, i'd install another copy of foobar in portable mode.

copy configuration and playlist folders from your existing install.
i'd also install foo_playcount and foo_skip so your autoplaylists still work.
also copy database.dat and whatever file contains foo_playcount data (index-data folder i think??)

now add a WSH panel in default UI and see if you still get errors.

  • Mod-Ular
  • [*]
WSH Panel Mod script discussion/help
Reply #1527
Hmm, Marc good Idea. Thx
But now i know my own WSH-mods aren't causing this error, so at least i am not guilty of wasting falstaffs time due to my own bad coding

  • Falstaff
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1528
i don't know if it's another wsh panel mod that can be interact badly, or another component, for me the only way to find what's wrong with my script and your config, is to remove panels/components one by one and test it each time. As said, i don't need your database or playlist files, just the content of the components folder and the contents of the configuration folder. not so big

  • Mod-Ular
  • [*]
WSH Panel Mod script discussion/help
Reply #1529
Falstaff, I followed Marc's advice and set up a fresh standalone install. Basic DUI just added a console and WSH-panel with your playlist. No errors so far.
/edit If this gives an error i can send you this basic setup. Otherwise no prob to send my own setup but that might take a bit more time.
/edit bis. Sorry for my slowness, indeed comp, user-comp and config folder are just 7.12MB, i can send them very quickly if you want.

/last edit: Falstafff i send you a PM to get my zip in your hands. So far i get no errors in the simple DUI config, so yes step by step removing and excluding things seems to only way to go. A tedious job if you ask me (i've had enough for the moment)  I you feel up to it, you're welcome to bore yourself with my config. But please don't do it if you want to get it working just for me. Only put your time into it if you want your script to work everywhere (including here) ^^
  • Last Edit: 26 April, 2012, 04:18:49 PM by Mod-Ular

  • Mod-Ular
  • [*]
WSH Panel Mod script discussion/help
Reply #1530
     reloaded my own config a while ago and guess what: no more errors... 

  • Falstaff
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1531
PM just answered (was gone a while)

  • Mod-Ular
  • [*]
WSH Panel Mod script discussion/help
Reply #1532
As said above all of a sudden i am unable to reproduce the error.  Even with the setup that triggered it before. I'll keep you informed if it re-appears but for now it seems to 'solved' in a non-logical way. 

  • Mod-Ular
  • [*]
WSH Panel Mod script discussion/help
Reply #1533
/edit doublepost
  • Last Edit: 26 April, 2012, 06:38:30 PM by Mod-Ular

  • Falstaff
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1534
Br3tt, regarding the RemoveAccents function:

-- Why does "Æ" translate to "A" and not "Ae"?
-- Why does "Õ" translate to "0" (zero) and not an "O"?
-- Why does "ß" translate to a single "S" instead of double "Ss" (as it is in German)?

By the way, I really, really like this, and I think that you should continue working on this (and other WSH) scripts instead of configurations that utilize ELPlaylist and that Panel Stack thingy (which have been left without updates for quite some time).


yep, done too quickly, i'll fix that translation, thank you

  • r0k
  • [*][*]
WSH Panel Mod script discussion/help
Reply #1535
Hello.
This panel is really an  interesting tool, however it's hard to get started writing own script.
I've never scripted for WSH before. I have a basic understanding of JavaScript and a small experience with other languages. I had hoped reading the documentation and looking at some smaples would be enough to get started, but i'm having some issues and would like some clarifications.
  • In many samples, i've seen only functions and variables declarations. In normal JavaScript, functions are not called just by declaring them, they need to be called by the code somewhere. I havn't seen this in those samples. However i've seen various functions with names like on_something. Those are listed in the callbacks help file. Does it mean functions with those names will be automatically run when some events occur in foobar, without the need to link those functions to user actions?
  • Is there any syntax list for the foobar objects? Interfaces lists a small number of objects (window - IFbWindow //  gdi - IGdiUtils // fb - IFbUtils // utils - IWSHUtils // plman - IFbPlaylistManager) so i understand if i want to know the paused (or not)  status i need to read the fb.IsPaused property. But what if i want to access an interface that is not linked to an object, let's say "IFbTooltip". Can i access those using object statements with the name of the interface directly (like, say IFbTooltip.Activate() )
  • Does fooWSH have access otherl windows objects such as FileSystemObject ?
  • How do i declare an option to appear in the properties window of the panel?
  • Last Edit: 27 April, 2012, 04:31:02 AM by r0k

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1536
1) yes
2) at the start of the script...
Code: [Select]
var myvar = window.CreateTooltip();


then you typically use it within the on_mouse_move callback

Code: [Select]
myvar.Text = "blah blah";
myvar.Activate();


3) yes. i use all these...
Code: [Select]
var WshShell = new ActiveXObject("WScript.Shell");
var fso = new ActiveXObject("Scripting.FileSystemObject");
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
var doc = new ActiveXObject("htmlfile");
var vb = new ActiveXObject("ScriptControl");


you need to disable "safe mode" under file>preferences>tools>wsh panel mod for them to work.

4) look at window.GetProperty and window.SetProperty
  • Last Edit: 27 April, 2012, 04:38:59 AM by marc2003

  • r0k
  • [*][*]
WSH Panel Mod script discussion/help
Reply #1537
Thanks. I think i'll be able to better understand the examples now that i'll stop searching for function call statements 
Just one more precision.
2) at the start of the script...
Code: [Select]
var myvar = window.CreateTooltip();

Thanks for the example. If i got it right, any of the interfaces that's not in the "big 5" needs to be created as a new object first, by calling a method that's inside one of the "big 5"

  • r0k
  • [*][*]
WSH Panel Mod script discussion/help
Reply #1538
@ Falstaff
Is there a way to change the sorting of albums in your coverflow script? I like having albums sorted by date rather than title. I tried changing user.Group KEY setting as it was set to %albumartist%%album% and this was the way they were sorted but this didn't work.

  • Falstaff
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1539
@r0k

group key is the way tracks will be grouped, not sorted !

the coverflow panel has no sort option, because it's a panel that is for me in an add-on of a playlist viewer. So just sort your playlist or even without any playlist viewer, you can sort by using foobar2000 menu EDIT>Sort

if sorting pattern need to be adapted to your needs (those from File>Edit>Sort), you can modify them in foobar2000 File>Preferences>Advanced>Display>Standard Sort Pattern field

so, you can sort how you want, and group how you want too (that point you find it alone in Properties of the Coverflow panel)
  • Last Edit: 27 April, 2012, 07:31:57 AM by Falstaff

  • Mod-Ular
  • [*]
WSH Panel Mod script discussion/help
Reply #1540
I got some more indications Falstaff,
The crash re-occured but now i know i little bit more.
It ONLY happens after a fresh foobar startup. Doesn't matter if it's restarted in foobar or closed and re-started. Fresh boot, fresh windows login, all the same.
It does NOT happen after a fresh foobar start if i open the properties or configuration dialog of your playlist and hit OK (thus re-apply all settings?) before playback.
It does NOT happen if i use another standalone foobar before a fresh foobar start with my own config.
It does NOT happen if i've reloaded-renamed-re-imported a random or my own CUI-(pss-)config.

I recently noticed a very irritating stroboscope-like flickering when i load my setup. This could be just related to foo_uie_panel_splitter havin' some trouble reading my enormous stack. But sometimes its clearly just the WSHmod panels that go epileptic. Even without my own noobishly modded WSH-scripts. But i really suspect panelstacksplitter in bein the trigger for this behavior.
And i also suspect foo_uie_esplaylist from having some (or more) memoryleaks. (If i enable Browse Library my RAM thinks its getting free beer)

BTW, got another one for you
[14:21:11] Error: WSH Panel Mod (WSH Playlist Viewer v2 beta 7.3 v0.0.7.20120426.1900 by Br3tt aka Falstaff >> http://br3tt.deviantart.com): Microsoft JScript runtime error:
Object expected File: <main> Ln: 2541, Col: 5 <source text only available at compile time>

This happened after updating my interface with an pss-button (no commands just an imagebutton with the REFRESH option)
The effect achieved is that all splitters are hidden/rescaled/reshown and so refreshing all the scripts they contain.
I've done this a zillion times without any problems (while using your playlist)
But this time i did queue-up some tracks, within your playlist. (via contextmenu)
The tracks played like they should. On the last queued track before trackchange to the next (end of queue so in my usercase a) random track i did the 'Refresh'.
You're script halted on opening the next track. Not been able to reproduce. Tried several times witth the same procedure and some slight variations.
  • Last Edit: 27 April, 2012, 09:14:34 AM by Mod-Ular

  • Falstaff
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1541
thank you for all these informations, i ain't tested your config, i will asap, but no time for now, maybe next tuesday, i'll give you feedback about my investigations!

  • r0k
  • [*][*]
WSH Panel Mod script discussion/help
Reply #1542
the coverflow panel has no sort option, because it's a panel that is for me in an add-on of a playlist viewer. So just sort your playlist or even without any playlist viewer, you can sort by using foobar2000 menu EDIT>Sort

The issue is that edit->sort needs to be re-done each time the playlist is refreshed as it's not memorized by the playlist. At least i didn't found a way to have the Library Selection playlist remember sorting options (even playlist attributes does not help for sorting).
I'm using Coverflow as the final selection step after filtering my collection with Facets. I have Facets set to send selection to Library Selection and coverflow locked on Library Selection. Works great except for sorting.
Quote
if sorting pattern need to be adapted to your needs (those from File>Edit>Sort), you can modify them in foobar2000 File>Preferences>Advanced>Display>Standard Sort Pattern field

What do you mean by File>Edit>Sort? Do you mean the patterns from Edit>Sort? There is no Edit submenu in my File menu.  (i have foobar2000 v1.1.11)

EDIT : Found this method SortByFormat(playlistIndex, pattern, selOnly = false) in IFbPlaylistManager interface. I guess that's what i need to add some sorting if i can't find a built-in way to sort Library Selection playlist. Modding your Coverflow will be one of my first real exercises in JScript coding if you don't mind
  • Last Edit: 27 April, 2012, 11:17:47 AM by r0k

  • Mod-Ular
  • [*]
WSH Panel Mod script discussion/help
Reply #1543
@Falstaff Take your time, there is nothing urgent about it. I'm just trying to keep you informed and hopefully avoid some work on your bughunt:)
Meanwhile, i had the last one again. Microsoft JScript runtime error: Object expected File: <main> Ln: 2541, Col: 5 <source text only available at compile time>
Did nothing special, foobar playing in the background while surfing a bit.

  • Falstaff
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1544
@Falstaff Take your time, there is nothing urgent about it. I'm just trying to keep you informed and hopefully avoid some work on your bughunt:)
Meanwhile, i had the last one again. Microsoft JScript runtime error: Object expected File: <main> Ln: 2541, Col: 5 <source text only available at compile time>
Did nothing special, foobar playing in the background while surfing a bit.


LOL sorry, this error is a "true" bug, my fault on beta 7.3, so try to install again beta 7.3 from here !! this bug has nothing to do with previous ones, still a mistery from now !!!!

http://pastebin.com/Cj94ZBWE

EDIT: testing your config (you're mad, you know!!) , but not crash for me
  • Last Edit: 27 April, 2012, 11:51:15 AM by Falstaff

  • Mod-Ular
  • [*]
WSH Panel Mod script discussion/help
Reply #1545
Thx, updated.
Yup, i know i'm mad. Even got an official certificate for it. ^^

  • Falstaff
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1546
@r0k



of course you can mod the coverflow panel to fit your needs

  • r0k
  • [*][*]
WSH Panel Mod script discussion/help
Reply #1547
OK. That's the sort i used. As you wrote File>Edit>Sort i was unsure whether there was a hidden submenu somewhere. foobar2000 is the sort of programs where you can find new functions even after using it for a long time (and i havn't used it for such a long time actually).

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1548
funny you should say that.... you can find many more commands on the menus if you hold down the shift key before clicking.

  • Falstaff
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1549
WSH Playlist Viewer v2 beta 8: http://pastebin.com/u/Br3tt

* bug fixes (cursor ain't follow focus on selection change in another panel (e.g. Coverflow))
* playlist for the queue Removed for now (not reliable engough for now, will be back later)
* 2 new sort presets (by date & by genre)
  • Last Edit: 28 April, 2012, 04:43:06 AM by Falstaff