summaryrefslogtreecommitdiff
path: root/apps/settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings.c')
-rw-r--r--apps/settings.c44
1 files changed, 3 insertions, 41 deletions
diff --git a/apps/settings.c b/apps/settings.c
index aa51e051e9..8afec9f806 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -87,10 +87,6 @@ struct system_status global_status;
87#include "enc_config.h" 87#include "enc_config.h"
88#endif 88#endif
89#include "pcm_sampr.h" 89#include "pcm_sampr.h"
90#ifdef HAVE_PLAY_FREQ
91#include "pcm_mixer.h"
92#include "dsp_core.h"
93#endif
94#endif /* CONFIG_CODEC == SWCODEC */ 90#endif /* CONFIG_CODEC == SWCODEC */
95 91
96#define NVRAM_BLOCK_SIZE 44 92#define NVRAM_BLOCK_SIZE 44
@@ -735,41 +731,6 @@ void settings_apply_pm_range(void)
735} 731}
736#endif /* HAVE_LCD_BITMAP */ 732#endif /* HAVE_LCD_BITMAP */
737 733
738#ifdef HAVE_PLAY_FREQ
739void settings_apply_play_freq(int value, bool playback)
740{
741 static const unsigned long play_sampr[] = { SAMPR_44, SAMPR_48 };
742 static int prev_setting = 0;
743
744 if ((unsigned)value >= ARRAYLEN(play_sampr))
745 value = 0;
746
747 bool changed = value != prev_setting;
748 prev_setting = value;
749
750 unsigned long elapsed = 0;
751 unsigned long offset = 0;
752 bool playing = changed && !playback &&
753 audio_status() == AUDIO_STATUS_PLAY;
754
755 if (playing)
756 {
757 struct mp3entry *id3 = audio_current_track();
758 elapsed = id3->elapsed;
759 offset = id3->offset;
760 }
761
762 if (changed && !playback)
763 audio_hard_stop();
764
765 /* Other sub-areas of playback pick it up from the mixer */
766 mixer_set_frequency(play_sampr[value]);
767
768 if (playing)
769 audio_play(elapsed, offset);
770}
771#endif /* HAVE_PLAY_FREQ */
772
773void sound_settings_apply(void) 734void sound_settings_apply(void)
774{ 735{
775#ifdef AUDIOHW_HAVE_BASS 736#ifdef AUDIOHW_HAVE_BASS
@@ -1023,10 +984,11 @@ void settings_apply(bool read_disk)
1023 lcd_scroll_delay(global_settings.scroll_delay); 984 lcd_scroll_delay(global_settings.scroll_delay);
1024 985
1025 986
987#if CONFIG_CODEC == SWCODEC
1026#ifdef HAVE_PLAY_FREQ 988#ifdef HAVE_PLAY_FREQ
1027 settings_apply_play_freq(global_settings.play_frequency, false); 989 /* before crossfade */
990 audio_set_playback_frequency(global_settings.play_frequency);
1028#endif 991#endif
1029#if CONFIG_CODEC == SWCODEC
1030#ifdef HAVE_CROSSFADE 992#ifdef HAVE_CROSSFADE
1031 audio_set_crossfade(global_settings.crossfade); 993 audio_set_crossfade(global_settings.crossfade);
1032#endif 994#endif