Commit 7ea090a7 authored by Sean Davis's avatar Sean Davis 🕶

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

parent 88944888
git-master: bluesabre@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@xfce.org
* Stable release 0.5.0
* Fixed potential file name clash in parole extension (bug #9728)
......
......@@ -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;
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment