summaryrefslogtreecommitdiff
path: root/firmware/drivers/audio/audiohw-swcodec.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/audio/audiohw-swcodec.c')
-rw-r--r--firmware/drivers/audio/audiohw-swcodec.c76
1 files changed, 76 insertions, 0 deletions
diff --git a/firmware/drivers/audio/audiohw-swcodec.c b/firmware/drivers/audio/audiohw-swcodec.c
new file mode 100644
index 0000000000..45b21183ad
--- /dev/null
+++ b/firmware/drivers/audio/audiohw-swcodec.c
@@ -0,0 +1,76 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Thom Johansen
11 *
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.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22#include "system.h"
23#include "sound.h"
24#include "dsp_misc.h"
25
26/* Linking audio hardware calls to SWCODEC DSP emulation */
27
28static audiohw_swcodec_cb_type callback = NULL;
29
30void audiohw_swcodec_set_callback(audiohw_swcodec_cb_type func)
31{
32 callback = func;
33}
34
35/** Functions exported by audiohw.h **/
36
37void audiohw_set_channel(int value)
38{
39 callback(DSP_CALLBACK_SET_CHANNEL_CONFIG, value);
40}
41
42void audiohw_set_stereo_width(int value)
43{
44 callback(DSP_CALLBACK_SET_STEREO_WIDTH, value);
45}
46
47#ifdef HAVE_SW_TONE_CONTROLS
48void audiohw_set_bass(int value)
49{
50 callback(DSP_CALLBACK_SET_BASS, value);
51}
52
53void audiohw_set_treble(int value)
54{
55 callback(DSP_CALLBACK_SET_TREBLE, value);
56}
57#endif /* HAVE_SW_TONE_CONTROLS */
58
59#ifndef AUDIOHW_HAVE_PRESCALER
60void audiohw_set_prescaler(int value)
61{
62 callback(DSP_CALLBACK_SET_PRESCALE, value);
63}
64#endif /* AUDIOHW_HAVE_PRESCALER */
65
66#ifdef HAVE_PITCHCONTROL
67void audiohw_set_pitch(int32_t value)
68{
69 callback(DSP_CALLBACK_SET_PITCH, value);
70}
71
72int32_t audiohw_get_pitch(void)
73{
74 return callback(DSP_CALLBACK_GET_PITCH, 0);
75}
76#endif /* HAVE_PITCHCONTROL */