Index: rockbox_svn/apps/onplay.c
===================================================================
--- rockbox_svn.orig/apps/onplay.c
+++ rockbox_svn/apps/onplay.c
@@ -69,6 +69,7 @@
#if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1))
#include "backdrop.h"
#endif
+#include "gwps-common.h" /* for fade() */
static int context;
static char* selected_file = NULL;
@@ -1194,3 +1195,44 @@ int onplay_one_click(char* file, int att
return onplay_result;
}
+/* one click insert play
+ * this will stop playback create a new playlist and use
+ * the click insert option to fill the new playlist */
+int onplay_one_click_play(char* file, int attr, int from){
+ int ret=1;
+ context=from;
+ selected_file = file;
+ selected_file_attr = attr;
+
+ if(global_settings.click_insert==0)
+ return ret;
+
+ /* about to create a new current playlist...
+ allow user to cancel the operation */
+ if (global_settings.warnon_erase_dynplaylist &&
+ playlist_modified(NULL))
+ {
+ char *lines[]={str(LANG_WARN_ERASEDYNPLAYLIST_PROMPT)};
+ struct text_message message={lines, 1};
+
+ if(gui_syncyesno_run(&message, NULL, NULL) != YESNO_YES)
+ return ret;
+ }
+
+ /* Stop the music if it is playing */
+ if(audio_status()) {
+ if (!global_settings.party_mode) {
+ if (global_settings.fade_on_stop)
+ fade(0);
+ bookmark_autobookmark();
+ audio_stop();
+ while (audio_status())
+ sleep(1);
+
+ } else {
+ return ret;
+ }
+ }
+
+ return onplay_one_click(file, attr, from);
+}
Index: rockbox_svn/apps/tree.c
===================================================================
--- rockbox_svn.orig/apps/tree.c
+++ rockbox_svn/apps/tree.c
@@ -629,7 +629,11 @@ static int dirbrowse()
snprintf(buf, sizeof buf, "/%s",
dircache[tc.selected_item].name);
}
- onplay_result=onplay_one_click(buf, attr, curr_context);
+ if(!global_settings.click_insert_play){
+ onplay_result=onplay_one_click(buf, attr, curr_context);
+ } else {
+ onplay_result=onplay_one_click_play(buf, attr, curr_context);
+ }
switch (onplay_result)
{
@@ -888,7 +892,7 @@ static int dirbrowse()
goto check_rescan;
}
need_update = true;
- reload_dir = false;
+ reload_dir = false;
}
if(need_update) {
Index: rockbox_svn/apps/onplay.h
===================================================================
--- rockbox_svn.orig/apps/onplay.h
+++ rockbox_svn/apps/onplay.h
@@ -21,6 +21,7 @@
int onplay(char* file, int attr, int from_screen);
int onplay_one_click(char* file, int attr, int from);
+int onplay_one_click_play(char* file, int attr, int from);
enum {
ONPLAY_MAINMENU = -1,
Index: rockbox_svn/apps/lang/english.lang
===================================================================
--- rockbox_svn.orig/apps/lang/english.lang
+++ rockbox_svn/apps/lang/english.lang
@@ -352,6 +352,20 @@
+ id: LANG_CLICK_INSERT_PLAY
+ desc: in playlist menu
+ user:
+
+ *: "Click Insert Play"
+
+
+ *: "Click Insert Play"
+
+
+ *: ""
+
+
+
id: LANG_PLUGINS
desc: in the main menu
user:
Index: rockbox_svn/apps/settings.h
===================================================================
--- rockbox_svn.orig/apps/settings.h
+++ rockbox_svn/apps/settings.h
@@ -603,6 +603,8 @@ struct user_settings
int click_insert; /*setting for click behaviour in file tree:
0:insert, 1:insert last,2:queue,
3:queue last,4:insert shuffled*/
+ bool click_insert_play; /* */
+
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
int brightness; /* iriver h300: backlight PWM value: 2..15
(0 and 1 are black) */
Index: rockbox_svn/apps/settings_list.c
===================================================================
--- rockbox_svn.orig/apps/settings_list.c
+++ rockbox_svn/apps/settings_list.c
@@ -1174,6 +1174,10 @@ const struct settings_list settings[] =
ID2P(LANG_QUEUE_FIRST) , ID2P(LANG_QUEUE_LAST),
ID2P(LANG_QUEUE_SHUFFLED)),
+ OFFON_SETTING(0,click_insert_play,
+ LANG_CLICK_INSERT_PLAY,false,
+ "click play",NULL),
+
CHOICE_SETTING(0, start_in_screen, LANG_START_SCREEN, 1,
"start in screen", "previous,root,files,db,wps,menu,"
#ifdef HAVE_RECORDING
Index: rockbox_svn/apps/menus/playlist_menu.c
===================================================================
--- rockbox_svn.orig/apps/menus/playlist_menu.c
+++ rockbox_svn/apps/menus/playlist_menu.c
@@ -75,10 +75,11 @@ MENUITEM_FUNCTION(catalog, 0, ID2P(LANG_
MENUITEM_SETTING(recursive_dir_insert, &global_settings.recursive_dir_insert, NULL);
MENUITEM_SETTING(warn_on_erase, &global_settings.warnon_erase_dynplaylist, NULL);
MENUITEM_SETTING(click_insert, &global_settings.click_insert, NULL);
+MENUITEM_SETTING(click_insert_play, &global_settings.click_insert_play, NULL);
MAKE_MENU(playlist_settings, ID2P(LANG_PLAYLIST_MENU), NULL,
Icon_Playlist,
- &recursive_dir_insert, &warn_on_erase, &click_insert);
+ &recursive_dir_insert, &warn_on_erase, &click_insert, &click_insert_play);
MAKE_MENU(playlist_options, ID2P(LANG_PLAYLIST_MENU), NULL,
Icon_Playlist,
&create_playlist_item, &view_playlist, &save_playlist, &catalog);