summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-11-06 23:12:11 +0000
committerJens Arnold <amiconn@rockbox.org>2005-11-06 23:12:11 +0000
commit8051a0b724bff718ce99acc0c45dd561d8d798d7 (patch)
treea09a44c1aeed92c313880671140c1f06c7a169e3 /firmware/export
parent4d9be96a819206534594f79e856fbbd7880588d4 (diff)
downloadrockbox-8051a0b724bff718ce99acc0c45dd561d8d798d7.zip
rockbox-8051a0b724bff718ce99acc0c45dd561d8d798d7.tar.gz
rockbox-8051a0b724bff718ce99acc0c45dd561d8d798d7.tar.bz2
rockbox-8051a0b724bff718ce99acc0c45dd561d8d798d7.tar.xz
Sound settings rework: * Put all fixed parameters (unit, decimals, step, min, max, default, set function) for the individual settings into one structure array. * Use the new individual sound setting functions where appropriate. * Added dummy sound setting functions and defined the codec type for the sims. Fixes wrong sound settings ranges in the simulators. * Code cleanup.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7770 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/config-fmrecorder.h4
-rw-r--r--firmware/export/config-h100.h4
-rw-r--r--firmware/export/config-h120.h6
-rw-r--r--firmware/export/config-h300.h4
-rw-r--r--firmware/export/config-ondiofm.h6
-rw-r--r--firmware/export/config-ondiosp.h6
-rw-r--r--firmware/export/config-player.h10
-rw-r--r--firmware/export/config-recorder.h4
-rw-r--r--firmware/export/config-recorderv2.h6
-rw-r--r--firmware/export/sound.h82
10 files changed, 70 insertions, 62 deletions
diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h
index 0df6579..8de7869 100644
--- a/firmware/export/config-fmrecorder.h
+++ b/firmware/export/config-fmrecorder.h
@@ -26,11 +26,11 @@
#define AB_REPEAT_ENABLE 1
-#ifndef SIMULATOR
-
/* Define this if you have a MAS3587F */
#define CONFIG_CODEC MAS3587F
+#ifndef SIMULATOR
+
/* Define this if you have a SH7034 */
#define CONFIG_CPU SH7034
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h
index 07b8f7f..e5de9cd 100644
--- a/firmware/export/config-h100.h
+++ b/firmware/export/config-h100.h
@@ -50,6 +50,8 @@
#define CONFIG_TUNER TEA5767
#define CONFIG_TUNER_XTAL 32768
+#define HAVE_UDA1380
+
#ifndef SIMULATOR
/* Define this if you have a Motorola SCF5249 */
@@ -58,8 +60,6 @@
/* Define this if you want to use coldfire's i2c interface */
#define CONFIG_I2C I2C_COLDFIRE
-#define HAVE_UDA1380
-
/* Type of mobile power */
#define CONFIG_BATTERY BATT_LIPOL1300
diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h
index d062518..610dd84 100644
--- a/firmware/export/config-h120.h
+++ b/firmware/export/config-h120.h
@@ -46,6 +46,8 @@
#define CONFIG_TUNER TEA5767
#define CONFIG_TUNER_XTAL 32768
+#define HAVE_UDA1380
+
#ifndef SIMULATOR
/* Define this if you have a Motorola SCF5249 */
@@ -54,9 +56,6 @@
/* Define this if you want to use coldfire's i2c interface */
#define CONFIG_I2C I2C_COLDFIRE
-#define HAVE_UDA1380
-
-/* Type of mobile power */
#define CONFIG_BATTERY BATT_LIPOL1300
#define BATTERY_SCALE_FACTOR 16665 /* FIX: this value is picked at random */
@@ -97,3 +96,4 @@
/* Define this if you can control the S/PDIF power */
#define HAVE_SPDIF_POWER
+
diff --git a/firmware/export/config-h300.h b/firmware/export/config-h300.h
index 1de4158..5deeef8 100644
--- a/firmware/export/config-h300.h
+++ b/firmware/export/config-h300.h
@@ -39,6 +39,8 @@
/* The number of bytes reserved for loadable plugins */
#define PLUGIN_BUFFER_SIZE 0xC0000
+#define HAVE_UDA1380
+
#ifndef SIMULATOR
/* Define this if you have a Motorola SCF5249 */
@@ -47,8 +49,6 @@
/* Define this if you want to use coldfire's i2c interface */
#define CONFIG_I2C I2C_COLDFIRE
-#define HAVE_UDA1380
-
/* Type of mobile power */
#define CONFIG_BATTERY BATT_LIPOL1300
diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h
index 46ef98d..d0e6900 100644
--- a/firmware/export/config-ondiofm.h
+++ b/firmware/export/config-ondiofm.h
@@ -22,14 +22,14 @@
#define CONFIG_TUNER (S1A0903X01 | TEA5767) /* to be decided at runtime */
#define CONFIG_TUNER_XTAL 13000000
+/* Define this if you have a MAS3587F */
+#define CONFIG_CODEC MAS3587F
+
#ifndef SIMULATOR
/* Define this if you have a SH7034 */
#define CONFIG_CPU SH7034
-/* Define this if you have a MAS3587F */
-#define CONFIG_CODEC MAS3587F
-
/* Define this to the CPU frequency */
#define CPU_FREQ 12000000
diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h
index 1203692..41490f3 100644
--- a/firmware/export/config-ondiosp.h
+++ b/firmware/export/config-ondiosp.h
@@ -15,14 +15,14 @@
/* The number of bytes reserved for loadable plugins */
#define PLUGIN_BUFFER_SIZE 0x8000
+/* Define this if you have a MAS3539F */
+#define CONFIG_CODEC MAS3539F
+
#ifndef SIMULATOR
/* Define this if you have a SH7034 */
#define CONFIG_CPU SH7034
-/* Define this if you have a MAS3539F */
-#define CONFIG_CODEC MAS3539F
-
/* Define this to the CPU frequency */
#define CPU_FREQ 12000000
diff --git a/firmware/export/config-player.h b/firmware/export/config-player.h
index d5ab70f..e12e223 100644
--- a/firmware/export/config-player.h
+++ b/firmware/export/config-player.h
@@ -14,17 +14,17 @@
#define AB_REPEAT_ENABLE 1
-#ifndef SIMULATOR
-
-/* Define this if you have a SH7034 */
-#define CONFIG_CPU SH7034
-
/* Define this if you have a MAS3507D */
#define CONFIG_CODEC MAS3507D
/* Define this if you have a DAC3550A */
#define HAVE_DAC3550A
+#ifndef SIMULATOR
+
+/* Define this if you have a SH7034 */
+#define CONFIG_CPU SH7034
+
/* Define this if you need to power on ATA */
#define NEEDS_ATA_POWER_ON
diff --git a/firmware/export/config-recorder.h b/firmware/export/config-recorder.h
index 1874ce1..367951d 100644
--- a/firmware/export/config-recorder.h
+++ b/firmware/export/config-recorder.h
@@ -20,11 +20,11 @@
#define AB_REPEAT_ENABLE 1
-#ifndef SIMULATOR
-
/* Define this if you have a MAS3587F */
#define CONFIG_CODEC MAS3587F
+#ifndef SIMULATOR
+
/* Define this if you have a SH7034 */
#define CONFIG_CPU SH7034
diff --git a/firmware/export/config-recorderv2.h b/firmware/export/config-recorderv2.h
index 74ac021..95a428f 100644
--- a/firmware/export/config-recorderv2.h
+++ b/firmware/export/config-recorderv2.h
@@ -25,12 +25,12 @@
#ifndef SIMULATOR
-/* Define this if you have a SH7034 */
-#define CONFIG_CPU SH7034
-
/* Define this if you have a MAS3587F */
#define CONFIG_CODEC MAS3587F
+/* Define this if you have a SH7034 */
+#define CONFIG_CPU SH7034
+
/* Define this if you have a FM Recorder key system */
#define HAVE_FMADC 1
diff --git a/firmware/export/sound.h b/firmware/export/sound.h
index ed8a151..9907462 100644
--- a/firmware/export/sound.h
+++ b/firmware/export/sound.h
@@ -19,37 +19,55 @@
#ifndef SOUND_H
#define SOUND_H
-#define SOUND_VOLUME 0
-#define SOUND_BASS 1
-#define SOUND_TREBLE 2
-#define SOUND_BALANCE 3
-#define SOUND_LOUDNESS 4
-#define SOUND_AVC 5
-#define SOUND_CHANNELS 6
-#define SOUND_STEREO_WIDTH 7
-#define SOUND_LEFT_GAIN 8
-#define SOUND_RIGHT_GAIN 9
-#define SOUND_MIC_GAIN 10
-#define SOUND_MDB_STRENGTH 11
-#define SOUND_MDB_HARMONICS 12
-#define SOUND_MDB_CENTER 13
-#define SOUND_MDB_SHAPE 14
-#define SOUND_MDB_ENABLE 15
-#define SOUND_SUPERBASS 16
-#define SOUND_NUMSETTINGS 17
+enum {
+ SOUND_VOLUME = 0,
+ SOUND_BASS,
+ SOUND_TREBLE,
+ SOUND_BALANCE,
+ SOUND_CHANNELS,
+ SOUND_STEREO_WIDTH,
+#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
+ SOUND_LOUDNESS,
+ SOUND_AVC,
+ SOUND_MDB_STRENGTH,
+ SOUND_MDB_HARMONICS,
+ SOUND_MDB_CENTER,
+ SOUND_MDB_SHAPE,
+ SOUND_MDB_ENABLE,
+ SOUND_SUPERBASS,
+#endif
+#if CONFIG_CODEC == MAS3587F
+ SOUND_LEFT_GAIN,
+ SOUND_RIGHT_GAIN,
+ SOUND_MIC_GAIN,
+#endif
+};
-#define SOUND_CHAN_STEREO 0
-#define SOUND_CHAN_MONO 1
-#define SOUND_CHAN_CUSTOM 2
-#define SOUND_CHAN_MONO_LEFT 3
-#define SOUND_CHAN_MONO_RIGHT 4
-#define SOUND_CHAN_KARAOKE 5
+enum {
+ SOUND_CHAN_STEREO = 0,
+ SOUND_CHAN_MONO,
+ SOUND_CHAN_CUSTOM,
+ SOUND_CHAN_MONO_LEFT,
+ SOUND_CHAN_MONO_RIGHT,
+ SOUND_CHAN_KARAOKE,
+};
+
+typedef void sound_set_type(int value);
+
+const char *sound_unit(int setting);
+int sound_numdecimals(int setting);
+int sound_steps(int setting);
+int sound_min(int setting);
+int sound_max(int setting);
+int sound_default(int setting);
+sound_set_type* sound_get_fn(int setting);
-#ifndef SIMULATOR
void sound_set_volume(int value);
void sound_set_balance(int value);
void sound_set_bass(int value);
void sound_set_treble(int value);
+void sound_set_channels(int value);
+void sound_set_stereo_width(int value);
#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
void sound_set_loudness(int value);
void sound_set_avc(int value);
@@ -60,21 +78,11 @@ void sound_set_mdb_shape(int value);
void sound_set_mdb_enable(int value);
void sound_set_superbass(int value);
#endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
-void sound_set_channels(int value);
-void sound_set_stereo_width(int value);
-#endif
-void (*sound_get_fn(int setting))(int value);
void sound_set(int setting, int value);
-int sound_min(int setting);
-int sound_max(int setting);
-int sound_default(int setting);
-void sound_channel_config(int configuration);
int sound_val2phys(int setting, int value);
-const char *sound_unit(int setting);
-int sound_numdecimals(int setting);
-int sound_steps(int setting);
-#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) || defined(SIMULATOR)
+
+#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
void sound_set_pitch(int permille);
int sound_get_pitch(void);
#endif