summaryrefslogtreecommitdiffstats
path: root/apps/gui/gwps.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-07-20 05:18:18 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-07-20 05:18:18 +0000
commit24b136f62de82d7419751b6aaeae0ad3d8497bea (patch)
treeb9bcfd07ca26f3da2f0ce500fc39e0719b3cbb8a /apps/gui/gwps.c
parent4c4fb82d9c112ccbcc4c94a7d85fe82d09801844 (diff)
downloadrockbox-24b136f62de82d7419751b6aaeae0ad3d8497bea.tar.gz
rockbox-24b136f62de82d7419751b6aaeae0ad3d8497bea.zip
rework cuesheet support:
swcodec: search for a .cue during buffering (with the possibility of adding embedded cuesheets later) hwcodec: search for a .cue when the id3 info for the current track is requested for the first time (disk should be spining so non issue) major beenfit from this is simplofy cuesheet handling code a bit... if mp3entry.cuesheet != NULL then there is a valid cuesheet.. no need to worry about if its enabled and preloaded. There is the possibility of putting the next/prev subtrack handling inside the playback code (as well as the id3 updating stuff (see FS#9789 for more info), but thats probably not a good idea. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21978 a1c6a512-1295-4272-9138-f99709370657
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)
}
else
{
- if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type)
+ if (wps_state.id3->cuesheet)
{
curr_cuesheet_skip(-1, wps_state.id3->elapsed);
return;
@@ -173,7 +173,7 @@ static void prev_track(unsigned long skip_thresh)
static void next_track(void)
{
/* take care of if we're playing a cuesheet */
- if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type)
+ if (wps_state.id3->cuesheet)
{
if (curr_cuesheet_skip(1, wps_state.id3->elapsed))
{
@@ -557,7 +557,7 @@ long gui_wps_show(void)
break;
if (current_tick -last_right < HZ)
{
- if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type)
+ if (wps_state.id3->cuesheet)
{
audio_next();
}
@@ -577,7 +577,7 @@ long gui_wps_show(void)
break;
if (current_tick -last_left < HZ)
{
- if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type)
+ if (wps_state.id3->cuesheet)
{
if (!wps_state.paused)
#if (CONFIG_CODEC == SWCODEC)
@@ -870,22 +870,10 @@ static void track_changed_callback(void *param)
{
wps_state.id3 = (struct mp3entry*)param;
wps_state.nid3 = audio_next_track();
-
- if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type
- && strcmp(wps_state.id3->path, curr_cue->audio_filename))
+ if (wps_state.id3->cuesheet)
{
- /* the current cuesheet isn't the right one any more */
- /* We need to parse the new cuesheet */
- char cuepath[MAX_PATH];
-
- if (look_for_cuesheet_file(wps_state.id3->path, cuepath) &&
- parse_cuesheet(cuepath, curr_cue))
- {
- wps_state.id3->cuesheet_type = 1;
- strcpy(curr_cue->audio_filename, wps_state.id3->path);
- }
-
- cue_spoof_id3(curr_cue, wps_state.id3);
+ cue_find_current_track(wps_state.id3->cuesheet, wps_state.id3->elapsed);
+ cue_spoof_id3(wps_state.id3->cuesheet, wps_state.id3);
}
wps_state.do_full_update = true;
}