# HG changeset patch # User nenolod # Date 1166197103 28800 # Node ID 83c9caf0c5543186e9fe2ec8c62d1f72ae405beb # Parent 97e2cbd87df0506000d7fff4db67e5337dea73a4 [svn] - add some basic code for the manipulation of temporary playlists diff -r 97e2cbd87df0 -r 83c9caf0c554 ChangeLog --- a/ChangeLog Fri Dec 15 07:28:29 2006 -0800 +++ b/ChangeLog Fri Dec 15 07:38:23 2006 -0800 @@ -1,3 +1,12 @@ +2006-12-15 15:28:29 +0000 William Pitcock + revision [3251] + - add playlist_select_next(), playlist_select_prev() + + trunk/audacious/playlist.c | 22 ++++++++++++++++++++++ + trunk/audacious/playlist.h | 2 ++ + 2 files changed, 24 insertions(+) + + 2006-12-15 15:25:30 +0000 William Pitcock revision [3249] - remove static Playlist default_playlist diff -r 97e2cbd87df0 -r 83c9caf0c554 audacious/mainwin.c --- a/audacious/mainwin.c Fri Dec 15 07:28:29 2006 -0800 +++ b/audacious/mainwin.c Fri Dec 15 07:38:23 2006 -0800 @@ -367,6 +367,13 @@ {N_("/Jump to Time"), "J", mainwin_general_menu_callback, MAINWIN_GENERAL_JTT, "", GTK_STOCK_JUMP_TO}, {"/-", NULL, NULL, 0, "", NULL}, + {N_("/New Playlist"), "N", mainwin_general_menu_callback, + MAINWIN_GENERAL_NEW_PL, ""}, + {N_("/Select Next Playlist"), "P", mainwin_general_menu_callback, + MAINWIN_GENERAL_NEXT_PL, ""}, + {N_("/Select Previous Playlist"), "P", mainwin_general_menu_callback, + MAINWIN_GENERAL_PREV_PL, ""}, + {"/-", NULL, NULL, 0, "", NULL}, {N_("/View Track Details"), "I", mainwin_general_menu_callback, MAINWIN_GENERAL_FILEINFO, "", my_pixbuf} }; @@ -3069,6 +3076,19 @@ mainwin_release_info_text(); } break; + case MAINWIN_GENERAL_NEW_PL: + { + Playlist *new_pl = playlist_new(); + + playlist_add_playlist(new_pl); + } + break; + case MAINWIN_GENERAL_PREV_PL: + playlist_select_prev(); + break; + case MAINWIN_GENERAL_NEXT_PL: + playlist_select_next(); + break; } } diff -r 97e2cbd87df0 -r 83c9caf0c554 audacious/mainwin.h --- a/audacious/mainwin.h Fri Dec 15 07:28:29 2006 -0800 +++ b/audacious/mainwin.h Fri Dec 15 07:38:23 2006 -0800 @@ -84,7 +84,11 @@ MAINWIN_GENERAL_VOLUP, MAINWIN_GENERAL_VOLDOWN, MAINWIN_GENERAL_SETAB, - MAINWIN_GENERAL_CLEARAB + MAINWIN_GENERAL_CLEARAB, + + MAINWIN_GENERAL_NEXT_PL, + MAINWIN_GENERAL_PREV_PL, + MAINWIN_GENERAL_NEW_PL, }; extern GtkWidget *mainwin; diff -r 97e2cbd87df0 -r 83c9caf0c554 audacious/playlist.c --- a/audacious/playlist.c Fri Dec 15 07:28:29 2006 -0800 +++ b/audacious/playlist.c Fri Dec 15 07:38:23 2006 -0800 @@ -250,7 +250,10 @@ void playlist_select_next(void) { - playlists_iter = g_list_next(playlists); + if (playlists_iter == NULL) + playlists_iter = playlists; + + playlists_iter = g_list_next(playlists_iter); if (playlists_iter == NULL) playlists_iter = playlists; @@ -261,7 +264,10 @@ void playlist_select_prev(void) { - playlists_iter = g_list_next(playlists); + if (playlists_iter == NULL) + playlists_iter = playlists; + + playlists_iter = g_list_previous(playlists_iter); if (playlists_iter == NULL) playlists_iter = playlists;