diff options
author | Miika Pekkarinen <miipekk@ihme.org> | 2006-07-25 07:41:00 +0000 |
---|---|---|
committer | Miika Pekkarinen <miipekk@ihme.org> | 2006-07-25 07:41:00 +0000 |
commit | 4e6c79b42ee4e299f13d63552aa4145a0abf41fb (patch) | |
tree | b62342ed61a4395c3f5d26c4fcb7d791d01d844c /apps/onplay.c | |
parent | 52aaa75e83fc34524625dfa51dc0b7c1baacbac5 (diff) |
Enabled playlist submenu for tagcache!
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10315 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/onplay.c')
-rw-r--r-- | apps/onplay.c | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/apps/onplay.c b/apps/onplay.c index d552e41826..53058b3bc9 100644 --- a/apps/onplay.c +++ b/apps/onplay.c @@ -64,6 +64,7 @@ #endif #include "playlist_menu.h" #include "playlist_catalog.h" +#include "tagtree.h" static int context; static char* selected_file = NULL; @@ -174,26 +175,33 @@ static bool add_to_playlist(int position, bool queue) if (new_playlist) playlist_create(NULL, NULL); - if ((selected_file_attr & TREE_ATTR_MASK) == TREE_ATTR_MPA) - playlist_insert_track(NULL, selected_file, position, queue); - else if (selected_file_attr & ATTR_DIRECTORY) + if (context == CONTEXT_ID3DB) { - bool recurse = false; - - if (global_settings.recursive_dir_insert != RECURSE_ASK) - recurse = (bool)global_settings.recursive_dir_insert; - else + tagtree_insert_selection_playlist(position, queue); + } + else + { + if ((selected_file_attr & TREE_ATTR_MASK) == TREE_ATTR_MPA) + playlist_insert_track(NULL, selected_file, position, queue); + else if (selected_file_attr & ATTR_DIRECTORY) { - /* Ask if user wants to recurse directory */ - recurse = (gui_syncyesno_run(&message, NULL, NULL)==YESNO_YES); + bool recurse = false; + + if (global_settings.recursive_dir_insert != RECURSE_ASK) + recurse = (bool)global_settings.recursive_dir_insert; + else + { + /* 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); } - - playlist_insert_directory(NULL, selected_file, position, queue, - recurse); + else if ((selected_file_attr & TREE_ATTR_MASK) == TREE_ATTR_M3U) + playlist_insert_playlist(NULL, selected_file, position, queue); } - else if ((selected_file_attr & TREE_ATTR_MASK) == TREE_ATTR_M3U) - playlist_insert_playlist(NULL, selected_file, position, queue); - + if (new_playlist && (playlist_amount() > 0)) { /* nothing is currently playing so begin playing what we just @@ -842,8 +850,7 @@ int onplay(char* file, int attr, int from) if (context == CONTEXT_WPS || context == CONTEXT_TREE || - ((context == CONTEXT_ID3DB) && - (attr & TREE_ATTR_MASK) == TREE_ATTR_MPA)) + (context == CONTEXT_ID3DB)) { items[i].desc = ID2P(LANG_PLAYLIST); items[i].function = playlist_options; |