summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2013-04-15 14:00:48 -0400
committerMichael Sevakis <jethead71@rockbox.org>2013-04-15 14:00:48 -0400
commit9e71fd16a55bd69f2cf3345b5ab3459b29c1832d (patch)
tree4c60af99e480be496d4fe8b691c89b356b52e884
parentbbd991ad63805533ec4e2558061bbba48bfab1a9 (diff)
downloadrockbox-9e71fd1.tar.gz
rockbox-9e71fd1.zip
Keep fixing 0c7b787 stuff
Change-Id: I0678d3307fbcad32156f9f4e0f8b90eed5a20d92
-rw-r--r--firmware/drivers/audio/android.c26
-rw-r--r--firmware/drivers/audio/sdl.c4
-rw-r--r--firmware/drivers/audio/tlv320.c15
-rw-r--r--firmware/export/hosted_codec.h23
-rw-r--r--firmware/export/tlv320.h13
-rw-r--r--firmware/export/wm8975.h2
-rw-r--r--uisimulator/common/stubs.c5
7 files changed, 26 insertions, 62 deletions
diff --git a/firmware/drivers/audio/android.c b/firmware/drivers/audio/android.c
index ff36ca21d9..7a5f34ea48 100644
--- a/firmware/drivers/audio/android.c
+++ b/firmware/drivers/audio/android.c
@@ -23,32 +23,6 @@
#include "config.h"
#include "audiohw.h"
-const struct sound_settings_info audiohw_settings[] = {
- [SOUND_VOLUME] = {"dB", 0, 1, VOLUME_MIN / 10, VOLUME_MAX / 10, -25},
-/* Bass and treble tone controls */
-#ifdef AUDIOHW_HAVE_BASS
- [SOUND_BASS] = {"dB", 0, 1, -24, 24, 0},
-#endif
-#ifdef AUDIOHW_HAVE_TREBLE
- [SOUND_TREBLE] = {"dB", 0, 1, -24, 24, 0},
-#endif
- [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0},
- [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0},
- [SOUND_STEREO_WIDTH] = {"%", 0, 5, 0, 250, 100},
-#if defined(HAVE_RECORDING)
- [SOUND_LEFT_GAIN] = {"dB", 1, 1,-128, 96, 0},
- [SOUND_RIGHT_GAIN] = {"dB", 1, 1,-128, 96, 0},
- [SOUND_MIC_GAIN] = {"dB", 1, 1,-128, 108, 16},
-#endif
-#if defined(AUDIOHW_HAVE_BASS_CUTOFF)
- [SOUND_BASS_CUTOFF] = {"", 0, 1, 1, 4, 1},
-#endif
-#if defined(AUDIOHW_HAVE_TREBLE_CUTOFF)
- [SOUND_TREBLE_CUTOFF] = {"", 0, 1, 1, 4, 1},
-#endif
-};
-
-
void audiohw_set_volume(int volume)
{
extern void pcm_set_mixer_volume(int);
diff --git a/firmware/drivers/audio/sdl.c b/firmware/drivers/audio/sdl.c
index eea10ad12c..dfc77378bd 100644
--- a/firmware/drivers/audio/sdl.c
+++ b/firmware/drivers/audio/sdl.c
@@ -21,7 +21,7 @@
#include <SDL_audio.h>
#include "config.h"
-#include "audiohw.h"
+#include "sound.h"
#include "pcm_sampr.h"
/**
@@ -85,6 +85,8 @@ void audiohw_set_treble(int value) { (void)value; }
#if CONFIG_CODEC != SWCODEC
void audiohw_set_channel(int value) { (void)value; }
void audiohw_set_stereo_width(int value){ (void)value; }
+void audiohw_set_pitch(int32_t value) { (void)value; }
+int32_t audiohw_get_pitch(void) { return PITCH_SPEED_100; }
#endif
#if defined(AUDIOHW_HAVE_BASS_CUTOFF)
void audiohw_set_bass_cutoff(int value) { (void)value; }
diff --git a/firmware/drivers/audio/tlv320.c b/firmware/drivers/audio/tlv320.c
index 23d2fea3a1..6118734d37 100644
--- a/firmware/drivers/audio/tlv320.c
+++ b/firmware/drivers/audio/tlv320.c
@@ -31,21 +31,6 @@
#endif
#include "audiohw.h"
-const struct sound_settings_info audiohw_settings[] = {
- [SOUND_VOLUME] = {"dB", 0, 1, -73, 6, -20},
- /* HAVE_SW_TONE_CONTROLS */
- [SOUND_BASS] = {"dB", 0, 1, -24, 24, 0},
- [SOUND_TREBLE] = {"dB", 0, 1, -24, 24, 0},
- [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0},
- [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0},
- [SOUND_STEREO_WIDTH] = {"%", 0, 5, 0, 250, 100},
-#ifdef HAVE_RECORDING
- [SOUND_LEFT_GAIN] = {"dB", 1, 1, 0, 31, 23},
- [SOUND_RIGHT_GAIN] = {"dB", 1, 1, 0, 31, 23},
- [SOUND_MIC_GAIN] = {"dB", 1, 1, 0, 1, 1},
-#endif
-};
-
/* convert tenth of dB volume (-73..6) to master volume register value */
static int vol_tenthdb2hw(int db)
{
diff --git a/firmware/export/hosted_codec.h b/firmware/export/hosted_codec.h
index 50d1281394..62a4d57613 100644
--- a/firmware/export/hosted_codec.h
+++ b/firmware/export/hosted_codec.h
@@ -25,6 +25,27 @@
#define VOLUME_MAX 0
#define AUDIOHW_CAPS (MONO_VOL_CAP)
-AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -100, 0, 0)
+AUDIOHW_SETTING(VOLUME, "dB", 0, 1,-100, 0, 0)
+
+#if (CONFIG_PLATFORM & PLATFORM_ANDROID)
+/* Bass and treble tone controls */
+#ifdef AUDIOHW_HAVE_BASS
+AUDIOHW_SETTING(BASS, "dB", 0, 1, -24, 24, 0)
+#endif
+#ifdef AUDIOHW_HAVE_TREBLE
+AUDIOHW_SETTING(TREBLE, "dB", 0, 1, -24, 24, 0)
+#endif
+#if defined(HAVE_RECORDING)
+AUDIOHW_SETTING(LEFT_GAIN, "dB", 1, 1,-128, 96, 0)
+AUDIOHW_SETTING(RIGHT_GAIN, "dB", 1, 1,-128, 96, 0)
+AUDIOHW_SETTING(MIC_GAIN, "dB", 1, 1,-128, 108, 16)
+#endif
+#if defined(AUDIOHW_HAVE_BASS_CUTOFF)
+AUDIOHW_SETTING(BASS_CUTOFF, "", 0, 1, 1, 4, 1)
+#endif
+#if defined(AUDIOHW_HAVE_TREBLE_CUTOFF)
+AUDIOHW_SETTING(TREBLE_CUTOFF, "", 0, 1, 1, 4, 1)
+#endif
+/* CONFIG_PLATFORM & PLATFORM_ANDROID */
#endif /* HOSTED_CODEC_H */ \ No newline at end of file
diff --git a/firmware/export/tlv320.h b/firmware/export/tlv320.h
index 99359f72ce..ea7ccfceb2 100644
--- a/firmware/export/tlv320.h
+++ b/firmware/export/tlv320.h
@@ -36,19 +36,6 @@ AUDIOHW_SETTING(RIGHT_GAIN, "dB", 1, 1, 0, 31, 23, (val - 23) * 15)
AUDIOHW_SETTING(MIC_GAIN, "dB", 1, 1, 0, 1, 1, val * 200)
#endif /* HAVE_RECORDING */
-static inline int _param_2_phys(int setting, int value)
-{
- switch(setting)
- {
- default: return value;
-#ifdef HAVE_RECORDING
- case SOUND_LEFT_GAIN:
- case SOUND_RIGHT_GAIN: return (value - 23) * 15;
- case SOUND_MIC_GAIN: return value * 200; /* 0 or 20 dB */
-#endif
- }
-}
-
/*** definitions ***/
#define HEADPHONE_MUTE 0x30 /* 0110000 = -73db */
diff --git a/firmware/export/wm8975.h b/firmware/export/wm8975.h
index f4e0d203a1..bc0d113c4c 100644
--- a/firmware/export/wm8975.h
+++ b/firmware/export/wm8975.h
@@ -34,7 +34,7 @@ AUDIOHW_SETTING(BASS, "dB", 0, 1, -6, 9, 0)
AUDIOHW_SETTING(TREBLE, "dB", 0, 1, -6, 9, 0)
#ifdef HAVE_RECORDING
AUDIOHW_SETTING(LEFT_GAIN, "dB", 1, 1, 0, 63, 23, ((val - 23) * 15) / 2)
-AUDIOHW_SETTING(RIGHT_GAIN, "dB", 1, 1, 0, 63, 23, ((val - 23) * 15) / 2))
+AUDIOHW_SETTING(RIGHT_GAIN, "dB", 1, 1, 0, 63, 23, ((val - 23) * 15) / 2)
AUDIOHW_SETTING(MIC_GAIN, "dB", 1, 1, 0, 63, 0, ((val - 23) * 15) / 2 + 200)
#endif /* HAVE_RECORDING */
diff --git a/uisimulator/common/stubs.c b/uisimulator/common/stubs.c
index 1404c1e21b..51706ca3d5 100644
--- a/uisimulator/common/stubs.c
+++ b/uisimulator/common/stubs.c
@@ -145,11 +145,6 @@ void audiohw_set_superbass(int value)
{
(void)value;
}
-
-void audiohw_set_pitch(unsigned long value)
-{
- (void)value;
-}
#endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
#endif /* CODEC != SWCODEC */