Index: apps/action.h =================================================================== --- apps/action.h (Revision 19925) +++ apps/action.h (Arbeitskopie) @@ -118,6 +118,7 @@ ACTION_WPS_CONTEXT, ACTION_WPS_QUICKSCREEN,/* optional */ ACTION_WPS_MENU, /*this should be the same as ACTION_STD_MENU */ + ACTION_WPS_VIEW_PLAYLIST, ACTION_WPS_REC, #if 0 ACTION_WPSAB_SINGLE, /* This needs to be #defined in @@ -142,6 +143,7 @@ ACTION_TREE_PGRIGHT,/* optional */ ACTION_TREE_STOP, ACTION_TREE_WPS, + ACTION_TREE_INSERT, /* radio */ ACTION_FM_MENU, Index: apps/tree.c =================================================================== --- apps/tree.c (Revision 19925) +++ apps/tree.c (Arbeitskopie) @@ -113,6 +113,37 @@ static void ft_play_filename(char *dir, char *file); static void say_filetype(int attr); +static bool tree_insert_action(void) +{ + struct tree_context* tc = tree_get_context(); + char filename[MAX_PATH]; + int attr = 0; + int curr_context = CONTEXT_TREE; + +#ifdef HAVE_TAGCACHE + if (*(tc->dirfilter) == SHOW_ID3DB) + { + curr_context = CONTEXT_ID3DB; + if (tagtree_get_attr(tc) == FILE_ATTR_AUDIO) + { + attr = FILE_ATTR_AUDIO; + tagtree_get_filename(tc, filename, sizeof(filename)); + } + else + { + attr = ATTR_DIRECTORY; + filename[0] = '\0'; + } + } + else +#endif + { + get_current_file(filename, sizeof filename); + attr = ((struct entry*)tc->dircache)->attr; + } + return (onplay_playlist_insert(filename, attr, curr_context)); +} + static char * tree_get_filename(int selected_item, void *data, char *buffer, size_t buffer_len) { @@ -718,6 +749,13 @@ case ACTION_TREE_WPS: return GO_TO_PREVIOUS_MUSIC; break; + case ACTION_TREE_INSERT: + if (*tc.dirfilter < NUM_FILTER_MODES) + { + tree_insert_action(); + restore = true; + } + break; #ifdef HAVE_QUICKSCREEN case ACTION_STD_QUICKSCREEN: /* don't enter f2 from plugin browser */ Index: apps/onplay.c =================================================================== --- apps/onplay.c (Revision 19925) +++ apps/onplay.c (Arbeitskopie) @@ -1208,3 +1208,12 @@ return context == CONTEXT_WPS ? ONPLAY_OK : ONPLAY_RELOAD_DIR; } } + +bool onplay_playlist_insert(char* filename, int attr, int src_context) +{ + selected_file = filename; + selected_file_attr = attr; + context = src_context; + return(add_to_playlist(PLAYLIST_INSERT, false)); +} + Index: apps/gui/gwps.c =================================================================== --- apps/gui/gwps.c (Revision 19925) +++ apps/gui/gwps.c (Arbeitskopie) @@ -63,6 +63,7 @@ #include "pitchscreen.h" #include "appevents.h" #include "viewport.h" +#include "playlist_viewer.h" /* currently only one wps_state is needed */ struct wps_state wps_state; @@ -674,7 +675,21 @@ #endif default_event_handler(SYS_POWEROFF); break; + case ACTION_WPS_VIEW_PLAYLIST: + viewportmanager_set_statusbar(oldbars); + show_main_backdrop(); + if(playlist_viewer()) + return GO_TO_ROOT; +#if LCD_DEPTH > 1 + show_wps_backdrop(); +#endif +#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 + show_remote_wps_backdrop(); +#endif + restore = true; + viewportmanager_set_statusbar(wpsbars); + break; default: if(default_event_handler(button) == SYS_USB_CONNECTED) return GO_TO_ROOT; Index: apps/onplay.h =================================================================== --- apps/onplay.h (Revision 19925) +++ apps/onplay.h (Arbeitskopie) @@ -22,7 +22,9 @@ #define _ONPLAY_H_ int onplay(char* file, int attr, int from_screen); +bool onplay_playlist_insert(char* filename, int attr, int src_context); + enum { ONPLAY_MAINMENU = -1, ONPLAY_OK = 0, Index: apps/keymaps/keymap-e200.c =================================================================== --- apps/keymaps/keymap-e200.c (Revision 19925) +++ apps/keymaps/keymap-e200.c (Arbeitskopie) @@ -80,6 +80,7 @@ { ACTION_WPS_QUICKSCREEN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN }, { ACTION_WPS_MENU, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN }, + { ACTION_WPS_VIEW_PLAYLIST, BUTTON_REC|BUTTON_REL, BUTTON_NONE }, { ACTION_WPS_REC, BUTTON_REC|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_WPS_PITCHSCREEN, BUTTON_SELECT|BUTTON_UP, BUTTON_SELECT }, @@ -114,6 +115,7 @@ static const struct button_mapping button_context_tree[] = { { ACTION_TREE_WPS, BUTTON_UP|BUTTON_REL, BUTTON_UP }, { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, + { ACTION_TREE_INSERT, BUTTON_REC|BUTTON_REL, BUTTON_NONE }, LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), }; /* button_context_tree */