Gigabeat: Separate driver for audio codec. Tweak pcm driver to comply with intended...
[Rockbox.git] / firmware / export / sound.h
blobb060b97312405e9556569740d24dea33adfc4668
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2005 by Linus Nielsen Feltzing
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
19 #ifndef SOUND_H
20 #define SOUND_H
22 #include <inttypes.h>
23 #ifdef HAVE_UDA1380
24 #include "uda1380.h"
25 #elif defined(HAVE_WM8751)
26 #include "wm8751.h"
27 #elif defined(HAVE_WM8975)
28 #include "wm8975.h"
29 #elif defined(HAVE_WM8758)
30 #include "wm8758.h"
31 #elif defined(HAVE_WM8731) || defined(HAVE_WM8721)
32 #include "wm8731l.h"
33 #elif defined(HAVE_TLV320)
34 #include "tlv320.h"
35 #elif defined(HAVE_AS3514)
36 #include "as3514.h"
37 #endif
39 extern void audiohw_postinit(void);
41 enum {
42 SOUND_VOLUME = 0,
43 SOUND_BASS,
44 SOUND_TREBLE,
45 SOUND_BALANCE,
46 SOUND_CHANNELS,
47 SOUND_STEREO_WIDTH,
48 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
49 SOUND_LOUDNESS,
50 SOUND_AVC,
51 SOUND_MDB_STRENGTH,
52 SOUND_MDB_HARMONICS,
53 SOUND_MDB_CENTER,
54 SOUND_MDB_SHAPE,
55 SOUND_MDB_ENABLE,
56 SOUND_SUPERBASS,
57 #endif
58 #if CONFIG_CODEC == MAS3587F || defined(HAVE_UDA1380) || defined(HAVE_TLV320)\
59 || defined(HAVE_WM8975) || defined(HAVE_WM8758) || defined(HAVE_WM8731)
60 SOUND_LEFT_GAIN,
61 SOUND_RIGHT_GAIN,
62 SOUND_MIC_GAIN,
63 #endif
66 enum {
67 SOUND_CHAN_STEREO = 0,
68 SOUND_CHAN_MONO,
69 SOUND_CHAN_CUSTOM,
70 SOUND_CHAN_MONO_LEFT,
71 SOUND_CHAN_MONO_RIGHT,
72 SOUND_CHAN_KARAOKE,
73 SOUND_CHAN_NUM_MODES
76 typedef void sound_set_type(int value);
78 const char *sound_unit(int setting);
79 int sound_numdecimals(int setting);
80 int sound_steps(int setting);
81 int sound_min(int setting);
82 int sound_max(int setting);
83 int sound_default(int setting);
84 sound_set_type* sound_get_fn(int setting);
86 void sound_set_dsp_callback(int (*func)(int, intptr_t));
87 void sound_set_volume(int value);
88 void sound_set_balance(int value);
89 void sound_set_bass(int value);
90 void sound_set_treble(int value);
91 void sound_set_channels(int value);
92 void sound_set_stereo_width(int value);
93 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
94 void sound_set_loudness(int value);
95 void sound_set_avc(int value);
96 void sound_set_mdb_strength(int value);
97 void sound_set_mdb_harmonics(int value);
98 void sound_set_mdb_center(int value);
99 void sound_set_mdb_shape(int value);
100 void sound_set_mdb_enable(int value);
101 void sound_set_superbass(int value);
102 #endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
104 void sound_set(int setting, int value);
105 int sound_val2phys(int setting, int value);
107 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
108 void sound_set_pitch(int permille);
109 int sound_get_pitch(void);
110 #endif
112 #endif