summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2013-07-14 07:59:39 -0400
committerMichael Sevakis <jethead71@rockbox.org>2014-03-10 04:12:30 +0100
commit31b712286721dd606940c7b557d03e3f714b9604 (patch)
tree8c4a4cc32e9000ea721ebb23aa3c0129ca97bf53 /apps/gui
parentdda54b85daa83b7803b4fb189ab45859f96ff3f9 (diff)
downloadrockbox-31b712286721dd606940c7b557d03e3f714b9604.tar.gz
rockbox-31b712286721dd606940c7b557d03e3f714b9604.zip
Implement time-based resume and playback start.
This complements offset-based resume and playback start funcionality. The implementation is global on both HWCODEC and SWCODEC. Basically, if either the specified elapsed or offset are non-zero, it indicates a mid-track resume. To resume by time only, set elapsed to nonzero and offset to zero. To resume by offset only, set offset to nonzero and elapsed to zero. Which one the codec uses and which has priority is up to the codec; however, using an elapsed time covers more cases: * Codecs not able to use an offset such as VGM or other atomic formats * Starting playback at a nonzero elapsed time from a source that contains no offset, such as a cuesheet The change re-versions pretty much everything from tagcache to nvram. Change-Id: Ic7aebb24e99a03ae99585c5e236eba960d163f38 Reviewed-on: http://gerrit.rockbox.org/516 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested: Michael Sevakis <jethead71@rockbox.org>
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/skin_engine/skin_parser.c6
-rw-r--r--apps/gui/skin_engine/skin_touchsupport.c1
2 files changed, 5 insertions, 2 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index a76a06ac61..57153ed602 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -2414,10 +2414,12 @@ bool skin_data_load(enum screen_type screen, struct wps_data *wps_data,
2414 (((wps_data->last_albumart_height != aa->height) || 2414 (((wps_data->last_albumart_height != aa->height) ||
2415 (wps_data->last_albumart_width != aa->width))))) 2415 (wps_data->last_albumart_width != aa->width)))))
2416 { 2416 {
2417 long offset = audio_current_track()->offset; 2417 struct mp3entry *id3 = audio_current_track();
2418 unsigned long elapsed = id3->elapsed;
2419 unsigned long offset = id3->offset;
2418 audio_stop(); 2420 audio_stop();
2419 if (!(status & AUDIO_STATUS_PAUSE)) 2421 if (!(status & AUDIO_STATUS_PAUSE))
2420 audio_play(offset); 2422 audio_play(elapsed, offset);
2421 } 2423 }
2422 } 2424 }
2423#endif 2425#endif
diff --git a/apps/gui/skin_engine/skin_touchsupport.c b/apps/gui/skin_engine/skin_touchsupport.c
index dbc561500a..7a03e83c36 100644
--- a/apps/gui/skin_engine/skin_touchsupport.c
+++ b/apps/gui/skin_engine/skin_touchsupport.c
@@ -177,6 +177,7 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset,
177 if (playlist_resume() != -1) 177 if (playlist_resume() != -1)
178 { 178 {
179 playlist_start(global_status.resume_index, 179 playlist_start(global_status.resume_index,
180 global_status.resume_elapsed,
180 global_status.resume_offset); 181 global_status.resume_offset);
181 } 182 }
182 } 183 }