changeset 2124:83c9caf0c554 trunk

[svn] - add some basic code for the manipulation of temporary playlists
author nenolod
date Fri, 15 Dec 2006 07:38:23 -0800
parents 97e2cbd87df0
children 22ebf356f7cd
files ChangeLog audacious/mainwin.c audacious/mainwin.h audacious/playlist.c
diffstat 4 files changed, 42 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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 <nenolod@nenolod.net>
+  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 <nenolod@nenolod.net>
   revision [3249]
   - remove static Playlist default_playlist
--- 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"), "<control>J", mainwin_general_menu_callback,
      MAINWIN_GENERAL_JTT, "<StockItem>", GTK_STOCK_JUMP_TO},
     {"/-", NULL, NULL, 0, "<Separator>", NULL},
+    {N_("/New Playlist"), "<shift>N", mainwin_general_menu_callback,
+     MAINWIN_GENERAL_NEW_PL, "<Item>"},    
+    {N_("/Select Next Playlist"), "<shift>P", mainwin_general_menu_callback,
+     MAINWIN_GENERAL_NEXT_PL, "<Item>"},
+    {N_("/Select Previous Playlist"), "<control><shift>P", mainwin_general_menu_callback,
+     MAINWIN_GENERAL_PREV_PL, "<Item>"},
+    {"/-", NULL, NULL, 0, "<Separator>", NULL},
     {N_("/View Track Details"), "<alt>I", mainwin_general_menu_callback,
      MAINWIN_GENERAL_FILEINFO, "<ImageItem>", 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;
     }
 }
 
--- 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;
--- 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;