diff options
author | Wincent Balin <wincent@rockbox.org> | 2010-07-05 01:26:41 +0000 |
---|---|---|
committer | Wincent Balin <wincent@rockbox.org> | 2010-07-05 01:26:41 +0000 |
commit | 53425ad60449d837df1e2230d28ea6e88d06bc94 (patch) | |
tree | cf33eb70d8ea3f6383a923aa2a14b8410717167e /apps/plugins/pdbox | |
parent | 8c54767453f082c256b269e154463e9e1eada39d (diff) | |
download | rockbox-53425ad60449d837df1e2230d28ea6e88d06bc94.tar.gz rockbox-53425ad60449d837df1e2230d28ea6e88d06bc94.tar.bz2 rockbox-53425ad60449d837df1e2230d28ea6e88d06bc94.zip |
pdbox: Added different sampling rates based on hardware capabilities.
Also a minor code cleanup.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27286 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/pdbox')
-rw-r--r-- | apps/plugins/pdbox/pdbox.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/apps/plugins/pdbox/pdbox.h b/apps/plugins/pdbox/pdbox.h index 2ee32a0dc8..cf46e4835a 100644 --- a/apps/plugins/pdbox/pdbox.h +++ b/apps/plugins/pdbox/pdbox.h @@ -22,11 +22,8 @@ #ifndef PDBOX_H #define PDBOX_H - -#if 1 /* Use TLSF. */ #include "codecs/lib/tlsf/src/tlsf.h" -#endif /* Pure Data */ #include "PDa/src/m_pd.h" @@ -43,7 +40,17 @@ #define calloc(elements, elem_size) tlsf_calloc(elements, elem_size) /* Audio declarations. */ -#define PD_SAMPLERATE 22050 +#ifdef SIMULATOR + #define PD_SAMPLERATE 44100 +#elif (HW_SAMPR_CAPS & SAMPR_CAP_22) + #define PD_SAMPLERATE 22050 +#elif (HW_SAMPR_CAPS & SAMPR_CAP_32) + #define PD_SAMPLERATE 32000 +#elif (HW_SAMPR_CAPS & SAMPR_CAP_44) + #define PD_SAMPLERATE 44100 +#else + #error No sufficient sample rate available! +#endif #define PD_SAMPLES_PER_HZ ((PD_SAMPLERATE / HZ) + \ (PD_SAMPLERATE % HZ > 0 ? 1 : 0)) #define PD_OUT_CHANNELS 2 |