diff options
author | Thom Johansen <thomj@rockbox.org> | 2007-03-07 19:11:16 +0000 |
---|---|---|
committer | Thom Johansen <thomj@rockbox.org> | 2007-03-07 19:11:16 +0000 |
commit | 99b2742cd0de7181677f3aa7222caa5dc358ee12 (patch) | |
tree | 55c0cec293ca3fb1c35dc5fa983bb03bff54785d /apps/settings.c | |
parent | 09b97b4a21921f05d29d215e0d5cf7df4f83a472 (diff) | |
download | rockbox-99b2742cd0de7181677f3aa7222caa5dc358ee12.tar.gz rockbox-99b2742cd0de7181677f3aa7222caa5dc358ee12.zip |
Use the new DSP callback functionality in firmware/sound.c to deal with SWCODEC stereo width and channel configuration instead of the old more spread out #ifdef based approach. Rename the DSP functions involved for more consistent naming.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12677 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings.c')
-rw-r--r-- | apps/settings.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/apps/settings.c b/apps/settings.c index 331229190a..0b2f2d9d40 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -642,20 +642,15 @@ void settings_apply_pm_range(void) | |||
642 | 642 | ||
643 | void sound_settings_apply(void) | 643 | void sound_settings_apply(void) |
644 | { | 644 | { |
645 | #ifdef HAVE_SW_TONE_CONTROLS | 645 | #if CONFIG_CODEC == SWCODEC |
646 | sound_set_dsp_callback(dsp_callback); | 646 | sound_set_dsp_callback(dsp_callback); |
647 | #endif | 647 | #endif |
648 | sound_set(SOUND_BASS, global_settings.bass); | 648 | sound_set(SOUND_BASS, global_settings.bass); |
649 | sound_set(SOUND_TREBLE, global_settings.treble); | 649 | sound_set(SOUND_TREBLE, global_settings.treble); |
650 | sound_set(SOUND_BALANCE, global_settings.balance); | 650 | sound_set(SOUND_BALANCE, global_settings.balance); |
651 | sound_set(SOUND_VOLUME, global_settings.volume); | 651 | sound_set(SOUND_VOLUME, global_settings.volume); |
652 | #if CONFIG_CODEC == SWCODEC | ||
653 | channels_set(global_settings.channel_config); | ||
654 | stereo_width_set(global_settings.stereo_width); | ||
655 | #else | ||
656 | sound_set(SOUND_CHANNELS, global_settings.channel_config); | 652 | sound_set(SOUND_CHANNELS, global_settings.channel_config); |
657 | sound_set(SOUND_STEREO_WIDTH, global_settings.stereo_width); | 653 | sound_set(SOUND_STEREO_WIDTH, global_settings.stereo_width); |
658 | #endif | ||
659 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) | 654 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
660 | sound_set(SOUND_LOUDNESS, global_settings.loudness); | 655 | sound_set(SOUND_LOUDNESS, global_settings.loudness); |
661 | sound_set(SOUND_AVC, global_settings.avc); | 656 | sound_set(SOUND_AVC, global_settings.avc); |
@@ -952,6 +947,7 @@ static void dec_sound_formatter(char *buffer, int buffer_size, | |||
952 | int dec = val % 10; | 947 | int dec = val % 10; |
953 | snprintf(buffer, buffer_size, "%c%d.%d %s", sign, integer, dec, unit); | 948 | snprintf(buffer, buffer_size, "%c%d.%d %s", sign, integer, dec, unit); |
954 | } | 949 | } |
950 | |||
955 | bool set_sound(const unsigned char * string, | 951 | bool set_sound(const unsigned char * string, |
956 | int* variable, | 952 | int* variable, |
957 | int setting) | 953 | int setting) |
@@ -970,14 +966,6 @@ bool set_sound(const unsigned char * string, | |||
970 | else if (*unit == 'H') | 966 | else if (*unit == 'H') |
971 | talkunit = UNIT_HERTZ; | 967 | talkunit = UNIT_HERTZ; |
972 | if (!numdec) | 968 | if (!numdec) |
973 | #if CONFIG_CODEC == SWCODEC | ||
974 | /* We need to hijack this one and send it off to apps/dsp.c instead of | ||
975 | firmware/sound.c */ | ||
976 | if (setting == SOUND_STEREO_WIDTH) | ||
977 | return set_int(string, unit, talkunit, variable, &stereo_width_set, | ||
978 | steps, min, max, NULL ); | ||
979 | else | ||
980 | #endif | ||
981 | return set_int(string, unit, talkunit, variable, sound_callback, | 969 | return set_int(string, unit, talkunit, variable, sound_callback, |
982 | steps, min, max, NULL ); | 970 | steps, min, max, NULL ); |
983 | else | 971 | else |