diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-08-21 15:08:01 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-08-21 15:08:01 +0000 |
commit | 01bc8e682ad855ae74193dcfa4bb1e24ac0662b8 (patch) | |
tree | ea96479d3428da958c0d0c0be8c9a70dcb5e6443 /apps/tree.c | |
parent | 3b8ec06f0ef39427f7e3e43a41cefaaddcc7e29c (diff) |
play_list() is now modified to accept a playlist index that is either
meant in the unshuffled list or in the shuffled. There's an extra
parameter giving that info (which of course only makes sense when
shuffle is enabled).
This should make resume work with play-all-dir in shuffled mode.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1889 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tree.c')
-rw-r--r-- | apps/tree.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/apps/tree.c b/apps/tree.c index 90e978a0ab..7f0bf4362b 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -351,6 +351,7 @@ void start_resume(void) play_list(global_settings.resume_file, slash+1, global_settings.resume_index, + true, /* the index is AFTER shuffle */ global_settings.resume_offset, global_settings.resume_seed ); *slash='/'; @@ -368,6 +369,7 @@ void start_resume(void) play_list("/", global_settings.resume_file, global_settings.resume_index, + true, global_settings.resume_offset, global_settings.resume_seed ); } @@ -381,7 +383,8 @@ void start_resume(void) build_playlist(global_settings.resume_index); play_list(global_settings.resume_file, NULL, - global_settings.resume_index, + global_settings.resume_index, + true, global_settings.resume_offset, global_settings.resume_seed); } @@ -505,8 +508,10 @@ bool dirbrowse(char *root) currdir, dircache[dircursor+start].name); play_list(currdir, - dircache[dircursor+start].name, - 0, 0, seed ); + dircache[dircursor+start].name, + 0, + false, + 0, seed ); start_index = 0; } else { @@ -514,10 +519,16 @@ bool dirbrowse(char *root) strncpy(global_settings.resume_file, currdir, MAX_PATH); start_index = build_playlist(dircursor+start); - play_list(currdir, NULL, start_index, 0, seed); + + /* it is important that we get back the index in + the (shuffled) list and stor that */ + start_index = play_list(currdir, NULL, + start_index, false, 0, seed); } if ( global_settings.resume ) { + /* the resume_index must always be the index in the + shuffled list in case shuffle is enabled */ global_settings.resume_index = start_index; global_settings.resume_offset = 0; global_settings.resume_seed = seed; |