Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/apps/lang/english.lang b/apps/lang/english.lang
- index 627fda8..ef715c7 100644
- --- apps/lang/english.lang
- +++ apps/lang/english.lang
- @@ -12993,3 +12993,20 @@
- *: "Restart Sleep Timer On Keypress"
- </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/dsp.c b/apps/dsp.c
- index 00de511..40cb1b6 100644
- --- apps/dsp.c
- +++ apps/dsp.c
- @@ -1119,6 +1119,18 @@
- }
- #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[] =
- @@ -1130,6 +1142,7 @@
- [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/settings_list.c b/apps/settings_list.c
- index 44295ac..03d49e4 100644
- --- apps/settings_list.c
- +++ apps/settings_list.c
- @@ -696,11 +696,12 @@
- 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/firmware/export/audiohw.h b/firmware/export/audiohw.h
- index 304c5aa..c8c87dd 100644
- --- firmware/export/audiohw.h
- +++ firmware/export/audiohw.h
- @@ -346,6 +346,7 @@
- SOUND_CHAN_MONO_LEFT,
- SOUND_CHAN_MONO_RIGHT,
- SOUND_CHAN_KARAOKE,
- + SOUND_CHAN_SWAP,
- SOUND_CHAN_NUM_MODES,
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement