forked from len0rd/rockbox
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
This commit is contained in:
parent
4c4fb82d9c
commit
24b136f62d
11 changed files with 122 additions and 104 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue