diff options
-rw-r--r-- | apps/menus/playback_menu.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/apps/menus/playback_menu.c b/apps/menus/playback_menu.c index a219373a8b..d5b20d09f5 100644 --- a/apps/menus/playback_menu.c +++ b/apps/menus/playback_menu.c | |||
@@ -220,17 +220,29 @@ MAKE_MENU(playback_settings,ID2P(LANG_PLAYBACK),0, | |||
220 | static int playback_callback(int action,const struct menu_item_ex *this_item) | 220 | static int playback_callback(int action,const struct menu_item_ex *this_item) |
221 | { | 221 | { |
222 | static bool old_shuffle = false; | 222 | static bool old_shuffle = false; |
223 | static int old_repeat = 0; | ||
223 | switch (action) | 224 | switch (action) |
224 | { | 225 | { |
225 | case ACTION_ENTER_MENUITEM: | 226 | case ACTION_ENTER_MENUITEM: |
226 | if (this_item == &shuffle_item) | 227 | if (this_item == &shuffle_item) |
228 | { | ||
227 | old_shuffle = global_settings.playlist_shuffle; | 229 | old_shuffle = global_settings.playlist_shuffle; |
230 | } | ||
231 | else if (this_item == &repeat_mode) | ||
232 | { | ||
233 | old_repeat = global_settings.repeat_mode; | ||
234 | } | ||
228 | break; | 235 | break; |
236 | |||
229 | case ACTION_EXIT_MENUITEM: /* on exit */ | 237 | case ACTION_EXIT_MENUITEM: /* on exit */ |
230 | if ((this_item == &shuffle_item) && | 238 | if (!(audio_status() & AUDIO_STATUS_PLAY)) |
231 | (old_shuffle != global_settings.playlist_shuffle) | 239 | break; |
232 | && (audio_status() & AUDIO_STATUS_PLAY)) | 240 | |
241 | if (this_item == &shuffle_item) | ||
233 | { | 242 | { |
243 | if (old_shuffle == global_settings.playlist_shuffle) | ||
244 | break; | ||
245 | |||
234 | #if CONFIG_CODEC == SWCODEC | 246 | #if CONFIG_CODEC == SWCODEC |
235 | dsp_set_replaygain(); | 247 | dsp_set_replaygain(); |
236 | #endif | 248 | #endif |
@@ -243,6 +255,14 @@ static int playback_callback(int action,const struct menu_item_ex *this_item) | |||
243 | playlist_sort(NULL, true); | 255 | playlist_sort(NULL, true); |
244 | } | 256 | } |
245 | } | 257 | } |
258 | else if (this_item == &repeat_mode) | ||
259 | { | ||
260 | if (old_repeat == global_settings.repeat_mode) | ||
261 | break; | ||
262 | |||
263 | audio_flush_and_reload_tracks(); | ||
264 | } | ||
265 | |||
246 | break; | 266 | break; |
247 | } | 267 | } |
248 | return action; | 268 | return action; |