diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2010-06-26 10:37:41 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2010-06-26 10:37:41 +0000 |
commit | e0bb92f00fdbcfd726407c688f5d82d3fa470a99 (patch) | |
tree | cefba4ff20c1d1bee274a6a4af4b16abc232679a | |
parent | c3eca575b637201658dc7a1222c17b144d19686d (diff) | |
download | rockbox-e0bb92f00fdbcfd726407c688f5d82d3fa470a99.tar.gz rockbox-e0bb92f00fdbcfd726407c688f5d82d3fa470a99.zip |
Should clear up rest of red. Add a required #define in the config for c200. Fix up some preprocessing directives. Hope it's all taken care of now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27141 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/drivers/audio/sdl.c | 7 | ||||
-rw-r--r-- | firmware/export/config/sansac200.h | 5 | ||||
-rw-r--r-- | firmware/export/pcm_sampr.h | 2 | ||||
-rw-r--r-- | firmware/pcm.c | 4 |
4 files changed, 14 insertions, 4 deletions
diff --git a/firmware/drivers/audio/sdl.c b/firmware/drivers/audio/sdl.c index f4c622d7a6..7d6d7452df 100644 --- a/firmware/drivers/audio/sdl.c +++ b/firmware/drivers/audio/sdl.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <SDL_audio.h> | 22 | #include <SDL_audio.h> |
23 | #include "config.h" | 23 | #include "config.h" |
24 | #include "audiohw.h" | 24 | #include "audiohw.h" |
25 | #include "pcm_sampr.h" | ||
25 | 26 | ||
26 | /** | 27 | /** |
27 | * Audio Hardware api. Make them do nothing as we cannot properly simulate with | 28 | * Audio Hardware api. Make them do nothing as we cannot properly simulate with |
@@ -162,10 +163,12 @@ void audiohw_set_eq_band_width(unsigned int band, int value) | |||
162 | void audiohw_set_depth_3d(int value) | 163 | void audiohw_set_depth_3d(int value) |
163 | { (void)value; } | 164 | { (void)value; } |
164 | #endif | 165 | #endif |
165 | #if defined(HAVE_SAMPR_TYPE_REC) | 166 | #ifdef HAVE_RECORDING |
166 | unsigned int pcm_sampr_type_rec_to_play(int samplerate) | 167 | #if SAMPR_TYPE_REC != 0 |
168 | unsigned int pcm_sampr_type_rec_to_play(unsigned int samplerate) | ||
167 | { return samplerate; } | 169 | { return samplerate; } |
168 | #endif | 170 | #endif |
171 | #endif /* HAVE_RECORDING */ | ||
169 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) | 172 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
170 | int mas_codec_readreg(int reg) | 173 | int mas_codec_readreg(int reg) |
171 | { | 174 | { |
diff --git a/firmware/export/config/sansac200.h b/firmware/export/config/sansac200.h index 6c05ba5a1c..3240af43f2 100644 --- a/firmware/export/config/sansac200.h +++ b/firmware/export/config/sansac200.h | |||
@@ -16,6 +16,11 @@ | |||
16 | #define REC_FREQ_DEFAULT REC_FREQ_22 /* Default is not 44.1kHz */ | 16 | #define REC_FREQ_DEFAULT REC_FREQ_22 /* Default is not 44.1kHz */ |
17 | #define REC_SAMPR_DEFAULT SAMPR_22 | 17 | #define REC_SAMPR_DEFAULT SAMPR_22 |
18 | 18 | ||
19 | /* because the samplerates don't match at each point, we must be able to | ||
20 | * tell PCM which set of rates to use. not needed if recording rates are | ||
21 | * a simple subset of playback rates and are equal values. */ | ||
22 | #define CONFIG_SAMPR_TYPES | ||
23 | |||
19 | /* Define bitmask of input sources - recordable bitmask can be defined | 24 | /* Define bitmask of input sources - recordable bitmask can be defined |
20 | explicitly if different */ | 25 | explicitly if different */ |
21 | #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO) | 26 | #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO) |
diff --git a/firmware/export/pcm_sampr.h b/firmware/export/pcm_sampr.h index c46e3ea9e2..62bfd0068b 100644 --- a/firmware/export/pcm_sampr.h +++ b/firmware/export/pcm_sampr.h | |||
@@ -324,7 +324,7 @@ extern const unsigned long rec_freq_sampr[REC_NUM_FREQ]; | |||
324 | #define SAMPR_TYPE_REC (0x01 << 24) | 324 | #define SAMPR_TYPE_REC (0x01 << 24) |
325 | #endif | 325 | #endif |
326 | 326 | ||
327 | unsigned int sampr_type_rec_to_play(unsigned int samplerate); | 327 | unsigned int pcm_sampr_type_rec_to_play(unsigned int samplerate); |
328 | 328 | ||
329 | #else /* ndef CONFIG_SAMPR_TYPES */ | 329 | #else /* ndef CONFIG_SAMPR_TYPES */ |
330 | 330 | ||
diff --git a/firmware/pcm.c b/firmware/pcm.c index 72fe23cb16..76a0ea2777 100644 --- a/firmware/pcm.c +++ b/firmware/pcm.c | |||
@@ -367,7 +367,8 @@ void pcm_set_frequency(unsigned int samplerate) | |||
367 | unsigned int type = samplerate & SAMPR_TYPE_MASK; | 367 | unsigned int type = samplerate & SAMPR_TYPE_MASK; |
368 | samplerate &= ~SAMPR_TYPE_MASK; | 368 | samplerate &= ~SAMPR_TYPE_MASK; |
369 | 369 | ||
370 | #ifdef SAMPR_TYPE_REC | 370 | #ifdef HAVE_RECORDING |
371 | #if SAMPR_TYPE_REC != 0 | ||
371 | /* For now, supported targets have direct conversion when configured with | 372 | /* For now, supported targets have direct conversion when configured with |
372 | * CONFIG_SAMPR_TYPES. | 373 | * CONFIG_SAMPR_TYPES. |
373 | * Some hypothetical target with independent rates would need slightly | 374 | * Some hypothetical target with independent rates would need slightly |
@@ -375,6 +376,7 @@ void pcm_set_frequency(unsigned int samplerate) | |||
375 | if (type == SAMPR_TYPE_REC) | 376 | if (type == SAMPR_TYPE_REC) |
376 | samplerate = pcm_sampr_type_rec_to_play(samplerate); | 377 | samplerate = pcm_sampr_type_rec_to_play(samplerate); |
377 | #endif | 378 | #endif |
379 | #endif /* HAVE_RECORDING */ | ||
378 | #endif /* CONFIG_SAMPR_TYPES */ | 380 | #endif /* CONFIG_SAMPR_TYPES */ |
379 | 381 | ||
380 | index = round_value_to_list32(samplerate, hw_freq_sampr, | 382 | index = round_value_to_list32(samplerate, hw_freq_sampr, |