diff options
author | Michael Giacomelli <giac2000@hotmail.com> | 2011-10-26 18:18:34 +0000 |
---|---|---|
committer | Michael Giacomelli <giac2000@hotmail.com> | 2011-10-26 18:18:34 +0000 |
commit | 5c4bd11d9172717be3ebb37390e6e55cfa369ed9 (patch) | |
tree | 0924921fe3e621365401901276590aad8c0ecfe5 /apps | |
parent | 4ef4830f0bfff810be2962bf3de115981c51d6a2 (diff) | |
download | rockbox-5c4bd11d9172717be3ebb37390e6e55cfa369ed9.tar.gz rockbox-5c4bd11d9172717be3ebb37390e6e55cfa369ed9.zip |
Add option to exchange the left and right stereo channels. Patch by Dave Chapman and Martin Sägmüller. Also add manual entry (by Michael Giacomelli). Note that this setting will confuse non-software effect options like channel balance. This should be addressed in a future commit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30837 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dsp.c | 13 | ||||
-rw-r--r-- | apps/lang/english.lang | 17 | ||||
-rw-r--r-- | apps/settings_list.c | 7 |
3 files changed, 34 insertions, 3 deletions
diff --git a/apps/dsp.c b/apps/dsp.c index 2113d251a1..4bf1ab92d6 100644 --- a/apps/dsp.c +++ b/apps/dsp.c | |||
@@ -1175,6 +1175,18 @@ static void channels_process_sound_chan_karaoke(int count, int32_t *buf[]) | |||
1175 | } | 1175 | } |
1176 | #endif /* DSP_HAVE_ASM_SOUND_CHAN_KARAOKE */ | 1176 | #endif /* DSP_HAVE_ASM_SOUND_CHAN_KARAOKE */ |
1177 | 1177 | ||
1178 | static void channels_process_sound_chan_swap(int count, int32_t *buf[]) | ||
1179 | { | ||
1180 | int32_t *sl = buf[0], *sr = buf[1]; | ||
1181 | |||
1182 | while (count-- > 0) | ||
1183 | { | ||
1184 | int32_t ch = *sl; | ||
1185 | *sl++ = *sr; | ||
1186 | *sr++ = ch; | ||
1187 | } | ||
1188 | } | ||
1189 | |||
1178 | static void dsp_set_channel_config(int value) | 1190 | static void dsp_set_channel_config(int value) |
1179 | { | 1191 | { |
1180 | static const channels_process_fn_type channels_process_functions[] = | 1192 | static const channels_process_fn_type channels_process_functions[] = |
@@ -1186,6 +1198,7 @@ static void dsp_set_channel_config(int value) | |||
1186 | [SOUND_CHAN_MONO_LEFT] = channels_process_sound_chan_mono_left, | 1198 | [SOUND_CHAN_MONO_LEFT] = channels_process_sound_chan_mono_left, |
1187 | [SOUND_CHAN_MONO_RIGHT] = channels_process_sound_chan_mono_right, | 1199 | [SOUND_CHAN_MONO_RIGHT] = channels_process_sound_chan_mono_right, |
1188 | [SOUND_CHAN_KARAOKE] = channels_process_sound_chan_karaoke, | 1200 | [SOUND_CHAN_KARAOKE] = channels_process_sound_chan_karaoke, |
1201 | [SOUND_CHAN_SWAP] = channels_process_sound_chan_swap, | ||
1189 | }; | 1202 | }; |
1190 | 1203 | ||
1191 | if ((unsigned)value >= ARRAYLEN(channels_process_functions) || | 1204 | if ((unsigned)value >= ARRAYLEN(channels_process_functions) || |
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 5a59473681..d3fac86448 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -12903,3 +12903,20 @@ | |||
12903 | *: "Cancel Sleep Timer" | 12903 | *: "Cancel Sleep Timer" |
12904 | </voice> | 12904 | </voice> |
12905 | </phrase> | 12905 | </phrase> |
12906 | <phrase> | ||
12907 | id: LANG_CHANNEL_SWAP | ||
12908 | desc: in sound_settings | ||
12909 | user: core | ||
12910 | <source> | ||
12911 | *: none | ||
12912 | swcodec: "Swap channels" | ||
12913 | </source> | ||
12914 | <dest> | ||
12915 | *: none | ||
12916 | swcodec: "Swap channels" | ||
12917 | </dest> | ||
12918 | <voice> | ||
12919 | *: none | ||
12920 | swcodec: "Swap channels" | ||
12921 | </voice> | ||
12922 | </phrase> | ||
diff --git a/apps/settings_list.c b/apps/settings_list.c index 521d565f3b..6602ec206a 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c | |||
@@ -678,11 +678,12 @@ const struct settings_list settings[] = { | |||
678 | 678 | ||
679 | CHOICE_SETTING(F_SOUNDSETTING, channel_config, LANG_CHANNEL_CONFIGURATION, | 679 | CHOICE_SETTING(F_SOUNDSETTING, channel_config, LANG_CHANNEL_CONFIGURATION, |
680 | 0,"channels", | 680 | 0,"channels", |
681 | "stereo,mono,custom,mono left,mono right,karaoke", | 681 | "stereo,mono,custom,mono left,mono right,karaoke,swap", |
682 | sound_set_channels, 6, | 682 | sound_set_channels, 7, |
683 | ID2P(LANG_CHANNEL_STEREO), ID2P(LANG_CHANNEL_MONO), | 683 | ID2P(LANG_CHANNEL_STEREO), ID2P(LANG_CHANNEL_MONO), |
684 | ID2P(LANG_CHANNEL_CUSTOM), ID2P(LANG_CHANNEL_LEFT), | 684 | ID2P(LANG_CHANNEL_CUSTOM), ID2P(LANG_CHANNEL_LEFT), |
685 | ID2P(LANG_CHANNEL_RIGHT), ID2P(LANG_CHANNEL_KARAOKE)), | 685 | ID2P(LANG_CHANNEL_RIGHT), ID2P(LANG_CHANNEL_KARAOKE), |
686 | ID2P(LANG_CHANNEL_SWAP)), | ||
686 | SOUND_SETTING(F_SOUNDSETTING, stereo_width, LANG_STEREO_WIDTH, | 687 | SOUND_SETTING(F_SOUNDSETTING, stereo_width, LANG_STEREO_WIDTH, |
687 | "stereo_width", SOUND_STEREO_WIDTH), | 688 | "stereo_width", SOUND_STEREO_WIDTH), |
688 | #ifdef AUDIOHW_HAVE_DEPTH_3D | 689 | #ifdef AUDIOHW_HAVE_DEPTH_3D |