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 | |
| parent | e66ad3e8a86a19b9ef9480bc52766e61955f341d (diff) | |
| download | rockbox-e88d24a8407ee3fca32cf08399ce895c49c80fc0.zip rockbox-e88d24a8407ee3fca32cf08399ce895c49c80fc0.tar.gz rockbox-e88d24a8407ee3fca32cf08399ce895c49c80fc0.tar.bz2 rockbox-e88d24a8407ee3fca32cf08399ce895c49c80fc0.tar.xz | |
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')
| -rw-r--r-- | apps/codecs/adx.c | 2 | ||||
| -rw-r--r-- | apps/codecs/ay.c | 6 | ||||
| -rw-r--r-- | apps/codecs/gbs.c | 4 | ||||
| -rw-r--r-- | apps/codecs/hes.c | 4 | ||||
| -rw-r--r-- | apps/codecs/kss.c | 2 | ||||
| -rw-r--r-- | apps/codecs/nsf.c | 4 | ||||
| -rw-r--r-- | apps/codecs/sgc.c | 2 | ||||
| -rw-r--r-- | apps/codecs/spc.c | 10 | ||||
| -rw-r--r-- | apps/codecs/vgm.c | 2 |
9 files changed, 18 insertions, 18 deletions
diff --git a/apps/codecs/adx.c b/apps/codecs/adx.c index 8144d5f..cc7f032 100644 --- a/apps/codecs/adx.c +++ b/apps/codecs/adx.c @@ -239,7 +239,7 @@ enum codec_status codec_run(void) if (bufoff > end_adr-18*channels && looping) { DEBUGF("ADX: loop!\n"); /* check for endless looping */ - if (ci->global_settings->repeat_mode==REPEAT_ONE) { + if (ci->loop_track()) { loop_count=0; fade_count = -1; /* disable fade */ } else { diff --git a/apps/codecs/ay.c b/apps/codecs/ay.c index 48261fb..914ffa9 100644 --- a/apps/codecs/ay.c +++ b/apps/codecs/ay.c @@ -17,8 +17,8 @@ static struct Ay_Emu ay_emu; static void set_codec_track(int t, int multitrack) { Ay_start_track(&ay_emu, t); - /* for REPEAT_ONE we disable track limits */ - if (ci->global_settings->repeat_mode != REPEAT_ONE) { + /* for loop mode we disable track limits */ + if (!ci->loop_track()) { Track_set_fade(&ay_emu, Track_get_length( &ay_emu, t ) - 4000, 4000); } if (multitrack) ci->set_elapsed(t*1000); /* t is track no to display */ @@ -111,7 +111,7 @@ next_track: ci->seek_complete(); /* Set fade again */ - if (ci->global_settings->repeat_mode != REPEAT_ONE) { + if (!ci->loop_track()) { Track_set_fade(&ay_emu, Track_get_length( &ay_emu, track ) - 4000, 4000); } } diff --git a/apps/codecs/gbs.c b/apps/codecs/gbs.c index 5d31549..c9c3420 100644 --- a/apps/codecs/gbs.c +++ b/apps/codecs/gbs.c @@ -17,8 +17,8 @@ static struct Gbs_Emu gbs_emu; static void set_codec_track(int t) { Gbs_start_track(&gbs_emu, t); - /* for REPEAT_ONE we disable track limits */ - if (ci->global_settings->repeat_mode != REPEAT_ONE) { + /* for loop mode we disable track limits */ + if (!ci->loop_track()) { Track_set_fade(&gbs_emu, Track_get_length( &gbs_emu, t ), 4000); } ci->set_elapsed(t*1000); /* t is track no to display */ diff --git a/apps/codecs/hes.c b/apps/codecs/hes.c index 8c216ed..c84134c 100644 --- a/apps/codecs/hes.c +++ b/apps/codecs/hes.c @@ -17,8 +17,8 @@ static struct Hes_Emu hes_emu; static void set_codec_track(int t) { Hes_start_track(&hes_emu, t); - /* for REPEAT_ONE we disable track limits */ - if (ci->global_settings->repeat_mode != REPEAT_ONE) { + /* for loop mode we disable track limits */ + if (!ci->loop_track()) { Track_set_fade(&hes_emu, Track_get_length( &hes_emu, t ), 4000); } ci->set_elapsed(t*1000); /* t is track no to display */ diff --git a/apps/codecs/kss.c b/apps/codecs/kss.c index 62dd055..f519b3c 100644 --- a/apps/codecs/kss.c +++ b/apps/codecs/kss.c @@ -18,7 +18,7 @@ static void set_codec_track(int t) { Kss_start_track(&kss_emu, t); /* for REPEAT_ONE we disable track limits */ - if (ci->global_settings->repeat_mode != REPEAT_ONE) { + if (!ci->loop_track()) { Track_set_fade(&kss_emu, Track_get_length( &kss_emu, t ), 4000); } ci->set_elapsed(t*1000); /* t is track no to display */ diff --git a/apps/codecs/nsf.c b/apps/codecs/nsf.c index 8899501..533972e 100644 --- a/apps/codecs/nsf.c +++ b/apps/codecs/nsf.c @@ -20,7 +20,7 @@ static void set_codec_track(int t, int multitrack) { Nsf_start_track(&nsf_emu, t); /* for REPEAT_ONE we disable track limits */ - if (ci->global_settings->repeat_mode != REPEAT_ONE) { + if (!ci->loop_track()) { Track_set_fade(&nsf_emu, Track_length( &nsf_emu, t ) - 4000, 4000); } if (multitrack) ci->set_elapsed(t*1000); /* t is track no to display */ @@ -109,7 +109,7 @@ next_track: ci->seek_complete(); /* Set fade again */ - if (ci->global_settings->repeat_mode != REPEAT_ONE) { + if (!ci->loop_track()) { Track_set_fade(&nsf_emu, Track_length( &nsf_emu, track ), 4000); } } diff --git a/apps/codecs/sgc.c b/apps/codecs/sgc.c index 2f1f3f8..993c606 100644 --- a/apps/codecs/sgc.c +++ b/apps/codecs/sgc.c @@ -23,7 +23,7 @@ static void set_codec_track(int t) { Sgc_start_track(&sgc_emu, t); /* for REPEAT_ONE we disable track limits */ - if (ci->global_settings->repeat_mode != REPEAT_ONE) { + if (!ci->loop_track()) { Track_set_fade(&sgc_emu, Track_get_length( &sgc_emu, t ), 4000); } ci->set_elapsed(t*1000); /* t is track no to display */ diff --git a/apps/codecs/spc.c b/apps/codecs/spc.c index 3b00747..94ac9ff 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 */ } diff --git a/apps/codecs/vgm.c b/apps/codecs/vgm.c index 9c8619c..9e4f887 100644 --- a/apps/codecs/vgm.c +++ b/apps/codecs/vgm.c @@ -105,7 +105,7 @@ enum codec_status codec_run(void) Vgm_start_track(&vgm_emu); /* for REPEAT_ONE we disable track limits */ - if (ci->global_settings->repeat_mode != REPEAT_ONE) { + if (!ci->loop_track()) { Track_set_fade(&vgm_emu, ci->id3->length - 4000, 4000); } |