Jonathan Gordon | 4718a1e | 2007-02-08 04:33:41 +0000 | [diff] [blame] | 1 | |
| 2 | /*************************************************************************** |
| 3 | * __________ __ ___. |
| 4 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 5 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 6 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 7 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 8 | * \/ \/ \/ \/ \/ |
Jonathan Gordon | 4e73b53 | 2007-02-13 00:32:17 +0000 | [diff] [blame] | 9 | * $Id$ |
Jonathan Gordon | 4718a1e | 2007-02-08 04:33:41 +0000 | [diff] [blame] | 10 | * |
| 11 | * Copyright (C) 2007 Jonathan Gordon |
| 12 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 13 | * This program is free software; you can redistribute it and/or |
| 14 | * modify it under the terms of the GNU General Public License |
| 15 | * as published by the Free Software Foundation; either version 2 |
| 16 | * of the License, or (at your option) any later version. |
Jonathan Gordon | 4718a1e | 2007-02-08 04:33:41 +0000 | [diff] [blame] | 17 | * |
| 18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 19 | * KIND, either express or implied. |
| 20 | * |
| 21 | ****************************************************************************/ |
| 22 | |
| 23 | #include <stdbool.h> |
| 24 | #include <stddef.h> |
| 25 | #include <limits.h> |
| 26 | #include "config.h" |
| 27 | #include "lang.h" |
| 28 | #include "action.h" |
| 29 | #include "settings.h" |
| 30 | #include "menu.h" |
| 31 | #include "sound_menu.h" |
Jonathan Gordon | fe3cfcc | 2007-02-08 10:28:42 +0000 | [diff] [blame] | 32 | #include "eq_menu.h" |
Jonathan Gordon | 2801a87 | 2007-02-19 02:14:51 +0000 | [diff] [blame] | 33 | #include "exported_menus.h" |
Dan Everton | 0466319 | 2008-03-03 11:06:04 +0000 | [diff] [blame] | 34 | #include "menu_common.h" |
Jonathan Gordon | 4718a1e | 2007-02-08 04:33:41 +0000 | [diff] [blame] | 35 | |
Jonathan Gordon | fe3cfcc | 2007-02-08 10:28:42 +0000 | [diff] [blame] | 36 | /***********************************/ |
| 37 | /* SOUND MENU */ |
Dan Everton | 0466319 | 2008-03-03 11:06:04 +0000 | [diff] [blame] | 38 | MENUITEM_SETTING(volume, &global_settings.volume, NULL); |
| 39 | MENUITEM_SETTING(bass, &global_settings.bass, |
| 40 | #ifdef HAVE_SW_TONE_CONTROLS |
| 41 | lowlatency_callback |
Jonathan Gordon | fe3cfcc | 2007-02-08 10:28:42 +0000 | [diff] [blame] | 42 | #else |
Dan Everton | 0466319 | 2008-03-03 11:06:04 +0000 | [diff] [blame] | 43 | NULL |
Jonathan Gordon | fe3cfcc | 2007-02-08 10:28:42 +0000 | [diff] [blame] | 44 | #endif |
Dan Everton | 0466319 | 2008-03-03 11:06:04 +0000 | [diff] [blame] | 45 | ); |
Dan Everton | d7e1f77 | 2007-11-24 07:51:00 +0000 | [diff] [blame] | 46 | #ifdef HAVE_WM8758 |
Dan Everton | 0466319 | 2008-03-03 11:06:04 +0000 | [diff] [blame] | 47 | MENUITEM_SETTING(bass_cutoff, &global_settings.bass_cutoff, NULL); |
Dan Everton | d7e1f77 | 2007-11-24 07:51:00 +0000 | [diff] [blame] | 48 | #endif |
Dan Everton | 0466319 | 2008-03-03 11:06:04 +0000 | [diff] [blame] | 49 | MENUITEM_SETTING(treble, &global_settings.treble, |
| 50 | #ifdef HAVE_SW_TONE_CONTROLS |
| 51 | lowlatency_callback |
| 52 | #else |
| 53 | NULL |
| 54 | #endif |
| 55 | ); |
Dan Everton | d7e1f77 | 2007-11-24 07:51:00 +0000 | [diff] [blame] | 56 | #ifdef HAVE_WM8758 |
Dan Everton | 0466319 | 2008-03-03 11:06:04 +0000 | [diff] [blame] | 57 | MENUITEM_SETTING(treble_cutoff, &global_settings.treble_cutoff, NULL); |
Dan Everton | d7e1f77 | 2007-11-24 07:51:00 +0000 | [diff] [blame] | 58 | #endif |
Dan Everton | 0466319 | 2008-03-03 11:06:04 +0000 | [diff] [blame] | 59 | MENUITEM_SETTING(balance, &global_settings.balance, NULL); |
| 60 | MENUITEM_SETTING(channel_config, &global_settings.channel_config, |
| 61 | #if CONFIG_CODEC == SWCODEC |
| 62 | lowlatency_callback |
| 63 | #else |
| 64 | NULL |
| 65 | #endif |
| 66 | ); |
| 67 | MENUITEM_SETTING(stereo_width, &global_settings.stereo_width, |
| 68 | #if CONFIG_CODEC == SWCODEC |
| 69 | lowlatency_callback |
| 70 | #else |
| 71 | NULL |
| 72 | #endif |
| 73 | ); |
Jonathan Gordon | fe3cfcc | 2007-02-08 10:28:42 +0000 | [diff] [blame] | 74 | |
| 75 | #if CONFIG_CODEC == SWCODEC |
| 76 | /* Crossfeed Submenu */ |
Dan Everton | 0466319 | 2008-03-03 11:06:04 +0000 | [diff] [blame] | 77 | MENUITEM_SETTING(crossfeed, &global_settings.crossfeed, lowlatency_callback); |
Jonathan Gordon | fe3cfcc | 2007-02-08 10:28:42 +0000 | [diff] [blame] | 78 | MENUITEM_SETTING(crossfeed_direct_gain, |
Dan Everton | 0466319 | 2008-03-03 11:06:04 +0000 | [diff] [blame] | 79 | &global_settings.crossfeed_direct_gain, lowlatency_callback); |
Jonathan Gordon | fe3cfcc | 2007-02-08 10:28:42 +0000 | [diff] [blame] | 80 | MENUITEM_SETTING(crossfeed_cross_gain, |
Dan Everton | 0466319 | 2008-03-03 11:06:04 +0000 | [diff] [blame] | 81 | &global_settings.crossfeed_cross_gain, lowlatency_callback); |
Jonathan Gordon | fe3cfcc | 2007-02-08 10:28:42 +0000 | [diff] [blame] | 82 | MENUITEM_SETTING(crossfeed_hf_attenuation, |
Dan Everton | 0466319 | 2008-03-03 11:06:04 +0000 | [diff] [blame] | 83 | &global_settings.crossfeed_hf_attenuation, lowlatency_callback); |
Jonathan Gordon | fe3cfcc | 2007-02-08 10:28:42 +0000 | [diff] [blame] | 84 | MENUITEM_SETTING(crossfeed_hf_cutoff, |
Dan Everton | 0466319 | 2008-03-03 11:06:04 +0000 | [diff] [blame] | 85 | &global_settings.crossfeed_hf_cutoff, lowlatency_callback); |
Jonathan Gordon | 02a8717 | 2007-03-03 13:52:14 +0000 | [diff] [blame] | 86 | MAKE_MENU(crossfeed_menu,ID2P(LANG_CROSSFEED), NULL, Icon_NOICON, |
Jonathan Gordon | fe3cfcc | 2007-02-08 10:28:42 +0000 | [diff] [blame] | 87 | &crossfeed, &crossfeed_direct_gain, &crossfeed_cross_gain, |
| 88 | &crossfeed_hf_attenuation, &crossfeed_hf_cutoff); |
| 89 | |
Jonathan Gordon | fe3cfcc | 2007-02-08 10:28:42 +0000 | [diff] [blame] | 90 | MENUITEM_SETTING(dithering_enabled, |
Dan Everton | 0466319 | 2008-03-03 11:06:04 +0000 | [diff] [blame] | 91 | &global_settings.dithering_enabled, lowlatency_callback); |
Jonathan Gordon | fe3cfcc | 2007-02-08 10:28:42 +0000 | [diff] [blame] | 92 | #endif |
| 93 | |
| 94 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
| 95 | MENUITEM_SETTING(loudness, &global_settings.loudness, NULL); |
| 96 | MENUITEM_SETTING(avc, &global_settings.avc, NULL); |
| 97 | MENUITEM_SETTING(superbass, &global_settings.superbass, NULL); |
| 98 | MENUITEM_SETTING(mdb_enable, &global_settings.mdb_enable, NULL); |
| 99 | MENUITEM_SETTING(mdb_strength, &global_settings.mdb_strength, NULL); |
| 100 | MENUITEM_SETTING(mdb_harmonics, &global_settings.mdb_harmonics, NULL); |
| 101 | MENUITEM_SETTING(mdb_center, &global_settings.mdb_center, NULL); |
| 102 | MENUITEM_SETTING(mdb_shape, &global_settings.mdb_shape, NULL); |
| 103 | #endif |
| 104 | |
| 105 | |
| 106 | |
Jonathan Gordon | 02a8717 | 2007-03-03 13:52:14 +0000 | [diff] [blame] | 107 | MAKE_MENU(sound_settings, ID2P(LANG_SOUND_SETTINGS), NULL, Icon_Audio, |
Jonathan Gordon | fe3cfcc | 2007-02-08 10:28:42 +0000 | [diff] [blame] | 108 | &volume, |
Dan Everton | d7e1f77 | 2007-11-24 07:51:00 +0000 | [diff] [blame] | 109 | &bass, |
| 110 | #ifdef HAVE_WM8758 |
| 111 | &bass_cutoff, |
| 112 | #endif |
| 113 | &treble, |
| 114 | #ifdef HAVE_WM8758 |
| 115 | &treble_cutoff, |
| 116 | #endif |
Jonathan Gordon | fe3cfcc | 2007-02-08 10:28:42 +0000 | [diff] [blame] | 117 | &balance,&channel_config,&stereo_width |
| 118 | #if CONFIG_CODEC == SWCODEC |
Jonathan Gordon | 2801a87 | 2007-02-19 02:14:51 +0000 | [diff] [blame] | 119 | ,&crossfeed_menu, &equalizer_menu, &dithering_enabled |
Jonathan Gordon | fe3cfcc | 2007-02-08 10:28:42 +0000 | [diff] [blame] | 120 | #endif |
Jonathan Gordon | fe3cfcc | 2007-02-08 10:28:42 +0000 | [diff] [blame] | 121 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
| 122 | ,&loudness,&avc,&superbass,&mdb_enable,&mdb_strength |
| 123 | ,&mdb_harmonics,&mdb_center,&mdb_shape |
| 124 | #endif |
| 125 | ); |
Jonathan Gordon | fe3cfcc | 2007-02-08 10:28:42 +0000 | [diff] [blame] | 126 | |