diff options
| author | Miika Pekkarinen <miipekk@ihme.org> | 2005-11-06 16:40:20 +0000 |
|---|---|---|
| committer | Miika Pekkarinen <miipekk@ihme.org> | 2005-11-06 16:40:20 +0000 |
| commit | e7461b36092611cca29697f7aca59f2247923d90 (patch) | |
| tree | 7949b01457e3a61d9863e91217f9ef00032f11d6 /apps/playback.c | |
| parent | ce1312e383e200b2745ffb118bc85f44e37d6a87 (diff) | |
| download | rockbox-e7461b36092611cca29697f7aca59f2247923d90.zip rockbox-e7461b36092611cca29697f7aca59f2247923d90.tar.gz rockbox-e7461b36092611cca29697f7aca59f2247923d90.tar.bz2 rockbox-e7461b36092611cca29697f7aca59f2247923d90.tar.xz | |
iRiver: New crossfader with more configuration capability. Might still
have small bugs, but those will be fixed as soon as possible. Config
block version bumped; please SAVE YOUR SETTINGS.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7765 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playback.c')
| -rw-r--r-- | apps/playback.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/apps/playback.c b/apps/playback.c index 8d869ce..61d0d62 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -1441,8 +1441,7 @@ void audio_update_trackinfo(void) cur_ti->start_pos = 0; ci.taginfo_ready = (bool *)&cur_ti->taginfo_ready; if (pcmbuf_is_crossfade_enabled() && !pcmbuf_is_crossfade_active()) { - pcmbuf_crossfade_init(new_track ? CROSSFADE_MODE_CROSSFADE - : global_settings.crossfade); + pcmbuf_crossfade_init(); codec_track_changed(); } else { pcmbuf_add_event(codec_track_changed); @@ -1706,7 +1705,7 @@ void audio_thread(void) ci.stop_codec = true; ci.reload_codec = false; ci.seek_time = 0; - pcmbuf_crossfade_init(CROSSFADE_MODE_CROSSFADE); + pcmbuf_crossfade_init(); while (audio_codec_loaded) yield(); audio_play_start((int)ev.data); @@ -2227,13 +2226,12 @@ void audio_set_buffer_margin(int setting) } /* Set crossfade & PCM buffer length. */ -void audio_set_crossfade(int type) +void audio_set_crossfade(int enable) { long size; bool was_playing = playing; int offset = 0; - static const int lookup[] = {1, 2, 4, 6, 8, 10, 12, 14}; - int seconds = lookup[global_settings.crossfade_duration]; + int seconds = 1; if (!filebuf) return; /* Audio buffers not yet set up */ @@ -2242,8 +2240,11 @@ void audio_set_crossfade(int type) if (playing) offset = cur_ti->id3.offset; - if (type == CROSSFADE_MODE_OFF) - seconds = 1; + if (enable) + { + seconds = global_settings.crossfade_fade_out_delay + + global_settings.crossfade_fade_out_duration; + } /* Buffer has to be at least 2s long. */ seconds += 2; @@ -2259,7 +2260,7 @@ void audio_set_crossfade(int type) if (was_playing) splash(0, true, str(LANG_RESTARTING_PLAYBACK)); pcmbuf_init(size); - pcmbuf_crossfade_enable(type != CROSSFADE_MODE_OFF); + pcmbuf_crossfade_enable(enable); reset_buffer(); logf("abuf:%dB", pcmbuf_get_bufsize()); logf("fbuf:%dB", filebuflen); |