diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2008-09-21 14:19:18 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2008-09-21 14:19:18 +0000 |
commit | 95f516e0b9ba03372b2f2b89c9c8adf99b069913 (patch) | |
tree | 0f9b045ebe853018d75da00c1d8bddd55029fc76 /apps/playlist.c | |
parent | 8cd2bb7f34bd12fc1a6571ebc88d361a24d5a150 (diff) | |
download | rockbox-95f516e0b9ba03372b2f2b89c9c8adf99b069913.tar.gz rockbox-95f516e0b9ba03372b2f2b89c9c8adf99b069913.zip |
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
Diffstat (limited to 'apps/playlist.c')
-rw-r--r-- | apps/playlist.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 1d42ba3728..5d8d8495bf 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -297,9 +297,6 @@ static void empty_playlist(struct playlist_info* playlist, bool resume) | |||
297 | /* start with fresh playlist control file when starting new | 297 | /* start with fresh playlist control file when starting new |
298 | playlist */ | 298 | playlist */ |
299 | create_control(playlist); | 299 | create_control(playlist); |
300 | |||
301 | /* Reset resume settings */ | ||
302 | global_status.resume_first_index = 0; | ||
303 | } | 300 | } |
304 | } | 301 | } |
305 | 302 | ||
@@ -788,11 +785,6 @@ static int add_track_to_playlist(struct playlist_info* playlist, | |||
788 | { | 785 | { |
789 | playlist->first_index++; | 786 | playlist->first_index++; |
790 | 787 | ||
791 | if (seek_pos < 0 && playlist->current) | ||
792 | { | ||
793 | global_status.resume_first_index = playlist->first_index; | ||
794 | status_save(); | ||
795 | } | ||
796 | } | 788 | } |
797 | 789 | ||
798 | if (insert_position < playlist->last_insert_pos || | 790 | if (insert_position < playlist->last_insert_pos || |
@@ -903,12 +895,6 @@ static int remove_track_from_playlist(struct playlist_info* playlist, | |||
903 | if (position < playlist->first_index) | 895 | if (position < playlist->first_index) |
904 | { | 896 | { |
905 | playlist->first_index--; | 897 | playlist->first_index--; |
906 | |||
907 | if (write) | ||
908 | { | ||
909 | global_status.resume_first_index = playlist->first_index; | ||
910 | status_save(); | ||
911 | } | ||
912 | } | 898 | } |
913 | 899 | ||
914 | if (position <= playlist->last_insert_pos) | 900 | if (position <= playlist->last_insert_pos) |
@@ -1191,12 +1177,6 @@ static void find_and_set_playlist_index(struct playlist_info* playlist, | |||
1191 | { | 1177 | { |
1192 | playlist->index = playlist->first_index = i; | 1178 | playlist->index = playlist->first_index = i; |
1193 | 1179 | ||
1194 | if (playlist->current) | ||
1195 | { | ||
1196 | global_status.resume_first_index = i; | ||
1197 | status_save(); | ||
1198 | } | ||
1199 | |||
1200 | break; | 1180 | break; |
1201 | } | 1181 | } |
1202 | } | 1182 | } |
@@ -2354,7 +2334,6 @@ int playlist_resume(void) | |||
2354 | /* Terminate on EOF */ | 2334 | /* Terminate on EOF */ |
2355 | if(nread <= 0) | 2335 | if(nread <= 0) |
2356 | { | 2336 | { |
2357 | playlist->first_index = global_status.resume_first_index; | ||
2358 | break; | 2337 | break; |
2359 | } | 2338 | } |
2360 | } | 2339 | } |
@@ -2406,8 +2385,7 @@ int playlist_shuffle(int random_seed, int start_index) | |||
2406 | { | 2385 | { |
2407 | /* store the seek position before the shuffle */ | 2386 | /* store the seek position before the shuffle */ |
2408 | seek_pos = playlist->indices[start_index]; | 2387 | seek_pos = playlist->indices[start_index]; |
2409 | playlist->index = global_status.resume_first_index = | 2388 | playlist->index = playlist->first_index = start_index; |
2410 | playlist->first_index = start_index; | ||
2411 | start_current = true; | 2389 | start_current = true; |
2412 | } | 2390 | } |
2413 | 2391 | ||
@@ -2541,7 +2519,7 @@ int playlist_next(int steps) | |||
2541 | playlist->amount > 1) | 2519 | playlist->amount > 1) |
2542 | { | 2520 | { |
2543 | /* Repeat shuffle mode. Re-shuffle playlist and resume play */ | 2521 | /* Repeat shuffle mode. Re-shuffle playlist and resume play */ |
2544 | playlist->first_index = global_status.resume_first_index = 0; | 2522 | playlist->first_index = 0; |
2545 | sort_playlist(playlist, false, false); | 2523 | sort_playlist(playlist, false, false); |
2546 | randomise_playlist(playlist, current_tick, false, true); | 2524 | randomise_playlist(playlist, current_tick, false, true); |
2547 | #if CONFIG_CODEC != SWCODEC | 2525 | #if CONFIG_CODEC != SWCODEC |