# HG changeset patch # User nenolod # Date 1153854749 25200 # Node ID 740c08db08d9eb4fe5d54d055ebc50580f17a6f5 # Parent a360afd8df524bfcabee69e0a601f8e2cd401124 [svn] via Christian Birchinger : - Add a `sort by Playlist Entry' option. diff -r a360afd8df52 -r 740c08db08d9 ChangeLog --- a/ChangeLog Mon Jul 24 16:20:05 2006 -0700 +++ b/ChangeLog Tue Jul 25 12:12:29 2006 -0700 @@ -1,3 +1,16 @@ +2006-07-24 23:20:05 +0000 Derek Pomery + revision [1772] + Make annoying recursion that consistently returns wrong art, optional. + + + Changes: Modified: + +89 -0 trunk/audacious/glade/prefswin.glade + +2 -0 trunk/audacious/main.c + +2 -0 trunk/audacious/main.h + +42 -0 trunk/audacious/prefswin.c + +14 -15 trunk/audacious/ui_fileinfo.c + + 2006-07-21 17:24:28 +0000 William Pitcock revision [1770] - add translators list diff -r a360afd8df52 -r 740c08db08d9 audacious/playlist.c --- a/audacious/playlist.c Mon Jul 24 16:20:05 2006 -0700 +++ b/audacious/playlist.c Tue Jul 25 12:12:29 2006 -0700 @@ -108,6 +108,7 @@ static gint playlist_compare_artist(PlaylistEntry * a, PlaylistEntry * b); static gint playlist_compare_date(PlaylistEntry * a, PlaylistEntry * b); static gint playlist_compare_track(PlaylistEntry * a, PlaylistEntry * b); +static gint playlist_compare_playlist(PlaylistEntry * a, PlaylistEntry * b); static gint playlist_dupscmp_path(PlaylistEntry * a, PlaylistEntry * b); static gint playlist_dupscmp_filename(PlaylistEntry * a, PlaylistEntry * b); @@ -119,7 +120,8 @@ playlist_compare_title, playlist_compare_artist, playlist_compare_date, - playlist_compare_track + playlist_compare_track, + playlist_compare_playlist }; static void playlist_save_m3u(FILE * file); @@ -1774,6 +1776,36 @@ } static gint +playlist_compare_playlist(PlaylistEntry * a, + PlaylistEntry * b) +{ + const gchar *a_title = NULL, *b_title = NULL; + + g_return_val_if_fail(a != NULL, 0); + g_return_val_if_fail(b != NULL, 0); + + if (a->title != NULL) + a_title = a->title; + else { + if (strrchr(a->filename, '/')) + a_title = strrchr(a->filename, '/') + 1; + else + a_title = a->filename; + } + + if (b->title != NULL) + b_title = b->title; + else { + if (strrchr(a->filename, '/')) + b_title = strrchr(b->filename, '/') + 1; + else + b_title = b->filename; + } + + return strcasecmp(a_title, b_title); +} + +static gint playlist_compare_title(PlaylistEntry * a, PlaylistEntry * b) { diff -r a360afd8df52 -r 740c08db08d9 audacious/playlist.h --- a/audacious/playlist.h Mon Jul 24 16:20:05 2006 -0700 +++ b/audacious/playlist.h Tue Jul 25 12:12:29 2006 -0700 @@ -34,7 +34,8 @@ PLAYLIST_SORT_TITLE, PLAYLIST_SORT_ARTIST, PLAYLIST_SORT_DATE, - PLAYLIST_SORT_TRACK + PLAYLIST_SORT_TRACK, + PLAYLIST_SORT_PLAYLIST } PlaylistSortType; typedef enum { diff -r a360afd8df52 -r 740c08db08d9 audacious/ui_playlist.c --- a/audacious/ui_playlist.c Mon Jul 24 16:20:05 2006 -0700 +++ b/audacious/ui_playlist.c Tue Jul 25 12:12:29 2006 -0700 @@ -83,7 +83,8 @@ PLAYLISTWIN_SORT_SEL_BYTITLE, PLAYLISTWIN_SORT_SEL_BYFILENAME, PLAYLISTWIN_SORT_SEL_BYPATH, PLAYLISTWIN_SORT_SEL_BYDATE, PLAYLISTWIN_SORT_RANDOMIZE, PLAYLISTWIN_SORT_REVERSE, - PLAYLISTWIN_SORT_BYTRACK, PLAYLISTWIN_SORT_SEL_BYTRACK + PLAYLISTWIN_SORT_BYTRACK, PLAYLISTWIN_SORT_SEL_BYTRACK, + PLAYLISTWIN_SORT_BYPLAYLIST, PLAYLISTWIN_SORT_SEL_BYPLAYLIST }; GtkWidget *playlistwin; @@ -265,6 +266,8 @@ PLAYLISTWIN_SORT_BYDATE, "", sortbydate_pixbuf}, {N_("/Sort List/By Track Number"), NULL, plsort_menu_callback, PLAYLISTWIN_SORT_BYTRACK, "", sortbytitle_pixbuf}, + {N_("/Sort List/By Playlist Entry"), NULL, plsort_menu_callback, + PLAYLISTWIN_SORT_BYPLAYLIST, "", sortbytitle_pixbuf}, {N_("/Sort Selection"), NULL, NULL, 0, "", NULL}, {N_("/Sort Selection/By Title"), NULL, plsort_menu_callback, PLAYLISTWIN_SORT_SEL_BYTITLE, "", sortbytitle_pixbuf}, @@ -277,7 +280,9 @@ {N_("/Sort Selection/By Date"), NULL, plsort_menu_callback, PLAYLISTWIN_SORT_SEL_BYDATE, "", sortbydate_pixbuf}, {N_("/Sort Selection/By Track Number"), NULL, plsort_menu_callback, - PLAYLISTWIN_SORT_SEL_BYTRACK, "", sortbytitle_pixbuf} + PLAYLISTWIN_SORT_SEL_BYTRACK, "", sortbytitle_pixbuf}, + {N_("/Sort Selection/By Playlist Entry"), NULL, plsort_menu_callback, + PLAYLISTWIN_SORT_SEL_BYPLAYLIST, "", sortbytitle_pixbuf} }; @@ -1855,6 +1860,10 @@ GtkWidget * widget) { switch (action) { + case PLAYLISTWIN_SORT_BYPLAYLIST: + playlist_sort(PLAYLIST_SORT_PLAYLIST); + playlistwin_update_list(); + break; case PLAYLISTWIN_SORT_BYTRACK: playlist_sort(PLAYLIST_SORT_TRACK); playlistwin_update_list(); @@ -1879,6 +1888,10 @@ playlist_sort(PLAYLIST_SORT_FILENAME); playlistwin_update_list(); break; + case PLAYLISTWIN_SORT_SEL_BYPLAYLIST: + playlist_sort_selected(PLAYLIST_SORT_PLAYLIST); + playlistwin_update_list(); + break; case PLAYLISTWIN_SORT_SEL_BYTRACK: playlist_sort_selected(PLAYLIST_SORT_TRACK); playlistwin_update_list();