forked from len0rd/rockbox
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
This commit is contained in:
parent
4d9be96a81
commit
8051a0b724
21 changed files with 250 additions and 333 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue