e68ae23774b9f3c2917dfd9c4bca6cf1bfe17934
[kugel-rb.git] / firmware / export / sound.h
blobe68ae23774b9f3c2917dfd9c4bca6cf1bfe17934
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
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 ****************************************************************************/
21 #ifndef SOUND_H
22 #define SOUND_H
24 #include <inttypes.h>
25 #include <audiohw.h>
28 #if CONFIG_CODEC == SWCODEC
29 enum {
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,
37 #endif
39 #endif
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(HAVE_WM8758) || defined(HAVE_WM8985)
59 void sound_set_bass_cutoff(int value);
60 void sound_set_treble_cutoff(int value);
61 #endif
62 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
63 void sound_set_loudness(int value);
64 void sound_set_avc(int value);
65 void sound_set_mdb_strength(int value);
66 void sound_set_mdb_harmonics(int value);
67 void sound_set_mdb_center(int value);
68 void sound_set_mdb_shape(int value);
69 void sound_set_mdb_enable(int value);
70 void sound_set_superbass(int value);
71 #endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
73 void sound_set(int setting, int value);
74 int sound_val2phys(int setting, int value);
76 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
77 void sound_set_pitch(int32_t pitch);
78 int32_t sound_get_pitch(void);
79 #endif
81 #ifdef HAVE_PITCHSCREEN
82 /* precision of the pitch and speed variables */
83 /* One zero per decimal (100 means two decimal places */
84 #define PITCH_SPEED_PRECISION 100L
85 #define PITCH_SPEED_100 (100L * PITCH_SPEED_PRECISION) /* 100% speed */
86 #endif /* HAVE_PITCHSCREEN */
88 #endif