1
0
Fork 0
forked from len0rd/rockbox

Fix playlist "Insert" a bit.

If insert was used to create a new playlist (e.g. inserting without audio playing), the insert position wasn't updated. Thus, the playlist created was in reversed order (except for the first song).
This was the reason "Insert last" was actually used as Insert in this case. BUT, this one doesn't update the insert position eiterh, but the order of the songs is fine, at least (due to appending).
Now, insert always updates the insert position properly, so that the aforementioned bugs are fixed. Insert is always used now.
Other impact: If you create a playlist using insert, every subsequent insert will append songs at the end of the playlist,if you start playback pressing select on songs, every subsequent insert will insert after the current track.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20241 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2009-03-08 17:18:18 +00:00
parent 99cb21f7aa
commit 87d1744e91
2 changed files with 4 additions and 17 deletions

View file

@ -342,12 +342,9 @@ static int treeplaylist_callback(int action,
const struct menu_item_ex *this_item);
/* insert items */
MENUITEM_FUNCTION(i_pl_item_no_play, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT),
playlist_insert_func, (intptr_t*)PLAYLIST_INSERT_LAST,
treeplaylist_callback, Icon_Playlist);
MENUITEM_FUNCTION(i_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT),
playlist_insert_func, (intptr_t*)PLAYLIST_INSERT,
treeplaylist_wplayback_callback, Icon_Playlist);
treeplaylist_callback, Icon_Playlist);
MENUITEM_FUNCTION(i_first_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT_FIRST),
playlist_insert_func, (intptr_t*)PLAYLIST_INSERT_FIRST,
treeplaylist_wplayback_callback, Icon_Playlist);
@ -389,7 +386,7 @@ MAKE_ONPLAYMENU( tree_playlist_menu, ID2P(LANG_PLAYLIST),
&view_playlist_item,
/* insert */
&i_pl_item_no_play, &i_pl_item, &i_first_pl_item,
&i_pl_item, &i_first_pl_item,
&i_last_pl_item, &i_shuf_pl_item,
/* queue */
@ -426,15 +423,6 @@ static int treeplaylist_callback(int action,
else
return ACTION_EXIT_MENUITEM;
}
else if (this_item == &i_pl_item_no_play)
{
if (!(audio_status() & AUDIO_STATUS_PLAY))
{
return action;
}
else
return ACTION_EXIT_MENUITEM;
}
else if (this_item == &i_shuf_pl_item)
{

View file

@ -712,7 +712,6 @@ static int add_track_to_playlist(struct playlist_info* playlist,
else
position = insert_position = 0;
if (playlist->started)
playlist->last_insert_pos = position;
break;
case PLAYLIST_INSERT_FIRST: