[Xfce4-commits] <parole:bluesabre/gtk3> Fix next-button ignoring shuffle mode, prevent shuffle from playing same song twice in a row

Sean Davis noreply at xfce.org
Sun Aug 11 15:17:39 CEST 2013


Updating branch refs/heads/bluesabre/gtk3
         to 7ea090a71c7e65d6707aa63a617b4a66f98041ae (commit)
       from 88944888a18c87c16952397682f96e89c11beed8 (commit)

commit 7ea090a71c7e65d6707aa63a617b4a66f98041ae
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Tue Apr 30 23:03:22 2013 -0400

    Fix next-button ignoring shuffle mode, prevent shuffle from playing same song twice in a row

 ChangeLog              |    7 +++++++
 src/parole-medialist.c |   12 ++++++++----
 src/parole-player.c    |    8 ++++----
 3 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 733d78c..b18ef9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+git-master: bluesabre at xfce.org
+    * Bugfix release 0.5.1
+    * Fix m3u playlist processing with relative filenames (bug #10038)
+    * Fix playlist controls disabling access to media controls (bug #9936)
+    * Fix next-button ignoring shuffle mode (bug #10039)
+    * Prevent shuffle from playing the same song twice in a row
+
 2013-03-06: bluesabre at xfce.org
     * Stable release 0.5.0
     * Fixed potential file name clash in parole extension (bug #9728)
diff --git a/src/parole-medialist.c b/src/parole-medialist.c
index c9b4ba0..d32ed06 100644
--- a/src/parole-medialist.c
+++ b/src/parole-medialist.c
@@ -1923,6 +1923,7 @@ GtkTreeRowReference *parole_media_list_get_row_random (ParoleMediaList *list)
     GtkTreeRowReference *row = NULL;
     GtkTreeIter iter;
     GtkTreePath *path;
+    gchar *current_path;
     gchar *path_str;
     gint nch;
 
@@ -1933,17 +1934,20 @@ GtkTreeRowReference *parole_media_list_get_row_random (ParoleMediaList *list)
 	return  NULL;
     }
     
-    path_str = g_strdup_printf ("%i", g_random_int_range (0, nch));
+    current_path = gtk_tree_path_to_string(gtk_tree_row_reference_get_path(parole_media_list_get_selected_row(list)));
+    path_str = g_strdup(current_path);
+    
+    while (g_strcmp0(current_path, path_str) == 0)
+        path_str = g_strdup_printf ("%i", g_random_int_range (0, nch));
     
     path = gtk_tree_path_new_from_string (path_str);
     g_free (path_str);
     
     if ( gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->store), &iter, path))
     {
-	row  = gtk_tree_row_reference_new (GTK_TREE_MODEL (list->priv->store), path);
-	//parole_media_list_select_path (list, path);
+    row  = gtk_tree_row_reference_new (GTK_TREE_MODEL (list->priv->store), path);
     }
-    
+
     gtk_tree_path_free (path);
     
     return row;
diff --git a/src/parole-player.c b/src/parole-player.c
index 4c4d09c..08cfb71 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -1628,7 +1628,7 @@ parole_player_stop_clicked (GtkButton *button, ParolePlayer *player)
 
 void parole_player_forward_cb (GtkButton *button, ParolePlayer *player)
 {
-	parole_player_play_next (player, FALSE);
+	parole_player_play_next (player, TRUE);
 }
 							 
 void parole_player_back_cb (GtkButton *button, ParolePlayer *player)
@@ -2571,7 +2571,7 @@ parole_player_key_press (GtkWidget *widget, GdkEventKey *ev, ParolePlayer *playe
 		parole_player_play_prev (player);
 	    return TRUE;
 	case XF86XK_AudioNext:
-		parole_player_play_next (player, FALSE);
+		parole_player_play_next (player, TRUE);
 	    return TRUE;
 #endif /* HAVE_XF86_KEYSYM */
 	default:
@@ -2599,7 +2599,7 @@ parole_player_button_pressed_cb (ParoleButton *button, ParoleButtonKey key, Paro
 		parole_player_play_prev (player);
 	    break;
 	case PAROLE_KEY_AUDIO_NEXT:
-		parole_player_play_next (player, FALSE);
+		parole_player_play_next (player, TRUE);
 	    break;
 	default:
 	    break;
@@ -3388,7 +3388,7 @@ static gboolean	parole_player_dbus_stop (ParolePlayer *player,
 static gboolean	parole_player_dbus_next_track (ParolePlayer *player,
 					       GError *error)
 {
-	parole_player_play_next (player, FALSE);
+	parole_player_play_next (player, TRUE);
     return TRUE;
 }
 


More information about the Xfce4-commits mailing list