title
Products            Buy            Support Forum            Professional            About            Codec Central
 
Results 1 to 3 of 3

Thread: Column sorting in dAP

  1. #1

    Join Date
    Apr 2002
    Posts
    23

    Column sorting in dAP

    Here are my suggestions on column sorting. There are two things that could be added that would make it better.

    1) You want to emulate the behavior of Windows Explorer. Don't remember the sort order for each column individually. Instead, remember only the last sorted column and the direction it was sorted. Then, when user clicks a column, the decision is simple: if this column is the same as the previously sorted column, reverse the sort direction. Otherwise do an ascending sort. I find myself always getting descending sorts when I almost never want them -- because a while ago I had sorted on that column and then done other things, and dAP is remembering that previous sort!

    It's hard to explain, here is pseudo-code that might make the idea clearer:

    // pseudo-code
    void sort_by_column(int col)
    {
    static int prev_col = -1;
    static bool prev_ascending = true;

    bool ascending = col == prev_col ? !prev_ascending : true;
    sort_it(col, ascending); // do actual sort here
    prev_col = col;
    prev_ascending = ascending;
    }

    This will prevent 99% of the unwanted descending sorts.

    2) It is impossible to get an album sorted by track number, unless you use a stable sort routine. It's a bummer! So, in the above, the sort_it() routine should do a stable sort. There is a stable sort right there in STL that you can use, named, oddly enough, std::stable_sort() :-)

    http://msdn.microsoft.com/library/de...Stablesort.asp

    Just suggestions, to make dAP and MMC the best!

  2. #2
    Administrator
    Join Date
    Apr 2002
    Posts
    39,509
    Thanks, I didn't know explorer did this.

  3. #3

    Join Date
    Apr 2002
    Posts
    23
    Thanks for reading my suggestions, Spoon. I know I'm posting a lot of them, but somebody has to give you a hard time, and I was volunteered :-)

    Actually, I've tried a lot of players but I am settling on dAP as my player of choice because it has many features that I really like, and it is obvious that you are working very hard to make all of dBpowerAMP great. If I didn't like it a *lot*, I wouldn't be speaking up and making suggestions like I am. Keep up the great work!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •