diff options
author | Thomas Martitz <kugel@rockbox.org> | 2010-04-25 22:54:58 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2010-04-25 22:54:58 +0000 |
commit | 668bd3445ecb39483160bbb310afa4337c83d0d9 (patch) | |
tree | 9df94188c72cd0af723012e022187b14c0d8f710 /uisimulator/sdl | |
parent | 5185d9e30a7597425aa7f77c2d323e3002c60d8e (diff) |
Remove lots of simulator-speficic #ifdef'ing in sound.c to allow for DSP effects in the sims, e.g. for bass and treble (targets that do those effects in HW don't simulate using dsp).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25719 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/sdl')
-rw-r--r-- | uisimulator/sdl/sound.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/uisimulator/sdl/sound.c b/uisimulator/sdl/sound.c index 428983a1b8..aa689b921d 100644 --- a/uisimulator/sdl/sound.c +++ b/uisimulator/sdl/sound.c @@ -27,11 +27,15 @@ #include "debug.h" #include "kernel.h" #include "sound.h" +#include "audiohw.h" #include "pcm.h" #include "pcm_sampr.h" #include "SDL.h" +static int sim_volume = 0; + +#if CONFIG_CODEC == SWCODEC static int cvt_status = -1; static Uint8* pcm_data; @@ -347,3 +351,58 @@ void pcm_play_dma_init(void) void pcm_postinit(void) { } + +#endif /* CONFIG_CODEC == SWCODEC */ + +/** + * Audio Hardware api. Make them do nothing as we cannot properly simulate with + * SDL. if we used DSP we would run code that doesn't actually run on the target + **/ +void audiohw_set_volume(int volume) +{ + sim_volume = SDL_MIX_MAXVOLUME * ((volume - VOLUME_MIN) / 10) / (VOLUME_RANGE / 10); +} +#if defined(AUDIOHW_HAVE_PRESCALER) +void audiohw_set_prescaler(int value) { (void)value; } +#endif +#if defined(AUDIOHW_HAVE_BALANCE) +void audiohw_set_balance(int value) { (void)value; } +#endif +#if defined(AUDIOHW_HAVE_BASS) +void audiohw_set_bass(int value) { (void)value; } +#endif +#if defined(AUDIOHW_HAVE_TREBLE) +void audiohw_set_treble(int value) { (void)value; } +#endif +#if CONFIG_CODEC != SWCODEC +void audiohw_set_channel(int value) { (void)value; } +void audiohw_set_stereo_width(int value){ (void)value; } +#endif +#if defined(AUDIOHW_HAVE_BASS_CUTOFF) +void audiohw_set_bass_cutoff(value) { (void)value; } +#endif +#if defined(AUDIOHW_HAVE_TREBLE_CUTOFF) +void audiohw_set_treble_cutoff(value) { (void)value; } +#endif +#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) +int mas_codec_readreg(int reg) +{ + (void)reg; + return 0; +} + +int mas_codec_writereg(int reg, unsigned int val) +{ + (void)reg; + (void)val; + return 0; +} +int mas_writemem(int bank, int addr, const unsigned long* src, int len) +{ + (void)bank; + (void)addr; + (void)src; + (void)len; + return 0; +} +#endif |