diff options
-rw-r--r-- | apps/lang/english.lang | 14 | ||||
-rw-r--r-- | apps/menus/playlist_menu.c | 7 | ||||
-rw-r--r-- | apps/onplay.c | 13 | ||||
-rw-r--r-- | apps/settings.h | 1 | ||||
-rw-r--r-- | apps/settings_list.c | 4 | ||||
-rw-r--r-- | manual/configure_rockbox/playlist_options.tex | 6 | ||||
-rw-r--r-- | manual/working_with_playlists/main.tex | 5 |
7 files changed, 45 insertions, 5 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 4689660176..3b505bb9a2 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -16354,3 +16354,17 @@ | |||
16354 | *: "Play Shuffled" | 16354 | *: "Play Shuffled" |
16355 | </voice> | 16355 | </voice> |
16356 | </phrase> | 16356 | </phrase> |
16357 | <phrase> | ||
16358 | id: LANG_KEEP_CURRENT_TRACK_ON_REPLACE | ||
16359 | desc: used in the playlist settings menu | ||
16360 | user: core | ||
16361 | <source> | ||
16362 | *: "Keep Current Track When Replacing Playlist" | ||
16363 | </source> | ||
16364 | <dest> | ||
16365 | *: "Keep Current Track When Replacing Playlist" | ||
16366 | </dest> | ||
16367 | <voice> | ||
16368 | *: "Keep Current Track When Replacing Playlist" | ||
16369 | </voice> | ||
16370 | </phrase> | ||
diff --git a/apps/menus/playlist_menu.c b/apps/menus/playlist_menu.c index b84abe0b37..e1e83d4311 100644 --- a/apps/menus/playlist_menu.c +++ b/apps/menus/playlist_menu.c | |||
@@ -169,12 +169,17 @@ MAKE_MENU(viewer_settings_menu, ID2P(LANG_PLAYLISTVIEWER_SETTINGS), | |||
169 | 169 | ||
170 | /* Current Playlist submenu */ | 170 | /* Current Playlist submenu */ |
171 | MENUITEM_SETTING(warn_on_erase, &global_settings.warnon_erase_dynplaylist, NULL); | 171 | MENUITEM_SETTING(warn_on_erase, &global_settings.warnon_erase_dynplaylist, NULL); |
172 | MENUITEM_SETTING(keep_current_track_on_replace, &global_settings.keep_current_track_on_replace_playlist, NULL); | ||
172 | MENUITEM_SETTING(show_shuffled_adding_options, &global_settings.show_shuffled_adding_options, NULL); | 173 | MENUITEM_SETTING(show_shuffled_adding_options, &global_settings.show_shuffled_adding_options, NULL); |
173 | MENUITEM_SETTING(show_queue_options, &global_settings.show_queue_options, NULL); | 174 | MENUITEM_SETTING(show_queue_options, &global_settings.show_queue_options, NULL); |
174 | MENUITEM_SETTING(playlist_reload_after_save, &global_settings.playlist_reload_after_save, NULL); | 175 | MENUITEM_SETTING(playlist_reload_after_save, &global_settings.playlist_reload_after_save, NULL); |
175 | MAKE_MENU(currentplaylist_settings_menu, ID2P(LANG_CURRENT_PLAYLIST), | 176 | MAKE_MENU(currentplaylist_settings_menu, ID2P(LANG_CURRENT_PLAYLIST), |
176 | NULL, Icon_Playlist, | 177 | NULL, Icon_Playlist, |
177 | &warn_on_erase, &show_shuffled_adding_options, &show_queue_options, &playlist_reload_after_save); | 178 | &warn_on_erase, |
179 | &keep_current_track_on_replace, | ||
180 | &show_shuffled_adding_options, | ||
181 | &show_queue_options, | ||
182 | &playlist_reload_after_save); | ||
178 | 183 | ||
179 | MAKE_MENU(playlist_settings, ID2P(LANG_PLAYLISTS), NULL, | 184 | MAKE_MENU(playlist_settings, ID2P(LANG_PLAYLISTS), NULL, |
180 | Icon_Playlist, | 185 | Icon_Playlist, |
diff --git a/apps/onplay.c b/apps/onplay.c index 729fe40f0a..4ffa6deece 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -504,8 +504,8 @@ static int add_to_playlist(void* arg) | |||
504 | { | 504 | { |
505 | struct add_to_pl_param* param = arg; | 505 | struct add_to_pl_param* param = arg; |
506 | int position = param->position; | 506 | int position = param->position; |
507 | bool new_playlist = param->replace ? true : false; | 507 | bool new_playlist = !!param->replace; |
508 | bool queue = param->queue ? true : false; | 508 | bool queue = !!param->queue; |
509 | 509 | ||
510 | /* warn if replacing the playlist */ | 510 | /* warn if replacing the playlist */ |
511 | if (new_playlist && !warn_on_pl_erase()) | 511 | if (new_playlist && !warn_on_pl_erase()) |
@@ -519,6 +519,15 @@ static int add_to_playlist(void* arg) | |||
519 | 519 | ||
520 | splash(0, ID2P(LANG_WAIT)); | 520 | splash(0, ID2P(LANG_WAIT)); |
521 | 521 | ||
522 | if (new_playlist && global_settings.keep_current_track_on_replace_playlist) | ||
523 | { | ||
524 | if (audio_status() & AUDIO_STATUS_PLAY) | ||
525 | { | ||
526 | playlist_remove_all_tracks(NULL); | ||
527 | new_playlist = false; | ||
528 | } | ||
529 | } | ||
530 | |||
522 | if (new_playlist) | 531 | if (new_playlist) |
523 | playlist_create(NULL, NULL); | 532 | playlist_create(NULL, NULL); |
524 | 533 | ||
diff --git a/apps/settings.h b/apps/settings.h index 53d7d35cae..9af8e27e5e 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -607,6 +607,7 @@ struct user_settings | |||
607 | bool fade_on_stop; /* fade on pause/unpause/stop */ | 607 | bool fade_on_stop; /* fade on pause/unpause/stop */ |
608 | bool playlist_shuffle; | 608 | bool playlist_shuffle; |
609 | bool warnon_erase_dynplaylist; /* warn when erasing dynamic playlist */ | 609 | bool warnon_erase_dynplaylist; /* warn when erasing dynamic playlist */ |
610 | bool keep_current_track_on_replace_playlist; | ||
610 | bool show_shuffled_adding_options; /* whether to display options for adding shuffled tracks to dynamic playlist */ | 611 | bool show_shuffled_adding_options; /* whether to display options for adding shuffled tracks to dynamic playlist */ |
611 | int show_queue_options; /* how and whether to display options to queue tracks */ | 612 | int show_queue_options; /* how and whether to display options to queue tracks */ |
612 | #ifdef HAVE_ALBUMART | 613 | #ifdef HAVE_ALBUMART |
diff --git a/apps/settings_list.c b/apps/settings_list.c index c2dec49499..0e39a58b1a 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c | |||
@@ -1753,9 +1753,11 @@ const struct settings_list settings[] = { | |||
1753 | ID2P(LANG_CODEPAGE_JAPANESE), | 1753 | ID2P(LANG_CODEPAGE_JAPANESE), |
1754 | ID2P(LANG_CODEPAGE_SIMPLIFIED), ID2P(LANG_CODEPAGE_KOREAN), | 1754 | ID2P(LANG_CODEPAGE_SIMPLIFIED), ID2P(LANG_CODEPAGE_KOREAN), |
1755 | ID2P(LANG_CODEPAGE_TRADITIONAL), ID2P(LANG_CODEPAGE_UTF8)), | 1755 | ID2P(LANG_CODEPAGE_TRADITIONAL), ID2P(LANG_CODEPAGE_UTF8)), |
1756 | |||
1756 | OFFON_SETTING(0, warnon_erase_dynplaylist, LANG_WARN_ERASEDYNPLAYLIST_MENU, | 1757 | OFFON_SETTING(0, warnon_erase_dynplaylist, LANG_WARN_ERASEDYNPLAYLIST_MENU, |
1757 | true, "warn when erasing dynamic playlist",NULL), | 1758 | true, "warn when erasing dynamic playlist",NULL), |
1758 | 1759 | OFFON_SETTING(0, keep_current_track_on_replace_playlist, LANG_KEEP_CURRENT_TRACK_ON_REPLACE, | |
1760 | true, "keep current track when replacing playlist",NULL), | ||
1759 | OFFON_SETTING(0, show_shuffled_adding_options, LANG_SHOW_SHUFFLED_ADDING_OPTIONS, true, | 1761 | OFFON_SETTING(0, show_shuffled_adding_options, LANG_SHOW_SHUFFLED_ADDING_OPTIONS, true, |
1760 | "show shuffled adding options", NULL), | 1762 | "show shuffled adding options", NULL), |
1761 | CHOICE_SETTING(0, show_queue_options, LANG_SHOW_QUEUE_OPTIONS, 1, | 1763 | CHOICE_SETTING(0, show_queue_options, LANG_SHOW_QUEUE_OPTIONS, 1, |
diff --git a/manual/configure_rockbox/playlist_options.tex b/manual/configure_rockbox/playlist_options.tex index 4f6024127e..b29842ceed 100644 --- a/manual/configure_rockbox/playlist_options.tex +++ b/manual/configure_rockbox/playlist_options.tex | |||
@@ -31,6 +31,12 @@ related to playlists. | |||
31 | If set to \setting{Yes}, Rockbox will provide a warning if the user attempts to | 31 | If set to \setting{Yes}, Rockbox will provide a warning if the user attempts to |
32 | take an action that will cause Rockbox to erase the current dynamic playlist. | 32 | take an action that will cause Rockbox to erase the current dynamic playlist. |
33 | 33 | ||
34 | \item[Keep Current Track When Replacing Playlist.] | ||
35 | If set to \setting{Yes}, then \setting{Play} and \setting{Play Shuffled} in | ||
36 | the \setting{Current Playlist submenu} will allow the current track to finish | ||
37 | playing before the new tracks play. If set to \setting{No}, the current | ||
38 | track will be interrupted and new tracks will start playing immediately. | ||
39 | |||
34 | \item[Show Shuffled Adding Options.] | 40 | \item[Show Shuffled Adding Options.] |
35 | If set to \setting{No}, Rockbox will not offer to add shuffled tracks | 41 | If set to \setting{No}, Rockbox will not offer to add shuffled tracks |
36 | in the \setting{Current Playlist submenu}. | 42 | in the \setting{Current Playlist submenu}. |
diff --git a/manual/working_with_playlists/main.tex b/manual/working_with_playlists/main.tex index 0d1ab7ef04..8571aac61c 100644 --- a/manual/working_with_playlists/main.tex +++ b/manual/working_with_playlists/main.tex | |||
@@ -118,7 +118,10 @@ following two options will achieve that effect. | |||
118 | 118 | ||
119 | \begin{description} | 119 | \begin{description} |
120 | \item [Play.] Replace all entries in the dynamic playlist with the selected | 120 | \item [Play.] Replace all entries in the dynamic playlist with the selected |
121 | tracks and start playing the new playlist immediately. | 121 | tracks. If \setting{Keep Current Track When Replacing Playlist} is set to |
122 | \setting{Yes}, the new tracks will play after the current track finishes | ||
123 | playing; if no track is playing or the setting is \setting{No}, the new | ||
124 | tracks will begin playing immediately. | ||
122 | 125 | ||
123 | \item [Play Shuffled.] Similar, except the tracks will be added to the new | 126 | \item [Play Shuffled.] Similar, except the tracks will be added to the new |
124 | playlist in random order. | 127 | playlist in random order. |