forked from len0rd/rockbox
Added three new channel modes: Stereo narrow, Stereo wide, and Karaoke (voice filter). Patch by Remo Hofer.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3356 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b1079200d3
commit
6da56d9f08
5 changed files with 95 additions and 60 deletions
|
|
@ -1409,3 +1409,23 @@ id: LANG_INVERT
|
||||||
desc: in settings_menu
|
desc: in settings_menu
|
||||||
eng: "Invert"
|
eng: "Invert"
|
||||||
new:
|
new:
|
||||||
|
|
||||||
|
id: LANG_CHANNEL_STEREO_NARROW_PLAYER
|
||||||
|
desc: in sound_settings
|
||||||
|
eng: "St. Narrow"
|
||||||
|
new:
|
||||||
|
|
||||||
|
id: LANG_CHANNEL_STEREO_NARROW_RECORDER
|
||||||
|
desc: in sound_settings
|
||||||
|
eng: "Stereo Narrow"
|
||||||
|
new:
|
||||||
|
|
||||||
|
id: LANG_CHANNEL_STEREO_WIDE
|
||||||
|
desc: in sound_settings
|
||||||
|
eng: "Stereo Wide"
|
||||||
|
new:
|
||||||
|
|
||||||
|
id: LANG_CHANNEL_KARAOKE
|
||||||
|
desc: in sound_settings
|
||||||
|
eng: "Karaoke"
|
||||||
|
new:
|
||||||
|
|
|
||||||
|
|
@ -325,9 +325,10 @@ int settings_save( void )
|
||||||
config_block[0x10] = (unsigned char)
|
config_block[0x10] = (unsigned char)
|
||||||
((global_settings.ff_rewind_min_step & 15) << 4 |
|
((global_settings.ff_rewind_min_step & 15) << 4 |
|
||||||
(global_settings.ff_rewind_accel & 15));
|
(global_settings.ff_rewind_accel & 15));
|
||||||
|
|
||||||
config_block[0x11] = (unsigned char)
|
config_block[0x11] = (unsigned char)
|
||||||
((global_settings.avc & 0x03) |
|
((global_settings.avc & 0x03) |
|
||||||
((global_settings.channel_config & 0x03) << 2));
|
((global_settings.channel_config & 0x07) << 2));
|
||||||
|
|
||||||
memcpy(&config_block[0x12], &global_settings.resume_index, 4);
|
memcpy(&config_block[0x12], &global_settings.resume_index, 4);
|
||||||
memcpy(&config_block[0x16], &global_settings.resume_offset, 4);
|
memcpy(&config_block[0x16], &global_settings.resume_offset, 4);
|
||||||
|
|
@ -457,7 +458,6 @@ void settings_apply(void)
|
||||||
mpeg_sound_set(SOUND_BALANCE, global_settings.balance);
|
mpeg_sound_set(SOUND_BALANCE, global_settings.balance);
|
||||||
mpeg_sound_set(SOUND_VOLUME, global_settings.volume);
|
mpeg_sound_set(SOUND_VOLUME, global_settings.volume);
|
||||||
mpeg_sound_set(SOUND_CHANNELS, global_settings.channel_config);
|
mpeg_sound_set(SOUND_CHANNELS, global_settings.channel_config);
|
||||||
|
|
||||||
#ifdef HAVE_MAS3587F
|
#ifdef HAVE_MAS3587F
|
||||||
mpeg_sound_set(SOUND_LOUDNESS, global_settings.loudness);
|
mpeg_sound_set(SOUND_LOUDNESS, global_settings.loudness);
|
||||||
mpeg_sound_set(SOUND_SUPERBASS, global_settings.bass_boost);
|
mpeg_sound_set(SOUND_SUPERBASS, global_settings.bass_boost);
|
||||||
|
|
@ -598,7 +598,7 @@ void settings_load(void)
|
||||||
if (config_block[0x11] != 0xFF)
|
if (config_block[0x11] != 0xFF)
|
||||||
{
|
{
|
||||||
global_settings.avc = config_block[0x11] & 0x03;
|
global_settings.avc = config_block[0x11] & 0x03;
|
||||||
global_settings.channel_config = (config_block[0x11] >> 2) & 0x03;
|
global_settings.channel_config = (config_block[0x11] >> 2) & 0x07;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config_block[0x12] != 0xFF)
|
if (config_block[0x12] != 0xFF)
|
||||||
|
|
|
||||||
|
|
@ -228,10 +228,17 @@ static void set_chanconf(int val)
|
||||||
|
|
||||||
static bool chanconf(void)
|
static bool chanconf(void)
|
||||||
{
|
{
|
||||||
char *names[] = {str(LANG_CHANNEL_STEREO), str(LANG_CHANNEL_MONO),
|
char *names[] = {str(LANG_CHANNEL_STEREO),
|
||||||
str(LANG_CHANNEL_LEFT), str(LANG_CHANNEL_RIGHT) };
|
#ifdef HAVE_LCD_CHARCELLS
|
||||||
|
str(LANG_CHANNEL_STEREO_NARROW_PLAYER),
|
||||||
|
#else
|
||||||
|
str(LANG_CHANNEL_STEREO_NARROW_RECORDER),
|
||||||
|
#endif
|
||||||
|
str(LANG_CHANNEL_MONO),
|
||||||
|
str(LANG_CHANNEL_LEFT), str(LANG_CHANNEL_RIGHT),
|
||||||
|
str(LANG_CHANNEL_KARAOKE), str(LANG_CHANNEL_STEREO_WIDE) };
|
||||||
return set_option(str(LANG_CHANNEL), &global_settings.channel_config,
|
return set_option(str(LANG_CHANNEL), &global_settings.channel_config,
|
||||||
names, 4, set_chanconf );
|
names, 7, set_chanconf );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool sound_menu(void)
|
bool sound_menu(void)
|
||||||
|
|
|
||||||
|
|
@ -105,9 +105,12 @@ void mpeg_set_buffer_margin(int seconds);
|
||||||
#define SOUND_NUMSETTINGS 11
|
#define SOUND_NUMSETTINGS 11
|
||||||
|
|
||||||
#define MPEG_SOUND_STEREO 0
|
#define MPEG_SOUND_STEREO 0
|
||||||
#define MPEG_SOUND_MONO 1
|
#define MPEG_SOUND_STEREO_NARROW 1
|
||||||
#define MPEG_SOUND_MONO_LEFT 2
|
#define MPEG_SOUND_MONO 2
|
||||||
#define MPEG_SOUND_MONO_RIGHT 3
|
#define MPEG_SOUND_MONO_LEFT 3
|
||||||
|
#define MPEG_SOUND_MONO_RIGHT 4
|
||||||
|
#define MPEG_SOUND_KARAOKE 5
|
||||||
|
#define MPEG_SOUND_STEREO_WIDE 6
|
||||||
|
|
||||||
#define MPEG_STATUS_PLAY 1
|
#define MPEG_STATUS_PLAY 1
|
||||||
#define MPEG_STATUS_PAUSE 2
|
#define MPEG_STATUS_PAUSE 2
|
||||||
|
|
|
||||||
107
firmware/mpeg.c
107
firmware/mpeg.c
|
|
@ -139,7 +139,7 @@ static int maxval[] =
|
||||||
17, /* Loudness */
|
17, /* Loudness */
|
||||||
10, /* Bass boost */
|
10, /* Bass boost */
|
||||||
3, /* AVC */
|
3, /* AVC */
|
||||||
3, /* Channels */
|
6, /* Channels */
|
||||||
15, /* Left gain */
|
15, /* Left gain */
|
||||||
15, /* Right gain */
|
15, /* Right gain */
|
||||||
15, /* Mic gain */
|
15, /* Mic gain */
|
||||||
|
|
@ -2654,68 +2654,73 @@ void mpeg_sound_channel_config(int configuration)
|
||||||
#ifdef SIMULATOR
|
#ifdef SIMULATOR
|
||||||
(void)configuration;
|
(void)configuration;
|
||||||
#else
|
#else
|
||||||
unsigned long val_on = 0x80000;
|
unsigned long val_ll = 0x80000;
|
||||||
unsigned long val_off = 0;
|
unsigned long val_lr = 0;
|
||||||
|
unsigned long val_rl = 0;
|
||||||
|
unsigned long val_rr = 0x80000;
|
||||||
|
|
||||||
switch(configuration)
|
switch(configuration)
|
||||||
{
|
{
|
||||||
case MPEG_SOUND_STEREO:
|
case MPEG_SOUND_STEREO:
|
||||||
val_on = 0x80000;
|
val_ll = 0x80000;
|
||||||
#ifdef HAVE_MAS3587F
|
val_lr = 0;
|
||||||
mas_writemem(MAS_BANK_D0, 0x7fc, &val_on, 1); /* LL */
|
val_rl = 0;
|
||||||
mas_writemem(MAS_BANK_D0, 0x7fd, &val_off, 1); /* LR */
|
val_rr = 0x80000;
|
||||||
mas_writemem(MAS_BANK_D0, 0x7fe, &val_off, 1); /* RL */
|
|
||||||
mas_writemem(MAS_BANK_D0, 0x7ff, &val_on, 1); /* RR */
|
|
||||||
#else
|
|
||||||
mas_writemem(MAS_BANK_D1, 0x7f8, &val_on, 1); /* LL */
|
|
||||||
mas_writemem(MAS_BANK_D1, 0x7f9, &val_off, 1); /* LR */
|
|
||||||
mas_writemem(MAS_BANK_D1, 0x7fa, &val_off, 1); /* RL */
|
|
||||||
mas_writemem(MAS_BANK_D1, 0x7fb, &val_on, 1); /* RR */
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MPEG_SOUND_MONO:
|
case MPEG_SOUND_MONO:
|
||||||
val_on = 0xc0000;
|
val_ll = 0xc0000;
|
||||||
#ifdef HAVE_MAS3587F
|
val_lr = 0xc0000;
|
||||||
mas_writemem(MAS_BANK_D0, 0x7fc, &val_on, 1); /* LL */
|
val_rl = 0xc0000;
|
||||||
mas_writemem(MAS_BANK_D0, 0x7fd, &val_on, 1); /* LR */
|
val_rr = 0xc0000;
|
||||||
mas_writemem(MAS_BANK_D0, 0x7fe, &val_on, 1); /* RL */
|
|
||||||
mas_writemem(MAS_BANK_D0, 0x7ff, &val_on, 1); /* RR */
|
|
||||||
#else
|
|
||||||
mas_writemem(MAS_BANK_D1, 0x7f8, &val_on, 1); /* LL */
|
|
||||||
mas_writemem(MAS_BANK_D1, 0x7f9, &val_on, 1); /* LR */
|
|
||||||
mas_writemem(MAS_BANK_D1, 0x7fa, &val_on, 1); /* RL */
|
|
||||||
mas_writemem(MAS_BANK_D1, 0x7fb, &val_on, 1); /* RR */
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MPEG_SOUND_MONO_LEFT:
|
case MPEG_SOUND_MONO_LEFT:
|
||||||
val_on = 0x80000;
|
val_ll = 0x80000;
|
||||||
#ifdef HAVE_MAS3587F
|
val_lr = 0x80000;
|
||||||
mas_writemem(MAS_BANK_D0, 0x7fc, &val_on, 1); /* LL */
|
val_rl = 0;
|
||||||
mas_writemem(MAS_BANK_D0, 0x7fd, &val_on, 1); /* LR */
|
val_rr = 0;
|
||||||
mas_writemem(MAS_BANK_D0, 0x7fe, &val_off, 1); /* RL */
|
|
||||||
mas_writemem(MAS_BANK_D0, 0x7ff, &val_off, 1); /* RR */
|
|
||||||
#else
|
|
||||||
mas_writemem(MAS_BANK_D1, 0x7f8, &val_on, 1); /* LL */
|
|
||||||
mas_writemem(MAS_BANK_D1, 0x7f9, &val_on, 1); /* LR */
|
|
||||||
mas_writemem(MAS_BANK_D1, 0x7fa, &val_off, 1); /* RL */
|
|
||||||
mas_writemem(MAS_BANK_D1, 0x7fb, &val_off, 1); /* RR */
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MPEG_SOUND_MONO_RIGHT:
|
case MPEG_SOUND_MONO_RIGHT:
|
||||||
val_on = 0x80000;
|
val_ll = 0;
|
||||||
#ifdef HAVE_MAS3587F
|
val_lr = 0;
|
||||||
mas_writemem(MAS_BANK_D0, 0x7fc, &val_off, 1); /* LL */
|
val_rl = 0x80000;
|
||||||
mas_writemem(MAS_BANK_D0, 0x7fd, &val_off, 1); /* LR */
|
val_rr = 0x80000;
|
||||||
mas_writemem(MAS_BANK_D0, 0x7fe, &val_on, 1); /* RL */
|
break;
|
||||||
mas_writemem(MAS_BANK_D0, 0x7ff, &val_on, 1); /* RR */
|
|
||||||
#else
|
case MPEG_SOUND_STEREO_NARROW:
|
||||||
mas_writemem(MAS_BANK_D1, 0x7f8, &val_off, 1); /* LL */
|
val_ll = 0xa0000;
|
||||||
mas_writemem(MAS_BANK_D1, 0x7f9, &val_off, 1); /* LR */
|
val_lr = 0xe0000;
|
||||||
mas_writemem(MAS_BANK_D1, 0x7fa, &val_on, 1); /* RL */
|
val_rl = 0xe0000;
|
||||||
mas_writemem(MAS_BANK_D1, 0x7fb, &val_on, 1); /* RR */
|
val_rr = 0xa0000;
|
||||||
#endif
|
break;
|
||||||
|
|
||||||
|
case MPEG_SOUND_STEREO_WIDE:
|
||||||
|
val_ll = 0x80000;
|
||||||
|
val_lr = 0x40000;
|
||||||
|
val_rl = 0x40000;
|
||||||
|
val_rr = 0x80000;
|
||||||
|
break;
|
||||||
|
case MPEG_SOUND_KARAOKE:
|
||||||
|
val_ll = 0x80001;
|
||||||
|
val_lr = 0x7ffff;
|
||||||
|
val_rl = 0x7ffff;
|
||||||
|
val_rr = 0x80001;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_MAS3587F
|
||||||
|
mas_writemem(MAS_BANK_D0, 0x7fc, &val_ll, 1); /* LL */
|
||||||
|
mas_writemem(MAS_BANK_D0, 0x7fd, &val_lr, 1); /* LR */
|
||||||
|
mas_writemem(MAS_BANK_D0, 0x7fe, &val_rl, 1); /* RL */
|
||||||
|
mas_writemem(MAS_BANK_D0, 0x7ff, &val_rr, 1); /* RR */
|
||||||
|
#else
|
||||||
|
mas_writemem(MAS_BANK_D1, 0x7f8, &val_ll, 1); /* LL */
|
||||||
|
mas_writemem(MAS_BANK_D1, 0x7f9, &val_lr, 1); /* LR */
|
||||||
|
mas_writemem(MAS_BANK_D1, 0x7fa, &val_rl, 1); /* RL */
|
||||||
|
mas_writemem(MAS_BANK_D1, 0x7fb, &val_rr, 1); /* RR */
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue