Discussion:
Show-all-tracks 0.2 and auto_expand_albums
Julian Orth
2012-11-07 21:59:45 UTC
Permalink
I have added a new option "auto_expand_albums" to my show-all-tracks branch.
If enabled, searching for tracks does not automatically expand the album list.

To do this, I had to rewrite show-all-tracks and was able to remove
the changes in rbtree.h.
In the current version, I simply set a variable in tree.c that says if
an album or an artist is selected.
I didn't do this before because I don't know if this is "stable" in
the sense that the method win->get_next only gets called when the
content of lib_track_win is determined by the selection in
lib_tree_win.

Furthermore, I discovered and fixed two bugs (in my implementation).
When a track is removed or added, lib_track_win doesn't get updated.
In the first case, this can result in crashs.

You can find it here:
http://gitorious.org/~juorth/cmus/juorths-cmus2/commits/show-all-songs
Gregory Petrosyan
2012-11-08 13:51:35 UTC
Permalink
Post by Julian Orth
I have added a new option "auto_expand_albums" to my show-all-tracks branch.
If enabled, searching for tracks does not automatically expand the album list.
To do this, I had to rewrite show-all-tracks and was able to remove
the changes in rbtree.h.
In the current version, I simply set a variable in tree.c that says if
an album or an artist is selected.
I didn't do this before because I don't know if this is "stable" in
the sense that the method win->get_next only gets called when the
content of lib_track_win is determined by the selection in
lib_tree_win.
Furthermore, I discovered and fixed two bugs (in my implementation).
When a track is removed or added, lib_track_win doesn't get updated.
In the first case, this can result in crashs.
http://gitorious.org/~juorth/cmus/juorths-cmus2/commits/show-all-songs
I haven't reviewed the patch yet, but in my limited testing it seems
to work — I've combined everything into a single commit, and pushed it
to the pu branch, so that everybody can review it and test easily.

Thanks a lot for your work!

Gregory
Gregory Petrosyan
2012-11-13 15:38:16 UTC
Permalink
Post by Julian Orth
Furthermore, I discovered and fixed two bugs (in my implementation).
When a track is removed or added, lib_track_win doesn't get updated.
In the first case, this can result in crashs.
http://gitorious.org/~juorth/cmus/juorths-cmus2/commits/show-all-songs
I've discovered one more bug: cmus BUGs with on «BUG_ON(iter->data0 !=
win->head.data0)» in window_row_vanishes() with the following
backtrace:

(lldb) bt
* thread #1: tid = 0x1c03, 0x000000010000a7cc cmus`__debug_bug + 268
at debug.c:71, stop reason = breakpoint 1.1
frame #0: 0x000000010000a7cc cmus`__debug_bug + 268 at debug.c:71
frame #1: 0x000000010002b339 cmus`window_row_vanishes + 265 at window.c:239
frame #2: 0x0000000100023f12 cmus`tree_remove [inlined]
remove_track + 109 at tree.c:1140
frame #3: 0x0000000100023ea5 cmus`tree_remove + 53 at tree.c:1153
frame #4: 0x0000000100016220 cmus`free_lib_track + 224 at lib.c:322
frame #5: 0x000000010000b558 cmus`editable_clear [inlined]
editable_remove_track + 136 at editable.c:103
frame #6: 0x000000010000b503 cmus`editable_clear + 51 at editable.c:295
frame #7: 0x0000000100004bfe cmus`view_clear + 62 at command_mode.c:80
frame #8: 0x000000010000943d cmus`commands_exit + 13 at command_mode.c:2981
frame #9: 0x0000000100029012 cmus`main [inlined] exit_all + 121 at
ui_curses.c:2343
frame #10: 0x0000000100028f99 cmus`main + 4969 at ui_curses.c:2446
frame #11: 0x00007fff8b3967e1 libdyld.dylib`start + 1

Bug occures when exiting cmus, reproduces reliably with your patch and
does not happen with master branch.

Gregory

Loading...