summaryrefslogtreecommitdiff
path: root/apps/gui/gwps.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/gwps.c')
-rw-r--r--apps/gui/gwps.c26
1 files changed, 7 insertions, 19 deletions
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}