summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/gwps-common.c16
-rw-r--r--apps/gui/gwps.c26
2 files changed, 10 insertions, 32 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index c0923a9ab5..dd6ac02d85 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -355,18 +355,8 @@ bool gui_wps_update(struct gui_wps *gwps)
355{ 355{
356 struct mp3entry *id3 = gwps->state->id3; 356 struct mp3entry *id3 = gwps->state->id3;
357 bool retval; 357 bool retval;
358 if (cuesheet_is_enabled() && id3->cuesheet_type 358 gwps->state->do_full_update = gwps->state->do_full_update ||
359 && (id3->elapsed < curr_cue->curr_track->offset 359 cuesheet_subtrack_changed(id3);
360 || (curr_cue->curr_track_idx < curr_cue->track_count - 1
361 && id3->elapsed >= (curr_cue->curr_track+1)->offset)))
362 {
363 /* We've changed tracks within the cuesheet :
364 we need to update the ID3 info and refresh the WPS */
365 gwps->state->do_full_update = true;
366 cue_find_current_track(curr_cue, id3->elapsed);
367 cue_spoof_id3(curr_cue, id3);
368 }
369
370 retval = gui_wps_redraw(gwps, 0, 360 retval = gui_wps_redraw(gwps, 0,
371 gwps->state->do_full_update ? 361 gwps->state->do_full_update ?
372 WPS_REFRESH_ALL : WPS_REFRESH_NON_STATIC); 362 WPS_REFRESH_ALL : WPS_REFRESH_NON_STATIC);
@@ -421,7 +411,7 @@ static void draw_progressbar(struct gui_wps *gwps,
421 pb->x, pb->x + pb->width, y, pb->height); 411 pb->x, pb->x + pb->width, y, pb->height);
422#endif 412#endif
423 413
424 if ( cuesheet_is_enabled() && state->id3->cuesheet_type ) 414 if (state->id3->cuesheet)
425 cue_draw_markers(display, state->id3->length, 415 cue_draw_markers(display, state->id3->length,
426 pb->x, pb->x + pb->width, y+1, pb->height-2); 416 pb->x, pb->x + pb->width, y+1, pb->height-2);
427} 417}
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c
index 9eea925220..eb1437c910 100644
--- a/apps/gui/gwps.c
+++ b/apps/gui/gwps.c
@@ -148,7 +148,7 @@ static void prev_track(unsigned long skip_thresh)
148 } 148 }
149 else 149 else
150 { 150 {
151 if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type) 151 if (wps_state.id3->cuesheet)
152 { 152 {
153 curr_cuesheet_skip(-1, wps_state.id3->elapsed); 153 curr_cuesheet_skip(-1, wps_state.id3->elapsed);
154 return; 154 return;
@@ -173,7 +173,7 @@ static void prev_track(unsigned long skip_thresh)
173static void next_track(void) 173static void next_track(void)
174{ 174{
175 /* take care of if we're playing a cuesheet */ 175 /* take care of if we're playing a cuesheet */
176 if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type) 176 if (wps_state.id3->cuesheet)
177 { 177 {
178 if (curr_cuesheet_skip(1, wps_state.id3->elapsed)) 178 if (curr_cuesheet_skip(1, wps_state.id3->elapsed))
179 { 179 {
@@ -557,7 +557,7 @@ long gui_wps_show(void)
557 break; 557 break;
558 if (current_tick -last_right < HZ) 558 if (current_tick -last_right < HZ)
559 { 559 {
560 if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type) 560 if (wps_state.id3->cuesheet)
561 { 561 {
562 audio_next(); 562 audio_next();
563 } 563 }
@@ -577,7 +577,7 @@ long gui_wps_show(void)
577 break; 577 break;
578 if (current_tick -last_left < HZ) 578 if (current_tick -last_left < HZ)
579 { 579 {
580 if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type) 580 if (wps_state.id3->cuesheet)
581 { 581 {
582 if (!wps_state.paused) 582 if (!wps_state.paused)
583#if (CONFIG_CODEC == SWCODEC) 583#if (CONFIG_CODEC == SWCODEC)
@@ -870,22 +870,10 @@ static void track_changed_callback(void *param)
870{ 870{
871 wps_state.id3 = (struct mp3entry*)param; 871 wps_state.id3 = (struct mp3entry*)param;
872 wps_state.nid3 = audio_next_track(); 872 wps_state.nid3 = audio_next_track();
873 873 if (wps_state.id3->cuesheet)
874 if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type
875 && strcmp(wps_state.id3->path, curr_cue->audio_filename))
876 { 874 {
877 /* the current cuesheet isn't the right one any more */ 875 cue_find_current_track(wps_state.id3->cuesheet, wps_state.id3->elapsed);
878 /* We need to parse the new cuesheet */ 876 cue_spoof_id3(wps_state.id3->cuesheet, wps_state.id3);
879 char cuepath[MAX_PATH];
880
881 if (look_for_cuesheet_file(wps_state.id3->path, cuepath) &&
882 parse_cuesheet(cuepath, curr_cue))
883 {
884 wps_state.id3->cuesheet_type = 1;
885 strcpy(curr_cue->audio_filename, wps_state.id3->path);
886 }
887
888 cue_spoof_id3(curr_cue, wps_state.id3);
889 } 877 }
890 wps_state.do_full_update = true; 878 wps_state.do_full_update = true;
891} 879}