summaryrefslogtreecommitdiffstats
path: root/apps/onplay.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-03-08 17:18:18 +0000
committerThomas Martitz <kugel@rockbox.org>2009-03-08 17:18:18 +0000
commit87d1744e91e016b650a3c7826a93cd6afcaf0383 (patch)
treeca45fdd389f8e58cd35f55ce08b64d7ac1a03027 /apps/onplay.c
parent99cb21f7aaa9e4ba661053828cc9c030fdc72467 (diff)
downloadrockbox-87d1744e91e016b650a3c7826a93cd6afcaf0383.tar.gz
rockbox-87d1744e91e016b650a3c7826a93cd6afcaf0383.zip
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
Diffstat (limited to 'apps/onplay.c')
-rw-r--r--apps/onplay.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/apps/onplay.c b/apps/onplay.c
index ead372d4e6..9a308730ad 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -197,7 +197,7 @@ static bool add_to_playlist(int position, bool queue)
/* Ask if user wants to recurse directory */
recurse = (gui_syncyesno_run(&message, NULL, NULL)==YESNO_YES);
}
-
+
playlist_insert_directory(NULL, selected_file, position, queue,
recurse);
}
@@ -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)
{