Old 21st March 2005, 03:13   #1
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
ml_tree prototype

Ive done up a quick tree view thing for the Media Library which is starting to look quite nice. Its purely ML based, so everything is loaded from the ML, which means building the tree requires indexing and consolidating every item into the final tree. Im quite surprised at how well it works though, and will make something out of it eventually.

The great thing is I can have this plugin group on other things as well, such as genres, artists, years etc. Its similar to how mexp does its grouping.

Obviously, this is just a prototype, and is quite buggy. It will eventually have a nice list view with full meta data support, drag,drop, "send to" and other context menu support, explorer context menus etc. I may even allow custom columns using ATF, kinda how the columns ui works in fb2k. But will see how much of a hit to performance that will be.

Once again, this is a prototype,ie. buggy. Dont bother with bug reports or feature requests or 'why wont this work?' nonsense.

Known bugs: Crashes if no results are found from the query, the other edit box does nothing, clicking on song items does nothing, crashes on exit sometimes, very buggy if you change views while it is searching, the scroll bar isnt skinned and occasionally loses ability to be clicked, shows one less item in the view than there should be/ etc

All these issues and more are easy enough to fix, and it will be done overtime.
Attached Files
File Type: zip ml_tree.zip (27.8 KB, 1631 views)

Last edited by shaneh; 21st March 2005 at 03:44.
shaneh is offline   Reply With Quote
Old 21st March 2005, 03:17   #2
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
I am trying to resize both child windows in such a way that they maintain ratios. Currently I just use:

static ChildWndResizeItem resize_rlist[]={
{IDC_TREE1,0x0001}, // 0xLTRB
{IDC_LIST1,0x0011},
{IDC_EDIT1,0x0000},
{IDC_EDIT2,0x0010},
};

But the tree view stays the same size. If I edit the LR values of the tree view, it overlaps and does all sorts of weird stuff. Does anyone know hte magic for doing the resizing and keeping the ratios? Similar to how the "Arists" and "Albums" windows resize in the local media views.
shaneh is offline   Reply With Quote
Old 21st March 2005, 03:19   #3
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
oblig screenshot.
Attached Images
File Type: png ml_tree.png (35.2 KB, 2718 views)
shaneh is offline   Reply With Quote
Old 21st March 2005, 04:14   #4
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Also, does anyone know how to refine a query? I can just create one query and use "AND", however it doesnt seem possible to mix query types. (ie keyword and ? style syntax). I need this to do:

?filename begins "C:\path\" AND keyword_search

But Im not sure its possible. However, the view in the ML manages to do it, it can mix ? and keyword style when using the "Refine:" box.
shaneh is offline   Reply With Quote
Old 21st March 2005, 11:04   #5
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
It now displays the items in a proper list view, with some better threading and meta data such as playcount and rating. The threading/performance still has a few tweaks that can be done.Obviously sorting needs to be implemented too.

Double-clicking on items will now enqueue them in winamp, its just some basic operation to verify that the item can actually be retrieved ok.

Some basic 'splitter' support for the window, still needs some tweaks.
Attached Files
File Type: zip ml_tree.zip (28.9 KB, 993 views)
shaneh is offline   Reply With Quote
Old 21st March 2005, 11:13   #6
YtseJam
Forum King
 
YtseJam's Avatar
 
Join Date: Dec 2000
Location: Israel
Posts: 2,399
Send a message via ICQ to YtseJam Send a message via AIM to YtseJam
Good stuff, looking forward for future version to try out!

YtseJam is offline   Reply With Quote
Old 21st March 2005, 12:27   #7
chris_d_smith
Senior Member
 
Join Date: Jan 2004
Posts: 161
Quote:
Originally posted by shaneh
Also, does anyone know how to refine a query? I can just create one query and use "AND", however it doesnt seem possible to mix query types. (ie keyword and ? style syntax). I need this to do:

?filename begins "C:\path\" AND keyword_search

But Im not sure its possible. However, the view in the ML manages to do it, it can mix ? and keyword style when using the "Refine:" box.
It's probably possible to do properly somehow but i took a cop out approach in mlwww and just turned keyword searches into "HAS" searches internally eg:

?filename begins "C:\path\" AND keyword_search

becomes

?filename begins "C:\path\" AND ARTIST HAS "keyword" or ALBUM HAS "keyword" or TITLE HAS "keyword" or TRACKNO HAS "keyword" or GENRE HAS "keyword" or FILENAME HAS "keyword" or YEAR HAS "keyword" or COMMENT HAS "keyword"

Kinda embarrasingly dodgy but it works
chris_d_smith is offline   Reply With Quote
Old 21st March 2005, 12:36   #8
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Yeah I thought about that too, its pretty sketchy, but I guess it is doing something similar internally when you do a keyword search anyway.

I dont think its possible, but is there a way to do a search such that:

?filename begins "C:\path\" AND has_no_extra_path

so it will return results in a specific path, but not sub directories. Something like NOTHAS "\" in the remaining bit. Unfortuantly, I doubt this is possible, and will probably resort to not implementing it, or manually filtering, which can be slow if there are a lot of files in the sub directories.
shaneh is offline   Reply With Quote
Old 21st March 2005, 18:40   #9
DAVOR
Junior Member
 
Join Date: Aug 2003
Location: Croatia
Posts: 32
Hello guys.

I'm good in SQL, but I don't know if is this what You are looking for.

The SQL is language for 'comunicating' with databases.

So if I have a database named DB, in this database i have 1 table named TBL. This table is having 3 fields: Folder, Filename, Count.
Firsd two fields are strings and the last is number. the field type is important for building querys.

For retriving all from TBL.
SQL:
"SELECT * FROM TBL"

For retriving only specific fields:
"SELECT TBL.Filename, TBL.Folder FROM TBL"

To get only records that have folder 'c:\My Music':
(Here is important if You are having in Where string field then the searching string mus be in ''
"SELECT * FROM TBL WHERE TBL.FOLDER = 'C:\My Music'"

To get records that Folder field starts with 'C:\My' then:
"SELECT * FROM TBL WHERE TBL.Folder Like 'C:\My*'"
or
"SELECT * FROM TBL WHERE TBL.Folder Like 'C:\My%'"

Is this what You have looking.
DAVOR is offline   Reply With Quote
Old 21st March 2005, 18:49   #10
DAVOR
Junior Member
 
Join Date: Aug 2003
Location: Croatia
Posts: 32
Sorry but I have now seen that ML is not building Querys on a standard SQL type. :-(
DAVOR is offline   Reply With Quote
Old 21st March 2005, 23:53   #11
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
heh, thanks anyway davor. You could do the same with the ML querying, however the ML doesnt keep the path/folder and filename separate. It just stores the full filename with path. So you can't match on it separately. You need a way to match:

filename begins "C:\path\" AND has_no_\_after_"C:\path\"

which isnt really possible. I can quickly parse the results no problem, but it doesnt fit in with the modular design Im hoping for, and is slow, when querying the root for example, as it needs to return a lot of unnecessary results which then get pruned. The post-filtering code will be quick enough, its the actual search which takes the time due to having to copy heaps of meta data which then just gets discarded by the post-filter.
shaneh is offline   Reply With Quote
Old 22nd March 2005, 00:54   #12
chris_d_smith
Senior Member
 
Join Date: Jan 2004
Posts: 161
You could do it with some precalculating...

Find the subdirectories of the path using windows API then do:

filename begins "C:\path\" and !(filename has "subdir1") and !(filename has "subdir2") and ...

Should/Could still be faster than rescanning all the results afterwards?

Could be ridiculously slow too
chris_d_smith is offline   Reply With Quote
Old 22nd March 2005, 01:02   #13
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Yeah, I think that would be an order of magnatitude slower. Also, it is mainly the root that has this problem, as it rarely has many files in the directory itself, but has many subdirectories and files under it. Other directories are ok, as the number of sub directories is often much smaller so the search is faster. Trying to exclude every subdirectory wouldnt be possible like that, and would be much slower than just querying the in-memory database and pruning it afterwards. Although, I have already built the tree from the ML so wouldnt need to query the disk. But still, the query would be too large for the root.

The root search doesn't take *that* much longer than a search that only returns a few results, so I will probably just resort to post-processing the results.
shaneh is offline   Reply With Quote
Old 22nd March 2005, 03:15   #14
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Nevermind that. Ive used a much better solution which is much faster when showing items. It also makes for much better search results when navigating.

Ive fixed up a bit of threading and changed the way it indexes to a more modular and sensible design. It now has a directory and artist view, I will expand on this in future versions. The great thing is I can group and filter etc fairly flexibly. I will probably make similar views to Mexp.

Its starting to take shape...
Attached Files
File Type: zip ml_tree.zip (30.7 KB, 930 views)
shaneh is offline   Reply With Quote
Old 22nd March 2005, 03:27   #15
chris_d_smith
Senior Member
 
Join Date: Jan 2004
Posts: 161
looks cool .

Not sure if you want this kind of feedback yet but i got it to crash by changing the query in the top left box and pressing enter.

Would you be thinking of putting a playlist window down the bottom like in mexp?
chris_d_smith is offline   Reply With Quote
Old 22nd March 2005, 03:30   #16
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Yeah the tree building is quite buggy at the moment, both with the threading aspect and "finding the root" - which can be problematic when only a few items are returned etc. Theyre fairly minor issues I'll smooth out over time.
shaneh is offline   Reply With Quote
Old 22nd March 2005, 04:42   #17
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Added an artist/album grouping view. Fixed some threading and root finding.

I will put future versions up on my web space.
http://www.myplugins.info/ml_tree.zip
shaneh is offline   Reply With Quote
Old 23rd March 2005, 03:16   #18
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Its now nicely skinned with a couple do-nothing buttons. I can start actually adding funcionality and fixing bugs now.

TODO:

context menus (list item/s and tree items):
-refine search using selected
-explorer
-enqueue,play etc
-send to
-move/delete
-view file info
-more
column customisation
sorting
view customisation
make buttons do something
refine filter?
config saving/loading/gui
drag/drop
few songs by artist consolidation into 'various artists'
locate item from playlist
'snap' away item list view
rating star mouse over column thing
more info in status bar
fix strange crash bug
fix strange scrollbar loses functionality bug

Available here: http://www.myplugins.info/ml_tree.zip


Last edited by shaneh; 23rd March 2005 at 03:33.
shaneh is offline   Reply With Quote
Old 23rd March 2005, 13:35   #19
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Updated with some basic context menu support. Enqueue will actually work for the list view, with the button and context menu. Clear button works.

Pre-lim support for "Send to:" functionality, the menu is there at least. Its a bit of an ordeal as it requires reverse engineering the code structures, though Ive worked out most of it already.

Fixed some threading issues, possibly fixed the scrollbar losing functionality issue?

Dummy context menus for list view headers.
shaneh is offline   Reply With Quote
Old 23rd March 2005, 17:11   #20
Gabes Dad
Member
 
Join Date: Dec 2004
Location: Missouri
Posts: 69
Looks great so far. Kind of reminds me of Joonas's Dynamic Library, but within the Media Library - I'm all for that, less windows and more integration. Or even like crackity's quick tracks in functionality but sort of its brother anchored in the media library.
Gabes Dad is offline   Reply With Quote
Old 23rd March 2005, 21:26   #21
Joonas
Forum King
 
Join Date: Mar 2004
Location: Sweden
Posts: 2,263
Quote:
Originally posted by Gabes Dad
Looks great so far. Kind of reminds me of Joonas's Dynamic Library, but within the Media Library - I'm all for that, less windows and more integration. Or even like crackity's quick tracks in functionality but sort of its brother anchored in the media library.
¨

It is alike but it's more along shaneh's liking
He likes ML, I don't, so it is better that he does this kind of plugin than I.
Joonas is offline   Reply With Quote
Old 24th March 2005, 09:47   #22
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Some huge improvements to the list view. Much faster and responsive. Allows sorting on the vaious headers.

Added more meta data columns.

"Send to" functionality works (this is a quite a big deal, if you realise what was requried to get it to work . Added context menu to the tree view, with send to functionality too.

Shift-clicking a tree view item shows all child items rather than just direct children.

The tree view is still a bit buggy when being drawn.

/edit: updated with basic drag/drop support.

/edit: updated with enqueue and play support in both listview and tree. Honours ML default doubleclick actions.

Last edited by shaneh; 24th March 2005 at 12:43.
shaneh is offline   Reply With Quote
Old 25th March 2005, 03:12   #23
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Made the rating a bit prettier, and shows the proper values. Will do some mouseover hot rating stuff later.

Some alternating colors for list view items, not great in all skins, like base skin. Will fix it soon.
general fixes. the context menu in the list view seems to not show up too reliably atm. (/edit: fixed issue)


Last edited by shaneh; 25th March 2005 at 03:42.
shaneh is offline   Reply With Quote
Old 25th March 2005, 04:17   #24
Gabes Dad
Member
 
Join Date: Dec 2004
Location: Missouri
Posts: 69
off the topic, but Shane - what skin are you using in those I screen shots? It is very clean - I like it.
Gabes Dad is offline   Reply With Quote
Old 25th March 2005, 04:40   #25
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
The opus skin, I had a Visual style using this theme before and it looked quite nice together.
http://www.deviantart.com/deviation/5041772/


a few other nice simple skins.
http://www.deviantart.com/deviation/16283197/ - modern bleh:P
http://www.deviantart.com/deviation/5143321/
http://www.deviantart.com/deviation/7449018/
http://www.deviantart.com/deviation/8977109/
shaneh is offline   Reply With Quote
Old 25th March 2005, 06:08   #26
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Updated: Now does some currently playing song highlighting. A bit rough round the edges, but will get smoothed out later.
shaneh is offline   Reply With Quote
Old 25th March 2005, 12:23   #27
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Added some cool mouse over rating effect. Doesnt rate yet, but is simple enough to add in.

shaneh is offline   Reply With Quote
Old 25th March 2005, 13:09   #28
YtseJam
Forum King
 
YtseJam's Avatar
 
Join Date: Dec 2000
Location: Israel
Posts: 2,399
Send a message via ICQ to YtseJam Send a message via AIM to YtseJam
Are you going to make this theme-friendly?

YtseJam is offline   Reply With Quote
Old 25th March 2005, 13:12   #29
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
in what way? IF you mean winamp skin, then yes. It mostly is already, I just need to use appropriate colours in some places.

If you mean win xp Visual Style theme, what are you referring to that should be themed?

/edit: updated ml_tree to fix some silly bugs, and add automatic deep view of returned results.

Last edited by shaneh; 25th March 2005 at 13:28.
shaneh is offline   Reply With Quote
Old 26th March 2005, 03:56   #30
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Rating using star mouse over now affects items in the db.
+some performance improvements when mouse star hovering.

Column choosing and ordering etc code is there now, but not being used. I will make use of it when I do the config loading/saving.
shaneh is offline   Reply With Quote
Old 26th March 2005, 08:47   #31
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Nested the palylist in the window, inspired by the single gui skin. Note sure if I like this yet. Perhaps I can just have another ML plugin which nests the playlist and lets you drag drop.

Currently quite buggy with this feature, still prototype stuff as Ive said.

shaneh is offline   Reply With Quote
Old 27th March 2005, 06:31   #32
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Ive taken out the playlist for now, as it was quite buggy and I didnt really like the interface. I prefer to just dock the playlist alongside the window, or make use of the "single GUI modern skin" which does a similar thing, but lets you see the playlist for all ml windows.

But I will see how it goes. A better solution would be to dock the playlist like this, but have it for all windows. Similar to how the single gui skin does it, but without relying on the freeform skin engine.

The old version is still available at:
http://www.myplugins.info/ml_tree_pl.zip
Note its quite buggy, leaks, and doesnt work with modern skins.

On the plus side, Ive fixed some threading issues with the tree building. It should be heaps more stable now. The version without the playlist is actually becoming quite usable.

Last edited by shaneh; 27th March 2005 at 07:35.
shaneh is offline   Reply With Quote
Old 27th March 2005, 10:37   #33
DAVOR
Junior Member
 
Join Date: Aug 2003
Location: Croatia
Posts: 32
Hello Shaneh.
Again me with my question, will Your ml_tree be able to let other programers to see from other app whitch item is selected (filename).
DAVOR is offline   Reply With Quote
Old 29th March 2005, 14:04   #34
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
@DAVOR: It has makes use of the sendto_ system for ml plugins to extend functionality. A plugin which hooked proxied the sendto information to external applications would work the same way as it would in the normal ml view.
shaneh is offline   Reply With Quote
Old 29th March 2005, 14:08   #35
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
It now lets you do some basic tree customization in that you can specify the grouping. ie, by artist/album, year/genre, artist/rating etc. In the root tree item, just choose the options then click 'set' then view the custom view item. Obviously this will let you create custom views and save them etc.

It also has orphan grouping capabilities, and can show total counts of sub items. Plus some general fixes.
shaneh is offline   Reply With Quote
Old 30th March 2005, 06:32   #36
billyvnilly
Forum King, M.D.
 
billyvnilly's Avatar
 
Join Date: Mar 2004
Location: Detroit burbs
Posts: 3,379
Send a message via ICQ to billyvnilly Send a message via AIM to billyvnilly
you got praised in WA Unlimited very nice plugin!
billyvnilly is offline   Reply With Quote
Old 30th March 2005, 08:28   #37
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
@billyvnilly, cool.

Ive put in some folder icons etc which look ok. Ive also used images for the rating column instead of a font character. Its looks a little rough at the moment but I'll clear it up. For some reason I cannot get the alpha blending to work properly in the treeview or listview so the shadowed images look kind of crap at the moment.

Ive also added playcount, playcount range, weeks ago, days ago, played last and title to the grouping options. I will also probably add an order 3 grouping option as well. I dont think theres any need for more than 3 levels. The 'group orphans' option will also be able to be set on a per group level basis soon.

Added a "played last" column. Some improvements to tracking the currently played item. And probably just some small fixes here and there.
shaneh is offline   Reply With Quote
Old 30th March 2005, 13:20   #38
jocacliff
Junior Member
 
Join Date: Mar 2005
Posts: 3
Sweet. The plugin I was looking for. I haven't had in issues with this plugin. Keep up the good work

Is it possible to make it so you can edit the tag info via a right click like you can with the standard media library? That would be my only request.
jocacliff is offline   Reply With Quote
Old 30th March 2005, 15:19   #39
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
+Added an explorer context menu for the folders in directory views. This will also be available for individual items in the list, although Windows prevents this from being possible on items within different directories. What I might do is a quick check to see if all selected items are within the same folder before enabling the context menu. Otherwise, I will have to disable the recursive view of folders if I want it to behave like Explorer.

@jocacliff: Im not quite at the point of accepting feature requests. Though I am hoping to have that feature. In fact, it will allow editing things like playcount and rating and basically all the meta data rather than just the dialog used in the ML.

shaneh is offline   Reply With Quote
Old 30th March 2005, 19:52   #40
WanderingKnight
Member
 
WanderingKnight's Avatar
 
Join Date: May 2003
Location: St. John's, Newfoundland
Posts: 75
For some reason, the "artist" and "artist/album" grouped views both give me large "various" items, in the case of the artist/album view almost 3/4 of my total ML!

As well, the "directory view" doesn't show me the watched folder that is on my D: drive, only the folder on my C: drive

[Edited to add:]

OK, wait... for the "artist" grouping it's only the artists that only have a single track that are showing up under "various". That makes sense.

But many of the artists in the "album/artist" view "various" have multiple tracks.

[Edited AGAIN to add:]

OK... wait again. It seems to be something to do with the "group orphans" setting but I can't make the setting stick.
WanderingKnight is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump