diff options
author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-08-30 19:40:09 +0000 |
---|---|---|
committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-08-30 19:40:09 +0000 |
commit | e88d24a8407ee3fca32cf08399ce895c49c80fc0 (patch) | |
tree | c1f5b054ae0a80ab4b72f33547742577d34c48ec /apps/codecs/spc.c | |
parent | e66ad3e8a86a19b9ef9480bc52766e61955f341d (diff) | |
download | rockbox-e88d24a8407ee3fca32cf08399ce895c49c80fc0.tar.gz rockbox-e88d24a8407ee3fca32cf08399ce895c49c80fc0.zip |
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
Diffstat (limited to 'apps/codecs/spc.c')
-rw-r--r-- | apps/codecs/spc.c | 10 |
1 files changed, 5 insertions, 5 deletions
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 ) | |||
477 | sampleswritten += WAV_CHUNK_SIZE; | 477 | sampleswritten += WAV_CHUNK_SIZE; |
478 | 478 | ||
479 | /* is track timed? */ | 479 | /* is track timed? */ |
480 | if (ci->global_settings->repeat_mode!=REPEAT_ONE && ci->id3->length) { | 480 | if (!ci->loop_track() && ci->id3->length) { |
481 | unsigned long curtime = sampleswritten*1000LL/SAMPLE_RATE; | 481 | unsigned long curtime = sampleswritten*1000LL/SAMPLE_RATE; |
482 | unsigned long lasttimesample = (sampleswritten-WAV_CHUNK_SIZE); | 482 | unsigned long lasttimesample = (sampleswritten-WAV_CHUNK_SIZE); |
483 | 483 | ||
@@ -513,10 +513,10 @@ static int play_track( void ) | |||
513 | 513 | ||
514 | spc_play_send_samples(samples); | 514 | spc_play_send_samples(samples); |
515 | 515 | ||
516 | if (ci->global_settings->repeat_mode!=REPEAT_ONE) | 516 | if (ci->loop_track()) |
517 | ci->set_elapsed(sampleswritten*1000LL/SAMPLE_RATE); | ||
518 | else | ||
519 | ci->set_elapsed(0); | 517 | ci->set_elapsed(0); |
518 | else | ||
519 | ci->set_elapsed(sampleswritten*1000LL/SAMPLE_RATE); | ||
520 | } | 520 | } |
521 | 521 | ||
522 | EXIT_TIMER(total); | 522 | EXIT_TIMER(total); |
@@ -571,7 +571,7 @@ enum codec_status codec_run(void) | |||
571 | 571 | ||
572 | LoadID666(buffer+0x2e); | 572 | LoadID666(buffer+0x2e); |
573 | 573 | ||
574 | if (ci->global_settings->repeat_mode!=REPEAT_ONE && ID666.length==0) { | 574 | if (!ci->loop_track() && ID666.length==0) { |
575 | ID666.length=3*60*1000; /* 3 minutes */ | 575 | ID666.length=3*60*1000; /* 3 minutes */ |
576 | ID666.fade=5*1000; /* 5 seconds */ | 576 | ID666.fade=5*1000; /* 5 seconds */ |
577 | } | 577 | } |