summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Giacomelli <giac2000@hotmail.com>2011-10-26 18:18:34 +0000
committerMichael Giacomelli <giac2000@hotmail.com>2011-10-26 18:18:34 +0000
commit5c4bd11d9172717be3ebb37390e6e55cfa369ed9 (patch)
tree0924921fe3e621365401901276590aad8c0ecfe5
parent4ef4830f0bfff810be2962bf3de115981c51d6a2 (diff)
downloadrockbox-5c4bd11d9172717be3ebb37390e6e55cfa369ed9.zip
rockbox-5c4bd11d9172717be3ebb37390e6e55cfa369ed9.tar.gz
rockbox-5c4bd11d9172717be3ebb37390e6e55cfa369ed9.tar.bz2
rockbox-5c4bd11d9172717be3ebb37390e6e55cfa369ed9.tar.xz
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
-rw-r--r--apps/dsp.c13
-rw-r--r--apps/lang/english.lang17
-rw-r--r--apps/settings_list.c7
-rw-r--r--manual/configure_rockbox/sound_settings.tex2
4 files changed, 36 insertions, 3 deletions
diff --git a/apps/dsp.c b/apps/dsp.c
index 2113d25..4bf1ab9 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[])
}
#endif /* DSP_HAVE_ASM_SOUND_CHAN_KARAOKE */
+static void channels_process_sound_chan_swap(int count, int32_t *buf[])
+{
+ int32_t *sl = buf[0], *sr = buf[1];
+
+ while (count-- > 0)
+ {
+ int32_t ch = *sl;
+ *sl++ = *sr;
+ *sr++ = ch;
+ }
+}
+
static void dsp_set_channel_config(int value)
{
static const channels_process_fn_type channels_process_functions[] =
@@ -1186,6 +1198,7 @@ static void dsp_set_channel_config(int value)
[SOUND_CHAN_MONO_LEFT] = channels_process_sound_chan_mono_left,
[SOUND_CHAN_MONO_RIGHT] = channels_process_sound_chan_mono_right,
[SOUND_CHAN_KARAOKE] = channels_process_sound_chan_karaoke,
+ [SOUND_CHAN_SWAP] = channels_process_sound_chan_swap,
};
if ((unsigned)value >= ARRAYLEN(channels_process_functions) ||
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 5a59473..d3fac86 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -12903,3 +12903,20 @@
*: "Cancel Sleep Timer"
</voice>
</phrase>
+<phrase>
+ id: LANG_CHANNEL_SWAP
+ desc: in sound_settings
+ user: core
+ <source>
+ *: none
+ swcodec: "Swap channels"
+ </source>
+ <dest>
+ *: none
+ swcodec: "Swap channels"
+ </dest>
+ <voice>
+ *: none
+ swcodec: "Swap channels"
+ </voice>
+</phrase>
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 521d565..6602ec2 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -678,11 +678,12 @@ const struct settings_list settings[] = {
CHOICE_SETTING(F_SOUNDSETTING, channel_config, LANG_CHANNEL_CONFIGURATION,
0,"channels",
- "stereo,mono,custom,mono left,mono right,karaoke",
- sound_set_channels, 6,
+ "stereo,mono,custom,mono left,mono right,karaoke,swap",
+ sound_set_channels, 7,
ID2P(LANG_CHANNEL_STEREO), ID2P(LANG_CHANNEL_MONO),
ID2P(LANG_CHANNEL_CUSTOM), ID2P(LANG_CHANNEL_LEFT),
- ID2P(LANG_CHANNEL_RIGHT), ID2P(LANG_CHANNEL_KARAOKE)),
+ ID2P(LANG_CHANNEL_RIGHT), ID2P(LANG_CHANNEL_KARAOKE),
+ ID2P(LANG_CHANNEL_SWAP)),
SOUND_SETTING(F_SOUNDSETTING, stereo_width, LANG_STEREO_WIDTH,
"stereo_width", SOUND_STEREO_WIDTH),
#ifdef AUDIOHW_HAVE_DEPTH_3D
diff --git a/manual/configure_rockbox/sound_settings.tex b/manual/configure_rockbox/sound_settings.tex
index 76965d0..54031c5 100644
--- a/manual/configure_rockbox/sound_settings.tex
+++ b/manual/configure_rockbox/sound_settings.tex
@@ -169,6 +169,8 @@ change to customise your listening experience.
to make the singer sound centrally placed, this often (but not
always) has the effect of removing the voice track from a song. This
setting also very often has other undesirable effects on the sound.
+ \item[Swap Channels]
+ Exchanges the left and right channels.
\end{description}
\section{Stereo Width}