summaryrefslogtreecommitdiff
path: root/apps/gui/gwps-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/gwps-common.c')
-rw-r--r--apps/gui/gwps-common.c39
1 files changed, 6 insertions, 33 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index f32b002f69..189fc6fa31 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -348,33 +348,8 @@ bool gui_wps_display(struct gui_wps *gwps)
348 348
349bool gui_wps_update(struct gui_wps *gwps) 349bool gui_wps_update(struct gui_wps *gwps)
350{ 350{
351 bool track_changed = audio_has_changed_track();
352 struct mp3entry *id3 = gwps->state->id3; 351 struct mp3entry *id3 = gwps->state->id3;
353 352 bool retval;
354 gwps->state->nid3 = audio_next_track();
355 if (track_changed)
356 {
357 gwps->state->id3 = id3 = audio_current_track();
358
359 if (cuesheet_is_enabled() && id3->cuesheet_type
360 && strcmp(id3->path, curr_cue->audio_filename))
361 {
362 /* the current cuesheet isn't the right one any more */
363 /* We need to parse the new cuesheet */
364
365 char cuepath[MAX_PATH];
366
367 if (look_for_cuesheet_file(id3->path, cuepath) &&
368 parse_cuesheet(cuepath, curr_cue))
369 {
370 id3->cuesheet_type = 1;
371 strcpy(curr_cue->audio_filename, id3->path);
372 }
373
374 cue_spoof_id3(curr_cue, id3);
375 }
376 }
377
378 if (cuesheet_is_enabled() && id3->cuesheet_type 353 if (cuesheet_is_enabled() && id3->cuesheet_type
379 && (id3->elapsed < curr_cue->curr_track->offset 354 && (id3->elapsed < curr_cue->curr_track->offset
380 || (curr_cue->curr_track_idx < curr_cue->track_count - 1 355 || (curr_cue->curr_track_idx < curr_cue->track_count - 1
@@ -382,17 +357,15 @@ bool gui_wps_update(struct gui_wps *gwps)
382 { 357 {
383 /* We've changed tracks within the cuesheet : 358 /* We've changed tracks within the cuesheet :
384 we need to update the ID3 info and refresh the WPS */ 359 we need to update the ID3 info and refresh the WPS */
385 360 gwps->state->do_full_update = true;
386 track_changed = true;
387 cue_find_current_track(curr_cue, id3->elapsed); 361 cue_find_current_track(curr_cue, id3->elapsed);
388 cue_spoof_id3(curr_cue, id3); 362 cue_spoof_id3(curr_cue, id3);
389 } 363 }
390 364
391 if (track_changed) 365 retval = gui_wps_redraw(gwps, 0,
392 gwps->display->stop_scroll(); 366 gwps->state->do_full_update ?
393 367 WPS_REFRESH_ALL : WPS_REFRESH_NON_STATIC);
394 return gui_wps_redraw(gwps, 0, 368 return retval;
395 track_changed ? WPS_REFRESH_ALL : WPS_REFRESH_NON_STATIC);
396} 369}
397 370
398 371