diff options
Diffstat (limited to 'apps/settings_list.c')
-rw-r--r-- | apps/settings_list.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/apps/settings_list.c b/apps/settings_list.c index 134b93cf48..a830ea7428 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c | |||
@@ -622,14 +622,31 @@ static void eq_set_default(void* setting, void* defaultval) | |||
622 | /* perform shuffle/unshuffle of the current playlist based on the boolean provided */ | 622 | /* perform shuffle/unshuffle of the current playlist based on the boolean provided */ |
623 | static void shuffle_playlist_callback(bool shuffle) | 623 | static void shuffle_playlist_callback(bool shuffle) |
624 | { | 624 | { |
625 | if (shuffle) | 625 | struct playlist_info *playlist = playlist_get_current(); |
626 | if (playlist->started) | ||
626 | { | 627 | { |
627 | playlist_randomise(NULL, current_tick, true); | 628 | if ((audio_status() & AUDIO_STATUS_PLAY) == AUDIO_STATUS_PLAY) |
629 | { | ||
630 | replaygain_update(); | ||
631 | if (shuffle) | ||
632 | { | ||
633 | playlist_randomise(playlist, current_tick, true); | ||
634 | } | ||
635 | else | ||
636 | { | ||
637 | playlist_sort(playlist, true); | ||
638 | } | ||
639 | } | ||
628 | } | 640 | } |
629 | else | 641 | } |
642 | |||
643 | static void repeat_mode_callback(int repeat) | ||
644 | { | ||
645 | if ((audio_status() & AUDIO_STATUS_PLAY) == AUDIO_STATUS_PLAY) | ||
630 | { | 646 | { |
631 | playlist_sort(NULL, true); | 647 | audio_flush_and_reload_tracks(); |
632 | } | 648 | } |
649 | (void)repeat; | ||
633 | } | 650 | } |
634 | 651 | ||
635 | #ifdef HAVE_QUICKSCREEN | 652 | #ifdef HAVE_QUICKSCREEN |
@@ -912,17 +929,19 @@ const struct settings_list settings[] = { | |||
912 | #endif | 929 | #endif |
913 | 930 | ||
914 | /* playback */ | 931 | /* playback */ |
915 | OFFON_SETTING(0, playlist_shuffle, LANG_SHUFFLE, false, "shuffle", shuffle_playlist_callback), | 932 | OFFON_SETTING(F_CB_ON_SELECT_ONLY_IF_CHANGED, playlist_shuffle, LANG_SHUFFLE, |
933 | false, "shuffle", shuffle_playlist_callback), | ||
934 | |||
916 | SYSTEM_SETTING(NVRAM(4), resume_index, -1), | 935 | SYSTEM_SETTING(NVRAM(4), resume_index, -1), |
917 | SYSTEM_SETTING(NVRAM(4), resume_crc32, -1), | 936 | SYSTEM_SETTING(NVRAM(4), resume_crc32, -1), |
918 | SYSTEM_SETTING(NVRAM(4), resume_elapsed, -1), | 937 | SYSTEM_SETTING(NVRAM(4), resume_elapsed, -1), |
919 | SYSTEM_SETTING(NVRAM(4), resume_offset, -1), | 938 | SYSTEM_SETTING(NVRAM(4), resume_offset, -1), |
920 | CHOICE_SETTING(0, repeat_mode, LANG_REPEAT, REPEAT_OFF, "repeat", | 939 | CHOICE_SETTING(F_CB_ON_SELECT_ONLY_IF_CHANGED, repeat_mode, LANG_REPEAT, |
921 | "off,all,one,shuffle" | 940 | REPEAT_OFF, "repeat", "off,all,one,shuffle" |
922 | #ifdef AB_REPEAT_ENABLE | 941 | #ifdef AB_REPEAT_ENABLE |
923 | ",ab" | 942 | ",ab" |
924 | #endif | 943 | #endif |
925 | , NULL, | 944 | , repeat_mode_callback, |
926 | #ifdef AB_REPEAT_ENABLE | 945 | #ifdef AB_REPEAT_ENABLE |
927 | 5, | 946 | 5, |
928 | #else | 947 | #else |