Index: apps/onplay.c =================================================================== RCS file: /cvsroot/rockbox/apps/onplay.c,v retrieving revision 1.65 diff -u -r1.65 onplay.c --- apps/onplay.c 5 Dec 2005 22:44:41 -0000 1.65 +++ apps/onplay.c 4 Jan 2006 17:02:52 -0000 @@ -56,6 +56,7 @@ #include "main_menu.h" #include "sound_menu.h" #include "database.h" +#include "filetree.h" static int context; static char* selected_file = NULL; @@ -617,3 +618,24 @@ return onplay_result; } +/*one click insert modification*/ + +int onplay_one_click(char* file, int attr, int from,struct tree_context* c){ + int ret=1; + context=from; + selected_file = file; + selected_file_attr = attr; + if(global_settings.click_insert==0) + ret=ft_enter(c); + else if(global_settings.click_insert==1) + add_to_playlist(PLAYLIST_INSERT, false); + else if(global_settings.click_insert==2) + add_to_playlist(PLAYLIST_INSERT_LAST, false); + else if(global_settings.click_insert==3) + add_to_playlist(PLAYLIST_INSERT_SHUFFLED, false); + else if(global_settings.click_insert==4) + add_to_playlist(PLAYLIST_INSERT, true); + else + add_to_playlist(PLAYLIST_INSERT_LAST, true); + return ret; +} 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 4 Jan 2006 17:02:52 -0000 @@ -20,6 +20,7 @@ #define _ONPLAY_H_ int onplay(char* file, int attr, int from_screen); +int onplay_one_click(char* file, int attr, int from,struct tree_context* c); enum { ONPLAY_OK, Index: apps/playlist_menu.c =================================================================== RCS file: /cvsroot/rockbox/apps/playlist_menu.c,v retrieving revision 1.13 diff -u -r1.13 playlist_menu.c --- apps/playlist_menu.c 5 Dec 2005 22:44:41 -0000 1.13 +++ apps/playlist_menu.c 4 Jan 2006 17:02:52 -0000 @@ -60,6 +60,22 @@ NULL ); } +static bool click_insert(void) +{ + static const struct opt_items names[] = { + { STR(LANG_CLICK_DEFAULT)}, + { STR(LANG_INSERT)}, + { STR(LANG_INSERT_LAST)}, + { STR(LANG_INSERT_SHUFFLED)}, + { STR(LANG_QUEUE) }, + { STR(LANG_QUEUE_LAST) }, + }; + + return set_option( str(LANG_CLICK_INSERT), + &global_settings.click_insert, INT, names, 6, + NULL ); +} + bool playlist_menu(void) { int m; @@ -70,6 +86,7 @@ { ID2P(LANG_VIEW_DYNAMIC_PLAYLIST), playlist_viewer }, { ID2P(LANG_SAVE_DYNAMIC_PLAYLIST), save_playlist }, { ID2P(LANG_RECURSE_DIRECTORY), recurse_directory }, + { ID2P(LANG_CLICK_INSERT), click_insert }, }; m = menu_init( items, sizeof items / sizeof(struct menu_item), NULL, Index: apps/settings.c =================================================================== RCS file: /cvsroot/rockbox/apps/settings.c,v retrieving revision 1.348 diff -u -r1.348 settings.c --- apps/settings.c 22 Dec 2005 13:31:14 -0000 1.348 +++ apps/settings.c 4 Jan 2006 17:02:54 -0000 @@ -491,7 +491,7 @@ #ifdef HAVE_BACKLIGHT_BRIGHTNESS {4, S_O(brightness), 9, "brightness", NULL }, #endif - + {3, S_O(click_insert), 0, "click insert setting", "original,insert,insert last,insert shuffled,queue,queue last"}, /* If values are just added to the end, no need to bump the version. */ /* new stuff to be added at the end */ Index: apps/settings.h =================================================================== RCS file: /cvsroot/rockbox/apps/settings.h,v retrieving revision 1.187 diff -u -r1.187 settings.h --- apps/settings.h 22 Dec 2005 23:48:31 -0000 1.187 +++ apps/settings.h 4 Jan 2006 17:02:54 -0000 @@ -385,6 +385,9 @@ #ifdef HAVE_REMOTE_LCD unsigned char rwps_file[MAX_FILENAME+1]; /* last remote-wps */ #endif + int click_insert; /*setting for click behaviour in file tree: + 0:insert, 1:insert last,2:queue, + 3:queue last,4:insert shuffled*/ #ifdef HAVE_BACKLIGHT_BRIGHTNESS int brightness; /* iriver h300: backlight PWM value: 2..15 (0 and 1 are black) */ Index: apps/tree.c =================================================================== RCS file: /cvsroot/rockbox/apps/tree.c,v retrieving revision 1.381 diff -u -r1.381 tree.c --- apps/tree.c 5 Dec 2005 22:44:41 -0000 1.381 +++ apps/tree.c 4 Jan 2006 17:02:56 -0000 @@ -581,14 +581,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 */ @@ -605,6 +600,49 @@ restore = true; break; +#ifdef TREE_RC_REC + case TREE_RC_REC: +#endif + case TREE_RUN: /*modification to allow 1 button insert*/ +#ifdef TREE_REC_PRE + if (((button == TREE_RUN) +#ifdef TREE_RC_REC_PRE + || (button == TREE_RC_REC)) + && ((lastbutton != TREE_RC_REC_PRE) +#endif + && (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); + i=onplay_one_click(buf, dircache[tc.selected_item].attr, curr_context,&tc); + } + + 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 Index: apps/tree.h =================================================================== RCS file: /cvsroot/rockbox/apps/tree.h,v retrieving revision 1.56 diff -u -r1.56 tree.h --- apps/tree.h 19 Dec 2005 00:11:26 -0000 1.56 +++ apps/tree.h 4 Jan 2006 17:02:56 -0000 @@ -60,6 +60,8 @@ #define TREE_RC_WPS_PRE BUTTON_RC_ON #define TREE_RC_CONTEXT (BUTTON_RC_ON | BUTTON_REPEAT) #define TREE_RC_QUICK (BUTTON_RC_MODE | BUTTON_REPEAT) +#define TREE_RC_REC (BUTTON_RC_REC | BUTTON_REL) +#define TREE_RC_REC_PRE BUTTON_RC_REC #elif CONFIG_KEYPAD == RECORDER_PAD #define TREE_NEXT BUTTON_DOWN Index: apps/lang/english.lang =================================================================== RCS file: /cvsroot/rockbox/apps/lang/english.lang,v retrieving revision 1.209 diff -u -r1.209 english.lang --- apps/lang/english.lang 22 Dec 2005 10:43:35 -0000 1.209 +++ apps/lang/english.lang 4 Jan 2006 17:02:59 -0000 @@ -1551,6 +1551,19 @@ voice: "Playlist Options" new: +id: LANG_CLICK_INSERT +desc: in playlist menu +eng: "Click Insert Options" +voice: "" +new: + +id: LANG_CLICK_DEFAULT +desc: in click insert menu +eng: "Original Behaviour" +voice: "" +new: + + id: LANG_PLAYLIST_INSERT_COUNT desc: splash number of tracks inserted eng: "Inserted %d tracks (%s)"