From 80d0d15ca9b253f8a446f50cf25d3d4b850bcfd1 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sat, 15 May 2010 13:09:45 +0000 Subject: Gigabeat S: Fully enable access to hardware tone controls and 3-D effect feature. Under the hood, it's designated a hardware equalizer since it is one. Implement code framework for hardware EQ in general. Menu aspect is well abstracted and so the UI and strings can be changed around if taste doesn't quite suit. So far the emphasis is distinction of the UI labelling from the software EQ so that it's clear the settings are for a different thing. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26051 a1c6a512-1295-4272-9138-f99709370657 --- apps/settings.c | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'apps/settings.c') diff --git a/apps/settings.c b/apps/settings.c index 4901957263..6349372326 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -27,6 +27,7 @@ #include "config.h" #include "action.h" #include "crc32.h" +#include "sound.h" #include "settings.h" #include "debug.h" #include "usb.h" @@ -55,7 +56,6 @@ #include "powermgmt.h" #include "keyboard.h" #include "version.h" -#include "sound.h" #include "rbunicode.h" #include "dircache.h" #include "splash.h" @@ -718,8 +718,12 @@ void sound_settings_apply(void) #if CONFIG_CODEC == SWCODEC sound_set_dsp_callback(dsp_callback); #endif +#ifdef AUDIOHW_HAVE_BASS sound_set(SOUND_BASS, global_settings.bass); +#endif +#ifdef AUDIOHW_HAVE_TREBLE sound_set(SOUND_TREBLE, global_settings.treble); +#endif sound_set(SOUND_BALANCE, global_settings.balance); sound_set(SOUND_VOLUME, global_settings.volume); sound_set(SOUND_CHANNELS, global_settings.channel_config); @@ -734,13 +738,36 @@ void sound_settings_apply(void) sound_set(SOUND_MDB_ENABLE, global_settings.mdb_enable); sound_set(SOUND_SUPERBASS, global_settings.superbass); #endif - -#ifdef HAVE_WM8758 +#ifdef AUDIOHW_HAVE_BASS_CUTOFF sound_set(SOUND_BASS_CUTOFF, global_settings.bass_cutoff); +#endif +#ifdef AUDIOHW_HAVE_TREBLE_CUTOFF sound_set(SOUND_TREBLE_CUTOFF, global_settings.treble_cutoff); #endif -} +#ifdef AUDIOHW_HAVE_DEPTH_3D + sound_set(SOUND_DEPTH_3D, global_settings.depth_3d); +#endif +#ifdef AUDIOHW_HAVE_EQ + int b; + for (b = 0; b < AUDIOHW_EQ_BAND_NUM; b++) + { + int setting = sound_enum_hw_eq_band_setting(b, AUDIOHW_EQ_GAIN); + sound_set(setting, global_settings.hw_eq_bands[b].gain); + +#ifdef AUDIOHW_HAVE_EQ_FREQUENCY + setting = sound_enum_hw_eq_band_setting(b, AUDIOHW_EQ_FREQUENCY); + if (setting != -1) + sound_set(setting, global_settings.hw_eq_bands[b].frequency); +#endif /* AUDIOHW_HAVE_EQ_FREQUENCY */ +#ifdef AUDIOHW_HAVE_EQ_WIDTH + setting = sound_enum_hw_eq_band_setting(b, AUDIOHW_EQ_WIDTH); + if (setting != -1) + sound_set(setting, global_settings.hw_eq_bands[b].width); +#endif /* AUDIOHW_HAVE_EQ_WIDTH */ + } +#endif +} void settings_apply(bool read_disk) { -- cgit v1.2.3