1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2005 by Linus Nielsen Feltzing
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
28 #if CONFIG_CODEC == SWCODEC
30 DSP_CALLBACK_SET_PRESCALE
= 0,
31 DSP_CALLBACK_SET_BASS
,
32 DSP_CALLBACK_SET_TREBLE
,
33 DSP_CALLBACK_SET_CHANNEL_CONFIG
,
34 DSP_CALLBACK_SET_STEREO_WIDTH
,
35 #ifdef HAVE_SW_VOLUME_CONTROL
36 DSP_CALLBACK_SET_SW_VOLUME
,
41 typedef void sound_set_type(int value
);
43 const char *sound_unit(int setting
);
44 int sound_numdecimals(int setting
);
45 int sound_steps(int setting
);
46 int sound_min(int setting
);
47 int sound_max(int setting
);
48 int sound_default(int setting
);
49 sound_set_type
* sound_get_fn(int setting
);
51 void sound_set_dsp_callback(int (*func
)(int, intptr_t));
52 void sound_set_volume(int value
);
53 void sound_set_balance(int value
);
54 void sound_set_bass(int value
);
55 void sound_set_treble(int value
);
56 void sound_set_channels(int value
);
57 void sound_set_stereo_width(int value
);
58 #if defined(AUDIOHW_HAVE_BASS_CUTOFF)
59 void sound_set_bass_cutoff(int value
);
61 #if defined(AUDIOHW_HAVE_TREBLE_CUTOFF)
62 void sound_set_treble_cutoff(int value
);
65 #if defined(AUDIOHW_HAVE_DEPTH_3D)
66 void sound_set_depth_3d(int value
);
69 #ifdef AUDIOHW_HAVE_EQ
71 * band = SOUND_EQ_BANDb
72 * band_setting = AUDIOHW_EQ_s
74 * Returns SOUND_EQ_BANDb_s or -1 if it doesn't exist.
77 * s: one of GAIN, FREQUENCY, WIDTH
79 int sound_enum_hw_eq_band_setting(unsigned int band
,
80 unsigned int band_setting
);
82 void sound_set_hw_eq_band1_gain(int value
);
83 #ifdef AUDIOHW_HAVE_EQ_BAND1_FREQUENCY
84 void sound_set_hw_eq_band1_frequency(int value
);
86 #ifdef AUDIOHW_HAVE_EQ_BAND2
87 void sound_set_hw_eq_band2_gain(int value
);
88 #ifdef AUDIOHW_HAVE_EQ_BAND2_FREQUENCY
89 void sound_set_hw_eq_band2_frequency(int value
);
91 #ifdef AUDIOHW_HAVE_EQ_BAND2_WIDTH
92 void sound_set_hw_eq_band2_width(int value
);
94 #endif /* AUDIOHW_HAVE_EQ_BAND2 */
95 #ifdef AUDIOHW_HAVE_EQ_BAND3
97 void sound_set_hw_eq_band3_gain(int value
);
98 #ifdef AUDIOHW_HAVE_EQ_BAND3_FREQUENCY
99 void sound_set_hw_eq_band3_frequency(int value
);
101 #if defined(AUDIOHW_HAVE_EQ_BAND3_WIDTH)
102 void sound_set_hw_eq_band3_width(int value
);
104 #endif /* AUDIOHW_HAVE_EQ_BAND3 */
105 #ifdef AUDIOHW_HAVE_EQ_BAND4
106 void sound_set_hw_eq_band4_gain(int value
);
107 #ifdef AUDIOHW_HAVE_EQ_BAND4_FREQUENCY
108 void sound_set_hw_eq_band4_frequency(int value
);
110 #ifdef AUDIOHW_HAVE_EQ_BAND4_WIDTH
111 void sound_set_hw_eq_band4_width(int value
);
113 #endif /* AUDIOHW_HAVE_EQ_BAND4 */
114 #ifdef AUDIOHW_HAVE_EQ_BAND5
115 void sound_set_hw_eq_band5_gain(int value
);
116 #ifdef AUDIOHW_HAVE_EQ_BAND5_FREQUENCY
117 void sound_set_hw_eq_band5_frequency(int value
);
119 #endif /* AUDIOHW_HAVE_EQ_BAND5 */
120 #endif /* AUDIOHW_HAVE_EQ */
122 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
123 void sound_set_loudness(int value
);
124 void sound_set_avc(int value
);
125 void sound_set_mdb_strength(int value
);
126 void sound_set_mdb_harmonics(int value
);
127 void sound_set_mdb_center(int value
);
128 void sound_set_mdb_shape(int value
);
129 void sound_set_mdb_enable(int value
);
130 void sound_set_superbass(int value
);
131 #endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
133 void sound_set(int setting
, int value
);
134 int sound_val2phys(int setting
, int value
);
136 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
137 void sound_set_pitch(int32_t pitch
);
138 int32_t sound_get_pitch(void);
141 #ifdef HAVE_PITCHCONTROL
142 /* precision of the pitch and speed variables */
143 /* One zero per decimal (100 means two decimal places */
144 #define PITCH_SPEED_PRECISION 100L
145 #define PITCH_SPEED_100 (100L * PITCH_SPEED_PRECISION) /* 100% speed */
146 #endif /* HAVE_PITCHCONTROL */