Announcement

Collapse
No announcement yet.

ml_tree prototype

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Last edited by shaneh; 21 March 2005, 02:44.
    Music Plugins

  • #2
    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.
    Music Plugins

    Comment


    • #3
      oblig screenshot.
      Attached Files
      Music Plugins

      Comment


      • #4
        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.
        Music Plugins

        Comment


        • #5
          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
          Music Plugins

          Comment


          • #6
            Good stuff, looking forward for future version to try out!

            Comment


            • #7
              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

              Comment


              • #8
                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.
                Music Plugins

                Comment


                • #9
                  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.

                  Comment


                  • #10
                    Sorry but I have now seen that ML is not building Querys on a standard SQL type. :-(

                    Comment


                    • #11
                      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.
                      Music Plugins

                      Comment


                      • #12
                        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

                        Comment


                        • #13
                          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.
                          Music Plugins

                          Comment


                          • #14
                            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
                            Music Plugins

                            Comment


                            • #15
                              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?

                              Comment

                              Working...
                              X
                              😀
                              🥰
                              🤢
                              😎
                              😡
                              👍
                              👎