diff options
author | William Wilgus <wilgus.william@gmail.com> | 2023-09-21 10:37:29 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2023-09-23 00:52:38 -0400 |
commit | fcc82dfdca470e49d864da9af4fa9573ad6e54fe (patch) | |
tree | 588e9f63fa321d87567035a136bbd5328ea3b47d /apps/playlist.c | |
parent | a45204f5df18843674c8072f95817e24aed4ff27 (diff) | |
download | rockbox-fcc82dfdca470e49d864da9af4fa9573ad6e54fe.tar.gz rockbox-fcc82dfdca470e49d864da9af4fa9573ad6e54fe.zip |
[BugFix] REPEAT_ONE manual track skip
Still having problems with determining the type of track change
lets try just watching the audio_next/prev functions
Change-Id: Ie4233ff4d4bf49792a6549d7bcd169ff4b1afd20
Diffstat (limited to 'apps/playlist.c')
-rw-r--r-- | apps/playlist.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 7c37333bd8..d0aedb5ca1 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -168,10 +168,10 @@ | |||
168 | 168 | ||
169 | static struct playlist_info current_playlist; | 169 | static struct playlist_info current_playlist; |
170 | /* REPEAT_ONE support function from playback.c */ | 170 | /* REPEAT_ONE support function from playback.c */ |
171 | extern bool audio_pending_track_skip_is_auto(void); | 171 | extern bool audio_pending_track_skip_is_manual(void); |
172 | static inline bool is_manual_skip(void) | 172 | static inline bool is_manual_skip(void) |
173 | { | 173 | { |
174 | return !audio_pending_track_skip_is_auto(); | 174 | return audio_pending_track_skip_is_manual(); |
175 | } | 175 | } |
176 | 176 | ||
177 | /* Directory Cache*/ | 177 | /* Directory Cache*/ |
@@ -1698,8 +1698,7 @@ static int get_next_index(const struct playlist_info* playlist, int steps, | |||
1698 | if (repeat_mode == -1) | 1698 | if (repeat_mode == -1) |
1699 | repeat_mode = global_settings.repeat_mode; | 1699 | repeat_mode = global_settings.repeat_mode; |
1700 | 1700 | ||
1701 | if ((repeat_mode == REPEAT_SHUFFLE && playlist->amount <= 1) || | 1701 | if (repeat_mode == REPEAT_SHUFFLE && playlist->amount <= 1) |
1702 | (repeat_mode == REPEAT_ONE && is_manual_skip())) | ||
1703 | { | 1702 | { |
1704 | repeat_mode = REPEAT_ALL; | 1703 | repeat_mode = REPEAT_ALL; |
1705 | } | 1704 | } |
@@ -2833,25 +2832,25 @@ int playlist_next(int steps) | |||
2833 | playlist_write_lock(playlist); | 2832 | playlist_write_lock(playlist); |
2834 | 2833 | ||
2835 | int index; | 2834 | int index; |
2836 | int repeat = global_settings.repeat_mode; | 2835 | int repeat_mode = global_settings.repeat_mode; |
2837 | 2836 | if (repeat_mode == REPEAT_ONE) | |
2837 | { | ||
2838 | if (is_manual_skip()) | ||
2839 | repeat_mode = REPEAT_ALL; | ||
2840 | } | ||
2838 | if (steps > 0) | 2841 | if (steps > 0) |
2839 | { | 2842 | { |
2840 | if (repeat == REPEAT_ONE && is_manual_skip()) | ||
2841 | { | ||
2842 | repeat = REPEAT_ALL; | ||
2843 | } | ||
2844 | #ifdef AB_REPEAT_ENABLE | 2843 | #ifdef AB_REPEAT_ENABLE |
2845 | else if (repeat != REPEAT_ONE && repeat != REPEAT_AB) | 2844 | if (repeat_mode != REPEAT_AB && repeat_mode != REPEAT_ONE) |
2846 | #else | 2845 | #else |
2847 | else if (repeat != REPEAT_ONE) | 2846 | if (repeat_mode != REPEAT_ONE) |
2848 | #endif | 2847 | #endif |
2849 | { | 2848 | { |
2850 | int i, j; | 2849 | int i, j; |
2851 | /* We need to delete all the queued songs */ | 2850 | /* We need to delete all the queued songs */ |
2852 | for (i=0, j=steps; i<j; i++) | 2851 | for (i=0, j=steps; i<j; i++) |
2853 | { | 2852 | { |
2854 | index = get_next_index(playlist, i, repeat); | 2853 | index = get_next_index(playlist, i, -1); |
2855 | 2854 | ||
2856 | if (index >= 0 && playlist->indices[index] & PLAYLIST_QUEUE_MASK) | 2855 | if (index >= 0 && playlist->indices[index] & PLAYLIST_QUEUE_MASK) |
2857 | { | 2856 | { |
@@ -2861,12 +2860,12 @@ int playlist_next(int steps) | |||
2861 | } | 2860 | } |
2862 | } | 2861 | } |
2863 | } /*steps > 0*/ | 2862 | } /*steps > 0*/ |
2864 | index = get_next_index(playlist, steps, repeat); | 2863 | index = get_next_index(playlist, steps, repeat_mode); |
2865 | 2864 | ||
2866 | if (index < 0) | 2865 | if (index < 0) |
2867 | { | 2866 | { |
2868 | /* end of playlist... or is it */ | 2867 | /* end of playlist... or is it */ |
2869 | if (repeat == REPEAT_SHUFFLE && playlist->amount > 1) | 2868 | if (repeat_mode == REPEAT_SHUFFLE && playlist->amount > 1) |
2870 | { | 2869 | { |
2871 | /* Repeat shuffle mode. Re-shuffle playlist and resume play */ | 2870 | /* Repeat shuffle mode. Re-shuffle playlist and resume play */ |
2872 | playlist->first_index = 0; | 2871 | playlist->first_index = 0; |