more slight playlist resume cleanuping... dont bother saving the playlist first index value. its reset to 0 before playlistcontrol is loaded anyway, and then reset to 0 after its finished so its completly useless in global_status.

runtimes, resume info, etc will be reset again...


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18561 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2008-09-21 14:19:18 +00:00
parent 8cd2bb7f34
commit 95f516e0b9
4 changed files with 3 additions and 27 deletions

View file

@ -297,9 +297,6 @@ static void empty_playlist(struct playlist_info* playlist, bool resume)
/* start with fresh playlist control file when starting new
playlist */
create_control(playlist);
/* Reset resume settings */
global_status.resume_first_index = 0;
}
}
@ -788,11 +785,6 @@ static int add_track_to_playlist(struct playlist_info* playlist,
{
playlist->first_index++;
if (seek_pos < 0 && playlist->current)
{
global_status.resume_first_index = playlist->first_index;
status_save();
}
}
if (insert_position < playlist->last_insert_pos ||
@ -903,12 +895,6 @@ static int remove_track_from_playlist(struct playlist_info* playlist,
if (position < playlist->first_index)
{
playlist->first_index--;
if (write)
{
global_status.resume_first_index = playlist->first_index;
status_save();
}
}
if (position <= playlist->last_insert_pos)
@ -1191,12 +1177,6 @@ static void find_and_set_playlist_index(struct playlist_info* playlist,
{
playlist->index = playlist->first_index = i;
if (playlist->current)
{
global_status.resume_first_index = i;
status_save();
}
break;
}
}
@ -2354,7 +2334,6 @@ int playlist_resume(void)
/* Terminate on EOF */
if(nread <= 0)
{
playlist->first_index = global_status.resume_first_index;
break;
}
}
@ -2406,8 +2385,7 @@ int playlist_shuffle(int random_seed, int start_index)
{
/* store the seek position before the shuffle */
seek_pos = playlist->indices[start_index];
playlist->index = global_status.resume_first_index =
playlist->first_index = start_index;
playlist->index = playlist->first_index = start_index;
start_current = true;
}
@ -2541,7 +2519,7 @@ int playlist_next(int steps)
playlist->amount > 1)
{
/* Repeat shuffle mode. Re-shuffle playlist and resume play */
playlist->first_index = global_status.resume_first_index = 0;
playlist->first_index = 0;
sort_playlist(playlist, false, false);
randomise_playlist(playlist, current_tick, false, true);
#if CONFIG_CODEC != SWCODEC

View file

@ -269,7 +269,6 @@ bool set_option(const char* string, const void* variable, enum optiontype type,
struct system_status
{
int resume_index; /* index in playlist (-1 for no active resume) */
int resume_first_index; /* index of first track in playlist */
uint32_t resume_offset; /* byte offset in mp3 file */
int runtime; /* current runtime since last charge */
int topruntime; /* top known runtime */

View file

@ -425,7 +425,6 @@ const struct settings_list settings[] = {
/* playback */
OFFON_SETTING(0, playlist_shuffle, LANG_SHUFFLE, false, "shuffle", NULL),
SYSTEM_SETTING(NVRAM(4), resume_index, -1),
SYSTEM_SETTING(NVRAM(4), resume_first_index, 0),
SYSTEM_SETTING(NVRAM(4), resume_offset, -1),
CHOICE_SETTING(0, repeat_mode, LANG_REPEAT, REPEAT_ALL, "repeat",
"off,all,one,shuffle"

View file

@ -111,7 +111,7 @@ struct table_setting {
#define F_NVRAM_BYTES_MASK 0xE0000 /*0-4 bytes can be stored */
#define F_NVRAM_MASK_SHIFT 17
#define NVRAM_CONFIG_VERSION 5
#define NVRAM_CONFIG_VERSION 6
/* Above define should be bumped if
- a new NVRAM setting is added between 2 other NVRAM settings
- number of bytes for a NVRAM setting is changed