summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-03-08 19:03:53 +0000
committerThomas Martitz <kugel@rockbox.org>2009-03-08 19:03:53 +0000
commit4ae7415503321771dff88af6b76cf4c88a5f9fc0 (patch)
treee00a0a3bc6056bea681868d93bcb42dd79fad441
parent1a09bf2f9bd36e9b5bfa1de6f6fec65a6b222c8d (diff)
downloadrockbox-4ae7415503321771dff88af6b76cf4c88a5f9fc0.tar.gz
rockbox-4ae7415503321771dff88af6b76cf4c88a5f9fc0.zip
Fix insert/queue next, last and replace to update the last insert position too,
giving well defined behavior and useful interaction with insert, and making things like insert next followed by many inserts work. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20247 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/playlist.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index acbadf982c..d426900a2b 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -720,14 +720,15 @@ static int add_track_to_playlist(struct playlist_info* playlist,
720 else 720 else
721 position = insert_position = 0; 721 position = insert_position = 0;
722 722
723 if (playlist->last_insert_pos < 0 && playlist->started) 723 playlist->last_insert_pos = position;
724 playlist->last_insert_pos = position;
725 break; 724 break;
726 case PLAYLIST_INSERT_LAST: 725 case PLAYLIST_INSERT_LAST:
727 if (playlist->first_index > 0) 726 if (playlist->first_index > 0)
728 position = insert_position = playlist->first_index; 727 position = insert_position = playlist->first_index;
729 else 728 else
730 position = insert_position = playlist->amount; 729 position = insert_position = playlist->amount;
730
731 playlist->last_insert_pos = position;
731 break; 732 break;
732 case PLAYLIST_INSERT_SHUFFLED: 733 case PLAYLIST_INSERT_SHUFFLED:
733 { 734 {
@@ -756,7 +757,7 @@ static int add_track_to_playlist(struct playlist_info* playlist,
756 if (playlist_remove_all_tracks(playlist) < 0) 757 if (playlist_remove_all_tracks(playlist) < 0)
757 return -1; 758 return -1;
758 759
759 position = insert_position = playlist->index + 1; 760 playlist->last_insert_pos = position = insert_position = playlist->index + 1;
760 break; 761 break;
761 } 762 }
762 763