From 54044fd6e9739376cd0df28c26afea66f295a4d3 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Mon, 30 Jan 2012 21:21:41 +0100 Subject: Apply "Skip to outro" and specific skip lengths to individual tracks in a cuesheet. Previously it applied to the whole file and you couldn't skip betweenn the subtracks. Now it behaves consistently with real seperated tracks. Change-Id: Ic1730ace142a05d9726b8c9afd67e94823651b60 --- apps/gui/wps.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'apps/gui/wps.c') diff --git a/apps/gui/wps.c b/apps/gui/wps.c index b4ffe2a88b..39d71c8464 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c @@ -546,10 +546,20 @@ static void next_track(void) static void play_hop(int direction) { struct wps_state *state = skin_get_global_state(); + struct cuesheet *cue = state->id3->cuesheet; long step = global_settings.skip_length*1000; long elapsed = state->id3->elapsed; long remaining = state->id3->length - elapsed; + /* if cuesheet is active, then we want the current tracks end instead of + * the total end */ + if (cue && (cue->curr_track_idx+1 < cue->track_count)) + { + int next = cue->curr_track_idx+1; + struct cue_track_info *t = &cue->tracks[next]; + remaining = t->offset - elapsed; + } + if (step < 0) { if (direction < 0) -- cgit v1.2.3