WSH Panel Mod script discussion/help. |
![]() ![]() |
WSH Panel Mod script discussion/help. |
Jun 7 2012, 16:35
Post
#1726
|
|
|
Group: Members Posts: 175 Joined: 22-March 07 Member No.: 41742 |
I am not really familiar with WSH coding but I was wondering whether someone could solve the delay problem in marc playcount script? The delay is when a track is submitted for loved/unloved.
|
|
|
|
Jun 7 2012, 16:59
Post
#1727
|
|
|
Group: Members Posts: 30 Joined: 27-January 09 Member No.: 66042 |
Got it working! Glad to hear it Without seeing all of your code I can't tell for sure. Off the top of my head, the only explanation I can think of is that i is defined somewhere else (perhaps globally) and this is interfering with the loop. Beyond that...no idea... This post has been edited by rawny: Jun 7 2012, 17:08 |
|
|
|
Jun 7 2012, 17:37
Post
#1728
|
|
|
Group: Members Posts: 74 Joined: 8-September 11 Member No.: 93574 |
... I was wondering whether someone could solve the delay problem in marc playcount script? ... Well, delays tend to occur when the computer is busy doing something, so apart from removing some actions, i don't think it's possible. Now, i don't find this particular script. Maybe he released a new version of his samples after i downloaded them. Without seeing all of your code I can't tell for sure. Off the top of my head, the only explanation I can think of is that i is defined somewhere else (perhaps globally) and this is interfering with the loop. Beyond that...no idea... Ha, i'm such a noob I don't use variables such as "i" globally of course, only for loops ... But this loop was nested inside another loop ... using i as a counter of course. I was actually resetting i in the middle of the outer loop, causing it to become endless. And i was trying to find why the inner loop was endless |
|
|
|
Jun 7 2012, 17:58
Post
#1729
|
|
|
Group: Members Posts: 30 Joined: 27-January 09 Member No.: 66042 |
Ha, i'm such a noob I don't use variables such as "i" globally of course, only for loops ... But this loop was nested inside another loop ... using i as a counter of course. I was actually resetting i in the middle of the outer loop, causing it to become endless. And i was trying to find why the inner loop was endless Haha, I've been there before! It's sometimes more useful to use meaningful names for loop counters, just so when you get to the inner-loop you make sure you're using innerLoopIndex and not outerLoopIndex (although to be fair I only tend to do this when I'm coding something semi-serious, I should probably do it more often Glad you got it all figured out |
|
|
|
Jun 8 2012, 09:09
Post
#1730
|
|
|
Group: Members Posts: 74 Joined: 8-September 11 Member No.: 93574 |
I had the first (outer) loop coded several days ago, but only yesterday i decided to add statements to gather informations about my track groups. I totally forgot about the first loop.
What i should have done is code the comparator as an external function and take benefit of local variables. Speaking of local variables, it's probably obvious for some people, but in case it's not, i made a test. CODE // ==PREPROCESSOR== --> CONSOLE OUTPUT // @name "test" // ==/PREPROCESSOR== var toto = "toto is Global"; fb.trace("L6 "+toto); --> L6 toto is Global function test() { var toto = "toto is Local"; fb.trace("L10 "+toto); --> L10 toto is Local } function test2() { toto = "Heavy Metal never dies"; fb.trace("L15 "+toto); --> L15 Heavy Metal never dies } test(); fb.trace("L19 "+toto); --> L19 toto is Global test2(); fb.trace("L22 "+toto); --> L22 Heavy Metal never dies If a local variable is defined inside a function using var statement, even if a global variable has the same name, the global will not be overwritten. However, if var is omitted, the global will be overwritten. Furthemore, if a local variable is defined with var, then the variable is changed to another value, like in this second test CODE // ==PREPROCESSOR== --> CONSOLE OUTPUT // @name "test" // ==/PREPROCESSOR== var toto = "toto is Global"; fb.trace("L6 "+toto); --> L6 toto is Global function test() { var toto = "toto is Local"; fb.trace("L10 "+toto); --> L10 toto is Local toto = "Heavy Metal never dies"; fb.trace("L12 "+toto); --> L12 Heavy Metal never dies } test(); fb.trace("L16 "+toto); --> L16 toto is Global The change will affect the local variable, and not the global one. That's a good reason to get used to always use var |
|
|
|
Jun 9 2012, 08:33
Post
#1731
|
|
|
Group: Members Posts: 74 Joined: 14-January 10 From: France Member No.: 77118 |
I've used the following function to add a stop-after-album feature. The important parts are plman.GetPlaylistItems(plman.PlayingPlaylist), which give you the playlist's tracks in order, and plman.GetPlayingItemLocation().PlaylistItemIndex, which gives the index of the current track. That was exactly what I was looking for. Thank you -------------------- Decalicatan Decalicatan
|
|
|
|
Jun 10 2012, 18:26
Post
#1732
|
|
|
Group: Members Posts: 144 Joined: 1-May 09 From: Austin, TX Member No.: 69413 |
Is there anyway to hide the mouse cursor using WSH Panel? I'd love to be able to add a timeout in on_mouse_move to hide it after a few seconds of inactivity in my HTPC script.
|
|
|
|
Jun 10 2012, 20:44
Post
#1733
|
|
|
Group: Members Posts: 144 Joined: 1-May 09 From: Austin, TX Member No.: 69413 |
Even if there is a way to do this, I'm not sure it's possible because I get continuous on_mouse_move events whether the mouse is moving or not. Is this the way it's supposed to be, because it seems like a bug. I verified that it wasn't weirdness with my mouse by turning off my mouse and not touching the trackpad on my laptop.
This post has been edited by MordredKLB: Jun 10 2012, 20:45 |
|
|
|
Jun 11 2012, 08:49
Post
#1734
|
|
|
Group: Members Posts: 74 Joined: 8-September 11 Member No.: 93574 |
I can confirm on_mouse_move seems to trigger continually as long as the mouse is in the WSH panel area.
One way to work around this would be to store prevMouseXand prevMouseY in some variable/object and make a conditional check in on_mouse_move CODE if (prevMouseX != x || prevMouseY != Y) to know whether the mouse is actually moving or not. Here is some working code you can use if you can find a way to actually hide the cursor. I tried window.SetCursor(...); but there is no "hidden" option. CODE var prevMouseX = 0;
var prevMouseY = 0; var mouseActive = true; function hideCursor() { if (mouseActive) return; // Add some code to hide the mouse } function on_mouse_move(x, y) { if (prevMouseX != x || prevMouseY != y) { prevMouseX = x; prevMouseY = y; mouseActive = true; // Add some code to show the mouse } else { mouseActive = false; window.SetTimeout(function () {hideCursor();},1000); } } |
|
|
|
Jun 11 2012, 09:37
Post
#1735
|
|
![]() Group: Members Posts: 3291 Joined: 27-January 05 From: England Member No.: 19379 |
you can use a negative number to hide it.
CODE window.SetCursor(-1);
|
|
|
|
Jun 11 2012, 17:32
Post
#1736
|
|
|
Group: Members Posts: 74 Joined: 8-September 11 Member No.: 93574 |
Thanks for the tip marc2003
Well, while i'm here i could as well ask something. Is there a simple way of preventing on_mouse_lbtn_up() from trigerring it's effect when you double-click. Currently, if i double click, it will trigger on_mouse_lbtn_up twice and on_mouse_lbtn_dblclk once. That's logical but not very practical. I EDIT : Tested the delay, it works. Still willing to learn possible alternatives This post has been edited by r0k: Jun 11 2012, 17:47 |
|
|
|
Jun 11 2012, 17:56
Post
#1737
|
|
|
Group: Members Posts: 144 Joined: 1-May 09 From: Austin, TX Member No.: 69413 |
Thanks for the suggestions r0k and marc. I've got it working perfectly now. Here's my final code if anyone is interested:
CODE var state["mouse_x"] = 0; var state["mouse_y"] = 0; var hideCursor = 0; function on_mouse_move(x, y) { if (x != state["mouse_x"] || y != state["mouse_y"]) { window.SetCursor(32512); // arrow state["mouse_x"] = x; state["mouse_y"] = y; window.ClearTimeout(hideCursor); hideCursor = window.SetTimeout(function() { window.SetCursor(-1); // hide cursor }, 5000); } } That's how I'd handle a on_mouse_lbtn_up if forced to differentiate. I can't think of any other way right now. This post has been edited by MordredKLB: Jun 11 2012, 18:43 |
|
|
|
Jun 12 2012, 07:37
Post
#1738
|
|
|
Group: Members Posts: 40 Joined: 30-September 11 Member No.: 94073 |
after WSH VU meter appears im interested in other activex objects i can add to my wsh panel. i know about shell object, vbcontrol (but dont know how to use it), httpdocument, filesystem. and now its vumeter. is anybody knows any interesting object? as i remember, marc2003 posted somewhere script showing your soundcard name. can anybody writes something about it or show me where i can read abou that?
|
|
|
|
Jun 12 2012, 08:46
Post
#1739
|
|
![]() Group: Members Posts: 120 Joined: 5-October 08 From: Estonia Member No.: 59398 |
Well, there is AutoitX3 and DynamicWrapperX ActiveX components.
With these to components only the sky is the limit. You can send messages, get system handles, create 'AERO' glass and so on. |
|
|
|
Jun 12 2012, 19:27
Post
#1740
|
|
|
Group: Members Posts: 40 Joined: 30-September 11 Member No.: 94073 |
thanks, im also wanted for object to control file copy and transcoding audio by SOX otherwise shell. it will be nice if i get progress of each file.
now im using autoitx3 to control window size without standart windows borders, but in same way. and near aims - transcoding and file copy operations |
|
|
|
Jun 15 2012, 15:33
Post
#1741
|
|
![]() Group: Members Posts: 3291 Joined: 27-January 05 From: England Member No.: 19379 |
samples updated: http://dl.dropbox.com/u/22801321/samples.zip
musicbrainz releases: entries with no date now appear at end of list instead of the beginning |
|
|
|
Jun 17 2012, 03:43
Post
#1742
|
|
|
Group: Members Posts: 15 Joined: 2-May 12 Member No.: 99417 |
I just tried some samples by pasting and replacing the content in my WSH Panel (coverflow) already pretty working but I get this:
||Scripting Engine Initialization Failed (Playback Buttons by marc2003, CODE: 0x80020101) Check the console for more information (Always caused by unexcepted script error).|| |
|
|
|
Jun 17 2012, 11:15
Post
#1743
|
|
|
Group: Members Posts: 82 Joined: 27-May 10 Member No.: 80935 |
thank you Also big props Falstaff - your scripting has really made my layout appealing. But now the annoying request. Is there any way to get the playlist to collapse the album views, so tracks could be displayed or not via click (e.g. on heading/arrow/icon to expand/contract) and bonus points if the now playing album automatically expands. I'm essentially searching for something similar to ELplaylist that works in DUI. For example, this direction is great: http://www.hydrogenaudio.org/forums/index....st&p=799256 Artist overview (& album count) with chronologically listed albums, that then would expand to display track listings on click. Dare to dream I know, but any tips towards this direction (in DUI) would be much appreciated. thanks, .Mike This post has been edited by mjm716: Jun 17 2012, 11:47 |
|
|
|
Jun 17 2012, 12:54
Post
#1744
|
|
|
Group: Members Posts: 82 Joined: 27-May 10 Member No.: 80935 |
samples updated: http://dl.dropbox.com/u/22801321/samples.zip musicbrainz releases: entries with no date now appear at end of list instead of the beginning Nice it's always those little things! I hope you don't mind, but I added buttons for discogs & allmusic to your 'web links' (if it suits you, feel free to redistribute in your ZIP) button preview: http://desmond.imageshack.us/Himg195/scale...amp;res=landing New discogs+allmusic buttons here: http://www.mediafire.com/?kaywlua6nrtritl also note, the MySpace link has been updated to function correctly CODE // ==PREPROCESSOR==
// @import "%fb2k_profile_path%marc2003\common4.js" // @import "%fb2k_profile_path%marc2003\tooltip_buttons.js" // @name "Web Links" // @author "marc2003" // @feature "v1.4" // @feature "watch-metadb" // ==/PREPROCESSOR== var bw = 32; var bh = 32; var left_margin = 0; var top_margin = 0; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// var script_name = "Web Links"; var custom_background = window.GetProperty("custom_background", ""); var bg = window.GetProperty("bg", 102); selection_mode = 1; on_item_focus_change(); function on_size() { ww = window.Width; wh = window.Height; } function on_paint(gr) { buttons_background(gr); buttonsDraw(gr); } function on_playback_new_track() { on_item_focus_change(); } function on_metadb_changed() { if (!g_metadb) return; var myspace = fb.TitleFormat("http://www.myspace.com/search/music?q=$replace(%artist%, ,)").EvalWithMetadb(g_metadb); var lastfm = fb.TitleFormat("http://www.last.fm/music/$replace(%artist%, ,+,/,'%'252F,?,'%'3F)/_/$replace(%title%, ,+,/,'%'252F,?,'%'3F)").EvalWithMetadb(g_metadb); var youtube = fb.TitleFormat("http://www.youtube.com/results?search_query=$replace(%artist%+%title%, ,+,'(',,')',,/,+,&,and)").EvalWithMetadb(g_metadb); var discogs = fb.TitleFormat("http://www.discogs.com/search?q=$replace(%artist%, ,+,'(',,')',,/,+,&,and)").EvalWithMetadb(g_metadb); var allmusic = fb.TitleFormat("http://allmusic.com/search/artist/$replace(%artist%, ,+,'(',,')',,/,+,&,and)").EvalWithMetadb(g_metadb); Buttons = { but1: new Button(left_margin, top_margin, bw, bh, {normal: images_path + "myspace.png", hover: images_path + "myspace_h.png"}, function() { WshShell.run(myspace); }, myspace), but2: new Button(left_margin + bw, top_margin, bw, bh, {normal: images_path + "lastfm.png", hover: images_path + "lastfm_h.png"}, function() { WshShell.run(lastfm); }, lastfm), but3: new Button(left_margin + (bw * 2), top_margin, bw, bh, {normal: images_path + "youtube.png", hover: images_path + "youtube_h.png"}, function() { WshShell.run(youtube); }, youtube), but4: new Button(left_margin + (bw * 3), top_margin, bw, bh, {normal: images_path + "discogs.png", hover: images_path + "discogs_h.png"}, function() { WshShell.run(discogs); }, discogs), but5: new Button(left_margin + (bw * 4), top_margin, bw, bh, {normal: images_path + "allmusic.png", hover: images_path + "allmusic_h.png"}, function() { WshShell.run(allmusic); }, allmusic) } window.Repaint(); } function on_mouse_move(x, y) { buttonsMove(x, y); } function on_mouse_lbtn_up(x, y) { buttonsUp(x, y); } function on_mouse_leave() { buttonsLeave(); } function on_mouse_rbtn_up(x, y) { background_menu(x, y); return true; } This post has been edited by mjm716: Jun 17 2012, 13:10 |
|
|
|
Jun 17 2012, 14:24
Post
#1745
|
|
|
Group: Members Posts: 175 Joined: 22-March 07 Member No.: 41742 |
From one of the WSH script (from musickarte skin), the following error is displayed when I updated my WSH panel mod to the latest version 1.5.2.
Error: CODE JScript runtime error: Object doesn't support this property or method WSH error line: CODE var hWnd = utils.GetHWND("{E7076D1C-A7BF-4f39-B771-BCBE88F2A2A8}); It seemed that the method utils.GetHWND no longer exist in the latest version. I have no knowledge about WSH scripting and thus would need help on this issue. This issue had kept me from updating my previous WSH version (1.4.9) to the latest version |
|
|
|
Jun 17 2012, 17:05
Post
#1746
|
|
![]() Group: Members Posts: 2771 Joined: 12-November 06 Member No.: 37463 |
@D.Sync
official WSH Panel Mod had never used this method. It belongs to a modified version of WSH Panel Mod stuck in v1.4.x, support seems totally discontinued... to forget. -------------------- http://br3tt.online.fr/
|
|
|
|
Jun 18 2012, 15:10
Post
#1747
|
|
![]() Group: Members Posts: 407 Joined: 26-March 09 Member No.: 68400 |
I want to have a volume control that only shows when the mouse cursor is over it. I've searched for any mouse-over examples so I could modify T.P Wang's volbar code example, but haven't found anything. I know next to nothing about coding, and my attempts to find javascript documentation and learn how to do this on my own have not gone well. So I'm hoping someone can point me to an example I can work from, or show how it's done.
Thanks! This post has been edited by trout: Jun 18 2012, 15:12 |
|
|
|
Jun 18 2012, 15:42
Post
#1748
|
|
![]() Group: Members Posts: 3291 Joined: 27-January 05 From: England Member No.: 19379 |
@mjm716, thanks for those images. i've bundled them in and cleaned up the script a bit.
http://dl.dropbox.com/u/22801321/samples.zip @Ryoma, you should read the error you posted..... QUOTE Check the console for more information @trout, i don't have time now but if someone else doesn't answer before tomorrow, i might be able to knock something up for you. This post has been edited by marc2003: Jun 18 2012, 15:43 |
|
|
|
Jun 18 2012, 18:48
Post
#1749
|
|
|
Group: Members Posts: 15 Joined: 2-May 12 Member No.: 99417 |
|
|
|
|
Jun 19 2012, 14:39
Post
#1750
|
|
![]() Group: Members Posts: 3291 Joined: 27-January 05 From: England Member No.: 19379 |
|
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 25th May 2013 - 02:32 |