summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2008-09-20 15:30:55 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2008-09-20 15:30:55 +0000
commit40d713c5fc8ee1b9127fc81ce4bb97a50e2a4212 (patch)
treeb190ac5d9963bb9e2695eef107970158cc32258a /apps
parent3d5fba986578195129c7bf7f2449081c98f5845c (diff)
downloadrockbox-40d713c5fc8ee1b9127fc81ce4bb97a50e2a4212.tar.gz
rockbox-40d713c5fc8ee1b9127fc81ce4bb97a50e2a4212.zip
FS#9408 - dont bother saving the random seed in global status. I'm 99.9% sure this code was being ignored anyway.
If this commit causes problems with restarting playback open a bug report (getting testers was difficult...) Settings which are stored in the nvram.bin file will be reset with this commit. this includes resume info, runtimes, "last screen" and a few others. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18555 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/playlist.c33
-rw-r--r--apps/settings.h2
-rw-r--r--apps/settings_list.c1
-rw-r--r--apps/settings_list.h2
4 files changed, 1 insertions, 37 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 9c494778a3..1d42ba3728 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -300,7 +300,6 @@ static void empty_playlist(struct playlist_info* playlist, bool resume)
300 300
301 /* Reset resume settings */ 301 /* Reset resume settings */
302 global_status.resume_first_index = 0; 302 global_status.resume_first_index = 0;
303 global_status.resume_seed = -1;
304 } 303 }
305} 304}
306 305
@@ -443,12 +442,6 @@ static int recreate_control(struct playlist_info* playlist)
443 playlist->deleted = false; 442 playlist->deleted = false;
444 playlist->num_inserted_tracks = 0; 443 playlist->num_inserted_tracks = 0;
445 444
446 if (playlist->current)
447 {
448 global_status.resume_seed = -1;
449 status_save();
450 }
451
452 for (i=0; i<playlist->amount; i++) 445 for (i=0; i<playlist->amount; i++)
453 { 446 {
454 if (playlist->indices[i] & PLAYLIST_INSERT_TYPE_MASK) 447 if (playlist->indices[i] & PLAYLIST_INSERT_TYPE_MASK)
@@ -989,8 +982,6 @@ static int randomise_playlist(struct playlist_info* playlist,
989 { 982 {
990 update_control(playlist, PLAYLIST_COMMAND_SHUFFLE, seed, 983 update_control(playlist, PLAYLIST_COMMAND_SHUFFLE, seed,
991 playlist->first_index, NULL, NULL, NULL); 984 playlist->first_index, NULL, NULL, NULL);
992 global_status.resume_seed = seed;
993 status_save();
994 } 985 }
995 986
996 return 0; 987 return 0;
@@ -1029,8 +1020,6 @@ static int sort_playlist(struct playlist_info* playlist, bool start_current,
1029 { 1020 {
1030 update_control(playlist, PLAYLIST_COMMAND_UNSHUFFLE, 1021 update_control(playlist, PLAYLIST_COMMAND_UNSHUFFLE,
1031 playlist->first_index, -1, NULL, NULL, NULL); 1022 playlist->first_index, -1, NULL, NULL, NULL);
1032 global_status.resume_seed = 0;
1033 status_save();
1034 } 1023 }
1035 1024
1036 return 0; 1025 return 0;
@@ -1819,12 +1808,6 @@ static int flush_cached_control(struct playlist_info* playlist)
1819 1808
1820 if (result > 0) 1809 if (result > 0)
1821 { 1810 {
1822 if (global_status.resume_seed >= 0)
1823 {
1824 global_status.resume_seed = -1;
1825 status_save();
1826 }
1827
1828 playlist->num_cached = 0; 1811 playlist->num_cached = 0;
1829 playlist->pending_control_sync = true; 1812 playlist->pending_control_sync = true;
1830 1813
@@ -2207,7 +2190,6 @@ int playlist_resume(void)
2207 if (randomise_playlist(playlist, seed, false, 2190 if (randomise_playlist(playlist, seed, false,
2208 false) < 0) 2191 false) < 0)
2209 return -1; 2192 return -1;
2210
2211 sorted = false; 2193 sorted = false;
2212 break; 2194 break;
2213 } 2195 }
@@ -2372,21 +2354,6 @@ int playlist_resume(void)
2372 /* Terminate on EOF */ 2354 /* Terminate on EOF */
2373 if(nread <= 0) 2355 if(nread <= 0)
2374 { 2356 {
2375 if (global_status.resume_seed >= 0)
2376 {
2377 /* Apply shuffle command saved in settings */
2378 if (global_status.resume_seed == 0)
2379 sort_playlist(playlist, false, true);
2380 else
2381 {
2382 if (!sorted)
2383 sort_playlist(playlist, false, false);
2384
2385 randomise_playlist(playlist, global_status.resume_seed,
2386 false, true);
2387 }
2388 }
2389
2390 playlist->first_index = global_status.resume_first_index; 2357 playlist->first_index = global_status.resume_first_index;
2391 break; 2358 break;
2392 } 2359 }
diff --git a/apps/settings.h b/apps/settings.h
index 9ef8323276..855072a428 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -271,8 +271,6 @@ struct system_status
271 int resume_index; /* index in playlist (-1 for no active resume) */ 271 int resume_index; /* index in playlist (-1 for no active resume) */
272 int resume_first_index; /* index of first track in playlist */ 272 int resume_first_index; /* index of first track in playlist */
273 uint32_t resume_offset; /* byte offset in mp3 file */ 273 uint32_t resume_offset; /* byte offset in mp3 file */
274 int resume_seed; /* shuffle seed (-1=no resume shuffle 0=sorted
275 >0=shuffled) */
276 int runtime; /* current runtime since last charge */ 274 int runtime; /* current runtime since last charge */
277 int topruntime; /* top known runtime */ 275 int topruntime; /* top known runtime */
278#ifdef HAVE_DIRCACHE 276#ifdef HAVE_DIRCACHE
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 0addf5ceff..f94338cc48 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -427,7 +427,6 @@ const struct settings_list settings[] = {
427 SYSTEM_SETTING(NVRAM(4), resume_index, -1), 427 SYSTEM_SETTING(NVRAM(4), resume_index, -1),
428 SYSTEM_SETTING(NVRAM(4), resume_first_index, 0), 428 SYSTEM_SETTING(NVRAM(4), resume_first_index, 0),
429 SYSTEM_SETTING(NVRAM(4), resume_offset, -1), 429 SYSTEM_SETTING(NVRAM(4), resume_offset, -1),
430 SYSTEM_SETTING(NVRAM(4), resume_seed, -1),
431 CHOICE_SETTING(0, repeat_mode, LANG_REPEAT, REPEAT_ALL, "repeat", 430 CHOICE_SETTING(0, repeat_mode, LANG_REPEAT, REPEAT_ALL, "repeat",
432 "off,all,one,shuffle" 431 "off,all,one,shuffle"
433#ifdef AB_REPEAT_ENABLE 432#ifdef AB_REPEAT_ENABLE
diff --git a/apps/settings_list.h b/apps/settings_list.h
index f8ce4fd266..7d0f750ff9 100644
--- a/apps/settings_list.h
+++ b/apps/settings_list.h
@@ -111,7 +111,7 @@ struct table_setting {
111 111
112#define F_NVRAM_BYTES_MASK 0xE0000 /*0-4 bytes can be stored */ 112#define F_NVRAM_BYTES_MASK 0xE0000 /*0-4 bytes can be stored */
113#define F_NVRAM_MASK_SHIFT 17 113#define F_NVRAM_MASK_SHIFT 17
114#define NVRAM_CONFIG_VERSION 4 114#define NVRAM_CONFIG_VERSION 5
115/* Above define should be bumped if 115/* Above define should be bumped if
116- a new NVRAM setting is added between 2 other NVRAM settings 116- a new NVRAM setting is added between 2 other NVRAM settings
117- number of bytes for a NVRAM setting is changed 117- number of bytes for a NVRAM setting is changed