WSH Panel Mod script discussion/help. |
![]() ![]() |
WSH Panel Mod script discussion/help. |
Jun 1 2012, 19:04
Post
#1701
|
|
![]() Group: Members Posts: 2771 Joined: 12-November 06 Member No.: 37463 |
@Brett (from Brett)
my contrib extracted from by fooRazor config as a stand alone panel, here is a more elaborated button than combine playback order button with Stop After Current button, just copy/paste this script in a WSH panel, grab it here: http://pastebin.com/gv0sWFq5
This post has been edited by Falstaff: Jun 1 2012, 19:06 -------------------- http://br3tt.online.fr/
|
|
|
|
Jun 1 2012, 22:47
Post
#1702
|
|
|
Group: Members Posts: 80 Joined: 26-March 09 Member No.: 68393 |
The reason it won't work is that you need access to the gr object in order to call the function gr.SetTextRenderingHint(...). This access is granted by gr being provided to the on_paint function as a parameter. I see.... So I can't put "SetTextRenderingHint(5);" instead to make it a global setting either I take it? |
|
|
|
Jun 1 2012, 23:17
Post
#1703
|
|
|
Group: Members Posts: 144 Joined: 1-May 09 From: Austin, TX Member No.: 69413 |
I see.... So I can't put "SetTextRenderingHint(5);" instead to make it a global setting either I take it? Nope, that function would fail because it doesn't exist. What are you trying to avoid by not calling gr.SetTextRenderingHint inside on_paint? This post has been edited by MordredKLB: Jun 1 2012, 23:17 |
|
|
|
Jun 1 2012, 23:52
Post
#1704
|
|
|
Group: Members Posts: 80 Joined: 26-March 09 Member No.: 68393 |
|
|
|
|
Jun 1 2012, 23:54
Post
#1705
|
|
|
Group: Members Posts: 74 Joined: 14-January 10 From: France Member No.: 77118 |
Hi!
Is there a way, in a WSH panel, to get information (%title%, %album%...) about the song to be played next in the playing playlist (assuming the playback order is default, of course) ? I'm trying to write a panel for a "Stop after Album" button but for now all I can do is to compare the track number of the playing track with the %totaltracks% defined for the track that was playing when I triggered the button (sorry if I'm not clear) Most of the time it works but sometimes no: if there is no %totaltracks% defined or if, in my playlist, the last song from one certain album to be played (before playing another track from another album) is not the actual last track of this album (for with %tracknumber% == %totaltracks%) Thanks in advance -------------------- Decalicatan Decalicatan
|
|
|
|
Jun 2 2012, 03:22
Post
#1706
|
|
|
Group: Members Posts: 144 Joined: 1-May 09 From: Austin, TX Member No.: 69413 |
I've got two themes, one of which I'd like to disable the toolbar in.
I added fb.RunMainMenuCommand("View/Show Toolbars") to my on_init which works great, but there's no way to determine whether the toolbars were toggled on or off. It always just returns true. I'm assuming the answer is no, but is there any way to get the check state of the menu command first? |
|
|
|
Jun 2 2012, 15:14
Post
#1707
|
|
![]() Group: Members Posts: 476 Joined: 5-June 11 Member No.: 91257 |
I have a row of buttons in a WSH panel.
One of the buttons is for opening the containing folder, and this is the line in the script: CODE but8: new Button((bw*7) + left_margin,top_margin,bw,bh, {normal: images_path + "open-folder.png", hover: images_path + "open-folder_h.png"}, function(){fb.RunContextCommand("Open containing folder");}, "Show the NOW PLAYING item's containing folder") My problem is the above button ONLY works with the now-playing item in the playlist, but I also want a button which will work with my selection(s). That is, if I select item(s) in the playlist I would like to click a button which will open the containing folder of the selected items AND NOT the playing item. Does anybody know the right code for this 'other' containing folder action? thanks. |
|
|
|
Jun 2 2012, 20:32
Post
#1708
|
|
![]() Group: Members Posts: 30 Joined: 15-January 11 From: Russia Member No.: 87344 |
Why is my requezt ignored, so you express your attitude to the Russian people? Post #1611? #1686 -------------------- ♪ ♪ ♪ (((d[^_^]b))) ♪ ♪ ♪
|
|
|
|
Jun 2 2012, 21:46
Post
#1709
|
|
![]() Group: Members Posts: 47 Joined: 17-April 12 Member No.: 98918 |
@bulletproof2k
Post #1686 was your question. Post #1611 is your answer, read it to find what you are looking for. |
|
|
|
Jun 2 2012, 22:21
Post
#1710
|
|
![]() Group: Members Posts: 30 Joined: 15-January 11 From: Russia Member No.: 87344 |
Why is my requezt ignored, so you express your attitude to the Russian people? Post #1611? Thanks for the answers, but I need just such as Screen Shot #1686 -------------------- ♪ ♪ ♪ (((d[^_^]b))) ♪ ♪ ♪
|
|
|
|
Jun 3 2012, 10:52
Post
#1711
|
|
![]() Group: Members Posts: 122 Joined: 5-October 08 From: Estonia Member No.: 59398 |
WSH digital VU meter updated!
video preview here script here This post has been edited by ExtremeHunter: Jun 3 2012, 10:59 |
|
|
|
Jun 3 2012, 16:08
Post
#1712
|
|
|
Group: Members Posts: 74 Joined: 8-September 11 Member No.: 93574 |
WSH_Browser : first alpha
Hello. This time i'm not here for another stupid noob question This is a "graphical" (well, not really for now but it will become) library browser component for WSH panel mod. ![]() Currently you can define up to 5 views to browse your library (using the window properties). Each view uses it's own grouping scheme (using title format strings), sort order and filter so you can use views to simulate multiple libraries if you want to. When you click on a "button" in the main view, tracks in this group will be added to a playlist so you can see them and do anything you can do with tracks. In addition the view will be updated to show the next "level" of filtering. EG : if you group by %genre%%album artist%%album% and click on genre "Metal", all metal tracks will be added to the playlist and the view will change to show your Metal bands. When you click on the last level of the view (typically album name) the tracks will be sent to a different playlist and playback will switch to that playlist. The actual bahaviour will probably be tweaked but those are the main features. This is an alpha release so it's still very rough, and probably unstable. This is also my very first attempt at jscript/javascript programming so i expect experienced users to find some big beginner mistakes. That's actually the reason i post the script in such an early state. In particular, i'm really unsure whether the way i work with metahandles list (and several copies of them @Fallstaff i would be really happy to know what you think of my approach as you have experience with sorting lots of tracks in WSH. I had a look at your CoverFlow but didn't really understood how you are storing the handles in groups. I was unable to store handles directly in an array so i had to create several IFbMetadbHandleList objects. Here is the script on pastebin You will also need two additional files : Constructors.js and Helpers.js |
|
|
|
Jun 3 2012, 18:21
Post
#1713
|
|
![]() Group: Members Posts: 2771 Joined: 12-November 06 Member No.: 37463 |
@r0k
good to see such project! but ... first try, it doesn't work ==> foobar2000 not responding (for 5 minutes now....), my libray is big (~40k trks), i suspect your script is not for large library, but what's its maximum size to make it work? before checking a script, i'd like to see it running well, if not, i'm not interrested ... other stuff is waiting, so i'll wait a next version of your script maybe with some restrcitions info in comments to indicate in which way somebody can test it EDIT: hmm, works better on another try, lag just the time to populate the WSH playlist... i'll check your script asap. Careful, mousewheel make content disapear... This post has been edited by Falstaff: Jun 3 2012, 18:58 -------------------- http://br3tt.online.fr/
|
|
|
|
Jun 3 2012, 19:08
Post
#1714
|
|
|
Group: Members Posts: 5 Joined: 21-January 12 Member No.: 96597 |
I made a small piece of code, use it as WSH panel on its own or place it into your other script. Clicking on the panel will toggle SACT mode and inform you what is going on. CODE var font_1 = gdi.Font("Tahoma",10,1); var color_1 = RGB(235,235,235); var DT_LEFT = 0x00000000; function on_paint(gr){ var ww,wh; ww = window.Width; wh = window.Height; gr.FillSolidRect(0, 0, ww, wh, RGB(0,0,0)); if(fb.IsPlaying){ text = (fb.IsPlaying && fb.StopAfterCurrent) ? "SACT" : "NO SACT"; gr.GdiDrawText(text, font_1, color_1, 0, 0, 60, 10, DT_LEFT); } } function RGB(r, g, b){ return (0xff000000 | (r << 16) | (g << 8) | (b)); } function on_mouse_lbtn_down(x, y, mask){ if(!fb.IsPlaying) return; fb.RunMainMenuCommand("Playback/Stop After Current"); } function on_playlist_stop_after_current_changed(state){ window.Repaint(); } Wow! Thanks for the speedy replies! Unfortunately for me, I have no scripting knowledge and do not fully comprehend the WSH Panel Mod. I have a specific UI Layout and settings that never change on my player. I need to keep this layout and settings while adding the described option in this old post of mine... ** My only issue with foobar2000 is that I don't have visual notification when I have activated a "Stop After Current" command. In my use, I have playback follows cursor. It would be great to have the highlighted cursor able to change color to red when stop after current is selected. ** If someone out there is willing to create a script for me, and walk me through the setup, I would be more than happy to make a donation for their services to their PayPal account. Please send a PM if interested. Thanks. |
|
|
|
Jun 4 2012, 02:54
Post
#1715
|
|
|
Group: Members Posts: 80 Joined: 26-March 09 Member No.: 68393 |
Has anyone written a media library browser such as an expandable tree view in wsh panel mod?
|
|
|
|
Jun 4 2012, 09:05
Post
#1716
|
|
![]() Group: Members Posts: 122 Joined: 5-October 08 From: Estonia Member No.: 59398 |
Not possible, because we cant get media library MetadbHandleList to WSH panel mod.
I hope this feature is added in the future. |
|
|
|
Jun 4 2012, 09:33
Post
#1717
|
|
![]() Group: Members Posts: 2771 Joined: 12-November 06 Member No.: 37463 |
Not possible, because we cant get media library MetadbHandleList to WSH panel mod. you can't say that. It's possible through another way based on a playlist that contains the library, but for sure this method is not perfect because this playlist has to be populated before being available for the script. I hope this feature is added in the future. yep, let's hope it's possible for T.P Wang as we have: // Get all items into an instance of IFbMetadbHandleList from specified playlist IFbMetadbHandleList GetPlaylistItems(playlistIndex); we'd like to have too something like this: // Get all items into of IFbMetadbHandleList from Media Library IFbMetadbHandleList GetMediaLibraryItems(); This post has been edited by Falstaff: Jun 4 2012, 09:33 -------------------- http://br3tt.online.fr/
|
|
|
|
Jun 4 2012, 10:53
Post
#1718
|
|
|
Group: Members Posts: 74 Joined: 8-September 11 Member No.: 93574 |
@r0k good to see such project! but ... first try, it doesn't work ==> foobar2000 not responding (for 5 minutes now....), my libray is big (~40k trks), i suspect your script is not for large library, but what's its maximum size to make it work? Not sure what the maximum size is. My library is about 4500 tracks so much smaller than yours and this script has only been tested on my computer so far. Well, that's a feedback on it's own so i know i need to improve the way i gather handles. QUOTE before checking a script, i'd like to see it running well, if not, i'm not interrested ... other stuff is waiting, so i'll wait a next version of your script maybe with some restrcitions info in comments to indicate in which way somebody can test it EDIT: hmm, works better on another try, lag just the time to populate the WSH playlist... i'll check your script asap. Careful, mousewheel make content disapear... I understand. I'll be improving it anyway. As stated i consider it an alpha, not even a beta, but i posted it anyway because a single experienced hint might improve the script more than one week of my noob work In the current script, i have a check to prevent mousewheel from scrolling before line 1 but nothing to prevent it from scrolling past last line (this one has to be calculated first). Scrolling up should bring content back if you go too far. This will be added by the time i release the first "beta". Not possible, because we cant get media library MetadbHandleList to WSH panel mod. you can't say that. It's possible through another way based on a playlist that contains the library, but for sure this method is not perfect because this playlist has to be populated before being available for the script. That's exactly the workaroud i used to gather the MetadbHandleList in my browser above. Actually, here is what i did (so you don't have to look at my code). I have defined a MetaDB custom object constructor. In my script i create such an object. It has the following properties :
The following methods are available :
My browser could probably be modified to show a tree view. I might add it later, but it's currently an early alpha and i won't add features until it's working smoothly on bigger libraries and the current features and interface are polished enough. |
|
|
|
Jun 4 2012, 16:20
Post
#1719
|
|
![]() Group: Members Posts: 30 Joined: 15-January 11 From: Russia Member No.: 87344 |
WSH_Browser : first alpha!!!
http://www.flickr.com/photos/bulletproof2k/ My genres for iTunes and foobar2000 This post has been edited by bulletproof2k: Jun 4 2012, 16:25 -------------------- ♪ ♪ ♪ (((d[^_^]b))) ♪ ♪ ♪
|
|
|
|
Jun 4 2012, 19:16
Post
#1720
|
|
|
Group: Members Posts: 14 Joined: 22-April 09 Member No.: 69184 |
WSH_Browser : first alpha In my system (core2duo E7400 2GB ram winxp) and with my 57000 tracks library, it works from the first run. There is a lag of about 5 seconds switching from alphabetic and genre view, like that switching in ColumnsUI filters; only facets in DUI is faster. I like your project because i need a simple interface to easily control with a 7" touchscreen monitor, but i'm not a programmer and my last one ![]() created with tabbed columnsUI filters (and the help of ExtremeHunter for the seekbar! I can't help you in programming, but if you need a beta-tester with a large library... I'm here Good work Fabio |
|
|
|
Jun 7 2012, 09:46
Post
#1721
|
|
|
Group: Members Posts: 74 Joined: 8-September 11 Member No.: 93574 |
Thanks for the encouragement and feedback.
Actually, i didn't even think about touchscreens but i can see how a simple visual interface can be useful for those. I'll try to keep them in mind for further developpment. "Beta test" will be open, so you are free to participate Well, speaking of my script, i'm running into a bad hang currently. I'm trying to get the path that's common to all items in a group, in order to search this path for artwok to show (artist picture, album cover ...) and avoid the need to keep a copy of every artwork inside the artwok folder where non-path related artwork (eg genres will be kept). However my code is making foobar2000 hang idefinitely (like i'm running an endless loop I've narrowed the hang to this part of the code : CODE // Search for a common path to all items in the group. __path = __hnd.Path; if (this.groups[__groupName].path) { // if true there is already a path stored, find common path __path = __path.split("\\"); // Split into an array of folder names. __pathOld = this.groups[__groupName].path.split("\\"); for (var i = (__path.length-1); i>=0; i--) { // Check every item, starting by the end if (i >= __pathOld.length) { // if current path is longer than stored path void __path.pop(); // remove last item from current path continue; // begin next iteration } else if (__path[i] == __pathOld[i]) { // compare last item of stored and current path this.groups[__groupName].path = __pathOld.join("\\"); break; // break the loop and keep the path as it is now } else { void __path.pop(); // reduce the path one level towards the root void __pathOld.pop(); } } } else this.groups[__groupName].path = __path; // store path of the first track And more precisely, the for loop part. It shouldn't loop forever, i'm decresing i at each loop and the condition is i>=0. Can someone tell me what noobish mistake i made? This post has been edited by r0k: Jun 7 2012, 09:48 |
|
|
|
Jun 7 2012, 13:19
Post
#1722
|
|
|
Group: Members Posts: 30 Joined: 27-January 09 Member No.: 66042 |
Can someone tell me what noobish mistake i made? From a quick glance I can't see an obvious problem, however you could try using a reverse while-loop instead (as you're already decrementing). Something like: CODE var i = __path.length - 1; while (i--) { // (The stuff that was in the for loop goes here) } Replacing the loop should prove whether or not the problem is the loop (and a reverse while may be more efficient anyway). This post has been edited by rawny: Jun 7 2012, 13:21 |
|
|
|
Jun 7 2012, 14:44
Post
#1723
|
|
![]() Group: Members Posts: 2771 Joined: 12-November 06 Member No.: 37463 |
adding fb.trace("i = "+i) in the loop may help you to find what's wrong with your loop ...
-------------------- http://br3tt.online.fr/
|
|
|
|
Jun 7 2012, 15:05
Post
#1724
|
|
|
Group: Members Posts: 74 Joined: 8-September 11 Member No.: 93574 |
re: while loop
I try to stay away from while loops as they seem more prone to endless loop (they are easier to code badly @Falstaff I already have some console output, thought not at this place. But i can't look at the console as fb2k itself will hang, not just the panel EDIT : never mind, just found the "write log" checkbox in the console. EDIT 2 : nay, even with "write log" checked, i don't get any console output at all when hangs occur. Not even output from statements that are executed before the loop goes crazy FINAL EDIT OK, i got it working, but can someone explain me why : CODE var i=0; do { if (__path.charAt(i) != __pathOld.charAt(i)) break; // path no longer common, break the loop } while(i++ < __pathLen); __path = __path.substr(0,i); // keep only the common part __path = __path.substr(0,__path.lastIndexOf("\\")); // don't consider path after the last backslash ... Does not work, but CODE var __totoIsBack=0; do { if (__path.charAt(__totoIsBack) != __pathOld.charAt(__totoIsBack)) break; // path no longer common, break the loop } while(__totoIsBack++ < __pathLen); __path = __path.substr(0,__totoIsBack); // keep only the common part __path = __path.substr(0,__path.lastIndexOf("\\")); // don't consider path after the last backslash ... does This post has been edited by r0k: Jun 7 2012, 15:49 |
|
|
|
Jun 7 2012, 16:31
Post
#1725
|
|
|
Group: Members Posts: 1 Joined: 7-June 12 Member No.: 100496 |
Hi! Is there a way, in a WSH panel, to get information (%title%, %album%...) about the song to be played next in the playing playlist (assuming the playback order is default, of course) ? 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. CODE function on_playback_new_track(current_track) {
var next_track = current_track; // get next track if (plman.IsPlaybackQueueActive()) { // check first item in queue next_track = plman.GetPlaybackQueueContents().toArray()[0].Handle; } else { var i = plman.GetPlayingItemLocation().PlaylistItemIndex; var pl_items = plman.GetPlaylistItems(plman.PlayingPlaylist); if (i + 1 == pl_items.Count) { // current_track is the last item in playlist } else if (i > pl_items.Count) { // current_track is no longer in the playlist fb.StopAfterCurrent = true; return; } else { next_track = pl_items.Item(i+1); } } // ALBUM_TF is something like fb.TitleFormat(window.GetProperty("ALBUM TF", "%album artist% %album%")); if (ALBUM_TF.EvalWithMetadb(current_track) != ALBUM_TF.EvalWithMetadb(next_track)) { fb.StopAfterCurrent = true; } else { fb.StopAfterCurrent = false; } } This post has been edited by jijoo: Jun 7 2012, 16:33 |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 18th June 2013 - 06:59 |