Index: apps/onplay.c =================================================================== RCS file: /cvsroot/rockbox/apps/onplay.c,v retrieving revision 1.58 diff -u -r1.58 onplay.c --- apps/onplay.c 31 Oct 2005 18:38:48 -0000 1.58 +++ apps/onplay.c 31 Oct 2005 21:48:41 -0000 @@ -634,3 +634,12 @@ return onplay_result; } +/*one click insert modification*/ + +void onplay_one_click(char* file, int attr, int from){ + context=from; + selected_file = file; + selected_file_attr = attr; + add_to_playlist(PLAYLIST_INSERT, false); + +} Index: apps/onplay.h =================================================================== RCS file: /cvsroot/rockbox/apps/onplay.h,v retrieving revision 1.3 diff -u -r1.3 onplay.h --- apps/onplay.h 23 Jun 2005 01:31:25 -0000 1.3 +++ apps/onplay.h 31 Oct 2005 21:48:41 -0000 @@ -20,6 +20,7 @@ #define _ONPLAY_H_ int onplay(char* file, int attr, int from_screen); +void onplay_one_click(char* file, int attr, int from); enum { ONPLAY_OK, Index: apps/tree.c =================================================================== RCS file: /cvsroot/rockbox/apps/tree.c,v retrieving revision 1.366 diff -u -r1.366 tree.c --- apps/tree.c 31 Oct 2005 20:56:29 -0000 1.366 +++ apps/tree.c 31 Oct 2005 23:21:20 -0000 @@ -604,14 +604,9 @@ #ifdef TREE_RC_RUN case TREE_RC_RUN: #endif - case TREE_RUN: -#ifdef TREE_RUN_PRE - if (((button == TREE_RUN) #ifdef TREE_RC_RUN_PRE - || (button == TREE_RC_RUN)) - && ((lastbutton != TREE_RC_RUN_PRE) -#endif - && (lastbutton != TREE_RUN_PRE))) + if((button == TREE_RC_RUN) + && (lastbutton != TREE_RC_RUN_PRE)) break; #endif /* nothing to do if no files to display */ @@ -627,7 +622,42 @@ } restore = true; break; + case TREE_RUN: /*modification to allow 1 button insert*/ +#ifdef TREE_RUN_PRE + if ((button == TREE_RUN) + && (lastbutton != TREE_RUN_PRE)) + break; +#endif + /* nothing to do if no files to display */ + if ( numentries == 0 ) + break; + + int i; + if (id3db) + i = db_enter(&tc); + else + { + if (currdir[1]) + snprintf(buf, sizeof buf, "%s/%s", + currdir, dircache[tc.selected_item].name); + else + snprintf(buf, sizeof buf, "/%s", + dircache[tc.selected_item].name); + onplay_one_click(buf, dircache[tc.selected_item].attr, curr_context); + i = 1; /*reload directory only?*/ + } + + switch (i) + { + case 1: reload_dir = true; break; + case 2: start_wps = true; break; + case 3: exit_func = true; break; + default: break; + } + + restore = true; + break; case TREE_EXIT: case TREE_EXIT | BUTTON_REPEAT: #ifdef TREE_RC_EXIT