Shop Mobile More Submit  Join Login
Jscript library search 1.1 by thanhdat1710 Jscript library search 1.1 by thanhdat1710
A Jscript for JScript Panel v1.1.13+ , foobar2000 panel for CUI or DUI

Using explorer and search music in your library,


Feature:
    - Search library.
    - Explorer by Relative Path,Album, Artist, Genre, User define.
    - Smooth scroll.
    - Quick Search by type in panel.
            + Type string to fast navigation ,
            + Use key  ',' (<) or '.' (>) to fast navigation between it.
    - Navigation by arrow key.



Important note:

    - Change to Jscript9 to improve performance



Update 22/5/2016
 
- Update to run in Jscript Panel
- Auto update library
- Fix display when text overflow
- Improve performance, in my lib 8000+ song, it take about : 
    + < 200 ms to load lib (both folder structure);
    + only 1 -> 3 ms for search.



Update 17/5/2015:

-Add Quick Search(auto scroll )
-Improve performance(about 0.035 ->  0.4 second for my library +75000 song, and no lag)


Update 1/9/2013:

- Copy, Paste, Cut,Undo or Redo in text box with keyboard shortcut.
- Fix some error.

Update 2/9/2013:
- Improve performance.

Update 5/9/2013:
- Improve performance.(Upto 100%)

Update 23/10/2013:
-Fix the panel doesn't redraw when you restore foobar2000 window after a minimize.
Add a Comment:
 
:iconbr3tt:
Br3tt Featured By Owner May 22, 2016  Hobbyist Interface Designer
Thanks for the update, i'll test it asap :)
Reply
:icondu22y:
du22y Featured By Owner Edited Sep 15, 2015
Hello!
Help me please to solve problem with "&", it shows like this "_"...
like in this screenshot... She _Him ---> She & Him or She And Him
i.imgur.com/DV8AGPH.png

script
pastebin.com/NMC4CZcD
:)
Reply
:iconthanhdat1710:
thanhdat1710 Featured By Owner Sep 17, 2015
this is your script with fix:pastebin.com/ne33uPCc.
and this is newest version : pastebin.com/cbD4dTbX.

ps : I think the option DT_WORD_ELLIPSIS(0x00040000) is bad perfomance for draw panel , and this made higher cpu when scroll.

Sorry for bad English.
Reply
:icondu22y:
du22y Featured By Owner Sep 18, 2015
Thanks a lot for the script with fix and a new script;)
DT_WORD_ELLIPSIS -- I've added just for the test and see how it will work, thanks for the hint.

in new script, mouse scroll and font zoom does not work until you comment "//" in line 1162, step/= 120;
:)
Reply
:iconmarkkoenig:
Markkoenig Featured By Owner Sep 13, 2015
Ok, I'm gonna pull your sweater once more.

Is there a way to organize the grouping process with $if() conditions? For instance, I have vinyl rips, with tags like this : %album artist% %album% %disc% %totaldiscs% %side% %totalsides%. I can add them to the tree, but it always creates nodes even when there's no %disc% or %side% tag. So it's with or without.

Then I tried to bypass the Properties window and add it directly in one of the grouping presets, as well as my usual first grouping parameter, %genre%.

Problem 1 : 
When I add the %genre% parameter as the first, it only adds a second %artist% node in the tree. But when I give it "case 2", then it appears at the right place, after %artist% and %album%.

pastebin.com/F94e2vAf
               
Problem 2 :
When I add the %disc% and %side% parameters, it still creates empty nodes whenever there's no %disc% or %side% tag.

pastebin.com/7ukj4vCp


I'm not even a beginner in this, but I guess I have to modify something elsewhere. Thanks for the help.
Reply
:iconthanhdat1710:
thanhdat1710 Featured By Owner Edited Sep 17, 2015
 - For problem 1 : this is script`s bug , and this is fix version : pastebin.com/cbD4dTbX

 - For problem 2 : for empty nodes, i think you can change grouph_property to : 
 ' $caps(%genre%)|$caps($if(%album artist%,%album artist%,Unknow Artist))|$caps($if(%album%,%album%,Unknow Album))$caps($if(%disc%,|Disc %disc%,))$caps($if(%side%,|Side %side%,)) '
instead use switch-case in new version.

Sorry for bad English.
Reply
:iconmarkkoenig:
Markkoenig Featured By Owner Sep 18, 2015
Nevermind, it crashes as well.
Reply
:iconmarkkoenig:
Markkoenig Featured By Owner Sep 18, 2015
Hmm... it crashes when I configure the library path. Console indicates the error comes from this line :         list = fb.GetLibraryItems();
But when I import the script currently in the skin, and change plman.GetPlaylistItems(pl_idx) to the line above, it doesn't seem to crash at all.
Reply
:iconthanhdat1710:
thanhdat1710 Featured By Owner Sep 18, 2015
Oh, i`m sorry. new version of script only run on wsh panel with version above 1.5.8.beta1 because fb.GetLibraryItems(), that function help to improve time to load library.
newest version of wsh panel mod : www.hydrogenaud.io/forums/inde…
Reply
:iconmarkkoenig:
Markkoenig Featured By Owner Sep 18, 2015
Oh, right, I should have thought of that, I kept the previous to avoid making changes. I'll look into it, thanks.
Reply
:iconthanhdat1710:
thanhdat1710 Featured By Owner Edited Sep 18, 2015
Sorry , for old version, i have quick fix in two function :

function indexer(){
    ....
   switch(grouph_by){
       .....
       default:
           for(var i = 0;i < total;i++){
                // Change this line
               index_path[i] = fb.TitleFormat(grouph_option).EvalWithMetadb(list.Item(i)).split("|")[0];
           }        
       break;
   }


function get_fol_path(item,lv){
   switch(grouph_by){
       .....
       default:
           // Change this line
           return (fb.TitleFormat(grouph_option).EvalWithMetadb(item).split("|")[lv]) || "aaaaaa";
       break;
   }
}


and change   change grouph_property to 
'
$caps(%genre%)|$caps($if(%album artist%,%album artist%,Unknow Artist))|$caps($if(%album%,%album%,Unknow Album))$caps($if(%disc%,|Disc %disc%,))$caps($if(%side%,|Side %side%,))'
Reply
:iconjepiebrilo:
jepiebrilo Featured By Owner Edited Aug 7, 2015
Thank you for this great script! I would like to replace Album List with it and I have a few questions regarding "Group by Path" view:
1. Is it possible to add drag and drop function?
2. How can I hide root folders to show only sub-folders of the music library?
3. It would be great if numbers in brackets show correspondingly the number of sub-folders (artists) in genre folders, the number of albums in artist folders and the number of songs in album folders. Also I've noticed that folders with one artist/album in them haven't got any numbers at all (instead of (1)).

I've took a screenshot and added notes for better explanation: i.imgur.com/sD8NBrc.png
Also I've got this error on some themes (Safe Mode is disabled): i.imgur.com/m3dZkGG.png
Reply
:iconthanhdat1710:
thanhdat1710 Featured By Owner Aug 8, 2015
1: You can choose music in panel and drop out to play.
2: See this  Photo to solve .
3: I will add that function then.

Thanks you for your feedback.

Sorry for bad English.
Reply
:iconjepiebrilo:
jepiebrilo Featured By Owner Edited Aug 8, 2015
Thank you for your quick reply.

1. Yes, I can drag and drop albums to the playlist, but they are always added to the bottom of it. I mean I can't place album in the middle or at the top of the playlist. And with Album List I can do it: i.imgur.com/lcn3Yot.png
2. Works great! Thanks.
3. I would appreciate that. And not just me, I think. This script combines the best features from Album List+Library Tree+Quick Search Toolbar.

Also what about error? I'm trying to add the script to CatRox theme, but no success so far. :(
Reply
:icondu22y:
du22y Featured By Owner May 8, 2015

Hello!
Help please to remove the top search string i don't get it how?

And raise the list of folders in place of the search string.
really need any help.;-)
Sorry for my bad English

Reply
:iconthanhdat1710:
thanhdat1710 Featured By Owner May 17, 2015
sorry for delay, this is your need.
pastebin.com/7pnQYm8E
Reply
:icondu22y:
du22y Featured By Owner May 17, 2015
Hi ! Yes this is what I need. Thank you very much.;-)
Reply
:iconmarkkoenig:
Markkoenig Featured By Owner May 1, 2015
I'm really trying to make this work, but the sorting options... I just do not get it. Where are they? Where is the "User" grouping scheme? How do I stop the script from sorting my entire library track by track in different subfolders?
Reply
:iconthanhdat1710:
thanhdat1710 Featured By Owner May 17, 2015
you can right click > preference > properties 

www.flickr.com/photos/vothanhd…
Reply
:icontarkus721:
tarkus721 Featured By Owner Nov 28, 2013
"Add to Playing Playlist" always adds after the first track in the playing playlist, when it should (I would think) at the end of the playing playlist.
Reply
:icontarkus721:
tarkus721 Featured By Owner Nov 3, 2015
I'm a little late with a reply... Thanks! :)
Reply
:iconbr3tt:
Br3tt Featured By Owner Sep 6, 2013  Hobbyist Interface Designer
another problem that you have to resolve (possible, i've fixed it in my mod) is that the panel doesn't redraw when you restore foobar2000 window after a minimize. check, you'll see that a mouse hover is require to enforce a repaint of main area and a click in top box to redraw it too. It's due to that on restore, a repaint() is automatically generated but repaint_main or repaint_f still set to false, so panel stay black on restore :p
Reply
:iconthanhdat1710:
thanhdat1710 Featured By Owner Sep 6, 2013
yes, i will fix it.
Reply
:iconmire777:
mire777 Featured By Owner Sep 6, 2013
Is it possible to search, not only Library but single playlist?
To replace Quick Search component with  WSH.
I played a little with Br3tt Library Search, and add some genre preset, and change the look: pastebin.com/0h1Tqn93
I love how it works, the most important thing is usability...
Reply
:iconbr3tt:
Br3tt Featured By Owner Sep 6, 2013  Hobbyist Interface Designer
yes posibble by modding the script, because for now it work on a playlist too, generated on launch, so, you just have to tell to the script which playlist to use as "source" for populating the tree.
Reply
:iconmire777:
mire777 Featured By Owner Sep 6, 2013
Great, thank you..
Reply
:iconmarkkoenig:
Markkoenig Featured By Owner Sep 5, 2013
Well, I replaced the Library Tree in slowboyfast's Placebo Monolithic skin with this one, at first the background was black, then I did something it was transparent just as I wanted, and then, after restarting foobar, the background came black again, and though I've checked every possible parameter, I cannot find the reason why nor the way to have the transparency back. I might need some help, if you have time.
Reply
:iconthanhdat1710:
thanhdat1710 Featured By Owner Sep 5, 2013
dont forget tick "Pseudo Transparent" in script editor.
Reply
:iconmarkkoenig:
Markkoenig Featured By Owner Sep 10, 2013
I had done it, but it didn't seem to do anything. Anyway, I've tried to work it out differently, and now my problem is that I don't find a way to have a semi-transparent background, as you can see for example on the Playlist panel : fav.me/d6l4p2a Besides, I have troubles setting my folders : I fought to have the Y:\ directory you see, but it's impossible to add another one, even though I deleted the first directory ; it doesn't change anything whether I set it up in your panel's configuration window or in the Media Library prefs tab of foobar, or both. I must have missed something.
Reply
:iconmarkkoenig:
Markkoenig Featured By Owner Sep 10, 2013
Don't mind the directory issue, got it fixed in one sec -_-'
Reply
:iconmarkkoenig:
Markkoenig Featured By Owner Sep 11, 2013
Alright, seems like another transparency setting or some layer/layout confusion was messing this up. Fixed.
Reply
:iconbr3tt:
Br3tt Featured By Owner Sep 2, 2013  Hobbyist Interface Designer
another issue, always in get_library() => if library folders are mulltiples, for example, i examine D:\MP3 and E:\Music\MP3\, the grouph_by = 0 give multiples groups D:\MP3 and E:\Music\MP3\, and just because the OrderByRelativePath used in this function is not adapted, you have to use the SortByFormat method on %path% TF parameter.

list.OrderByFormat() to add in get_library to fix the sort issue when grouph_by >0...

(grouph_by == 0) && list.OrderByFormat(fb.TitleFormat("%path%"), 1);
(grouph_by > 0) && list.OrderByFormat(fb.TitleFormat((grouph_by == 3)?grouph_option:art_alb_sort), 1);

HTH
Reply
:iconbr3tt:
Br3tt Featured By Owner Sep 1, 2013  Hobbyist Interface Designer
here is my modded script look: img69.imageshack.us/img69/3299…
Reply
:iconbr3tt:
Br3tt Featured By Owner Sep 1, 2013  Hobbyist Interface Designer
thanx to you
Reply
:iconbr3tt:
Br3tt Featured By Owner Sep 1, 2013  Hobbyist Interface Designer
may i report 2 little issues?
... i do :p
1) "&" char badly handled on gdiDrawText if you don't add DT_NOPREFIX option (0x00000800), happens on my genre "R&B" displayed  "RB" ==> easy to fix
2) problem to expand not working at all on an artist branch when it contains an album which the name is the the artist name itself! (album self titled). example: "Franz Ferdinand" album from artist "Franz Ferdinand" !
renaming %album% to Franz_Ferdinand has solved temporaly the issue, but fix needed please.

I've modded on_paint() to draw head_ appart in order to use a fixed width font for (+) and (-) and a special color too, far better IMHO ;)
Reply
:iconthanhdat1710:
thanhdat1710 Featured By Owner Sep 1, 2013
the problem caused by caused by function tree_expant(obj) and i fixed it.
Reply
:iconbr3tt:
Br3tt Featured By Owner Sep 1, 2013  Hobbyist Interface Designer
thanx, far better :)

FYI, on resize panel, type search top panel is not refreshed, i've added "repaint_f = true" in on_size() Callback.
Reply
:iconbr3tt:
Br3tt Featured By Owner Sep 1, 2013  Hobbyist Interface Designer
little question: Why do you set a timeout of 5 second before calling get_pl_tree() ?
thanx by advance.
Reply
:iconthanhdat1710:
thanhdat1710 Featured By Owner Sep 1, 2013
 the function get_pl_tree() is run very slow, so i think it make foobar start slowly if don't set timeout. I will try optimize that funtion. thanks for your question. 
Reply
:iconbr3tt:
Br3tt Featured By Owner Sep 1, 2013  Hobbyist Interface Designer
personnaly, on a library of +45000 tracks, it takes less than 1500 ms to populate the tree, and i've set the starter Timeout to 100ms, it's far better IMHO :p
Reply
:iconthanhdat1710:
thanhdat1710 Featured By Owner Sep 1, 2013
can you test performance for it.
Reply
:iconbr3tt:
Br3tt Featured By Owner Sep 1, 2013  Hobbyist Interface Designer
finnaly, are you sure it's a better way to populate ? because it finally takes more time than previous method even if display is present faster, but we can't scroll untill the process is finished when we expand a node, so, no really usable until the end of the load :( (scroll is ok if no node expanded during the load, maybe just a fix to code?)
Reply
:iconthanhdat1710:
thanhdat1710 Featured By Owner Sep 3, 2013
im try to fix but it is very hard, i think i have to find other solution
Reply
:iconbr3tt:
Br3tt Featured By Owner Sep 3, 2013  Hobbyist Interface Designer
i do it differently o,n the script mod posted on your profile Deviant page, have you checked it ?
Reply
:iconthanhdat1710:
thanhdat1710 Featured By Owner Sep 5, 2013
oh,i have checked it, it very cool and faster my script before, the panel is filled immediatle.
and i had optimized my script, in my library of +6000 track, it take  30ms -> 50ms to search, can you test performance for it?
Sorry for late.
Reply
(2 Replies)
:iconthanhdat1710:
thanhdat1710 Featured By Owner Sep 5, 2013
oh,i have checked it, it very cool and faster my script before, the panel is filled immediatle
but i had optimized my script, in my library of +6000 track, it take 110ms to populate the tree and  30ms -> 100ms to search

Reply
Add a Comment:
 
×


Details

Submitted on
June 6, 2013
File Size
10.0 KB
Link
Thumb
Embed

Stats

Views
9,659 (1 today)
Favourites
6 (who?)
Comments
60
Downloads
926
×