Index: apps/onplay.c =================================================================== RCS file: /cvsroot/rockbox/apps/onplay.c,v retrieving revision 1.66 diff -u -r1.66 onplay.c --- apps/onplay.c 25 Jan 2006 08:29:12 -0000 1.66 +++ apps/onplay.c 31 Jan 2006 04:59:41 -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; @@ -622,3 +623,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 31 Jan 2006 04:59:41 -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 31 Jan 2006 04:59:41 -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.350 diff -u -r1.350 settings.c --- apps/settings.c 22 Jan 2006 01:42:04 -0000 1.350 +++ apps/settings.c 31 Jan 2006 04:59:43 -0000 @@ -501,6 +501,7 @@ {7, S_O(screen_scroll_step), 16, "screen scroll step", NULL }, /* 1...112 */ #endif #endif /* HAVE_LCD_BITMAP */ + {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.192 diff -u -r1.192 settings.h --- apps/settings.h 22 Jan 2006 04:24:25 -0000 1.192 +++ apps/settings.h 31 Jan 2006 04:59:44 -0000 @@ -403,6 +403,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 31 Jan 2006 04:59:45 -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.59 diff -u -r1.59 tree.h --- apps/tree.h 20 Jan 2006 20:39:39 -0000 1.59 +++ apps/tree.h 31 Jan 2006 04:59:45 -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.212 diff -u -r1.212 english.lang --- apps/lang/english.lang 25 Jan 2006 08:29:12 -0000 1.212 +++ apps/lang/english.lang 31 Jan 2006 04:59:48 -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)"