From e88d24a8407ee3fca32cf08399ce895c49c80fc0 Mon Sep 17 00:00:00 2001 From: Andree Buschmann Date: Tue, 30 Aug 2011 19:40:09 +0000 Subject: Submit parts of FS#12189 regarding codec API. Replaces access to global settings with a dedicated function to determine if the current track shall be looped. Used by several synthesizer codecs. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30391 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/spc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'apps/codecs/spc.c') diff --git a/apps/codecs/spc.c b/apps/codecs/spc.c index 3b007471a9..94ac9ffadc 100644 --- a/apps/codecs/spc.c +++ b/apps/codecs/spc.c @@ -477,7 +477,7 @@ static int play_track( void ) sampleswritten += WAV_CHUNK_SIZE; /* is track timed? */ - if (ci->global_settings->repeat_mode!=REPEAT_ONE && ci->id3->length) { + if (!ci->loop_track() && ci->id3->length) { unsigned long curtime = sampleswritten*1000LL/SAMPLE_RATE; unsigned long lasttimesample = (sampleswritten-WAV_CHUNK_SIZE); @@ -513,10 +513,10 @@ static int play_track( void ) spc_play_send_samples(samples); - if (ci->global_settings->repeat_mode!=REPEAT_ONE) - ci->set_elapsed(sampleswritten*1000LL/SAMPLE_RATE); - else + if (ci->loop_track()) ci->set_elapsed(0); + else + ci->set_elapsed(sampleswritten*1000LL/SAMPLE_RATE); } EXIT_TIMER(total); @@ -571,7 +571,7 @@ enum codec_status codec_run(void) LoadID666(buffer+0x2e); - if (ci->global_settings->repeat_mode!=REPEAT_ONE && ID666.length==0) { + if (!ci->loop_track() && ID666.length==0) { ID666.length=3*60*1000; /* 3 minutes */ ID666.fade=5*1000; /* 5 seconds */ } -- cgit v1.2.3