diff options
Diffstat (limited to 'apps/sound_menu.c')
-rw-r--r-- | apps/sound_menu.c | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/apps/sound_menu.c b/apps/sound_menu.c index 9c8d398029..e4820b3379 100644 --- a/apps/sound_menu.c +++ b/apps/sound_menu.c | |||
@@ -18,6 +18,7 @@ | |||
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | #include "config.h" | 19 | #include "config.h" |
20 | #include <stdio.h> | 20 | #include <stdio.h> |
21 | #include <stdlib.h> | ||
21 | #include <stdbool.h> | 22 | #include <stdbool.h> |
22 | #include "system.h" | 23 | #include "system.h" |
23 | #include "kernel.h" | 24 | #include "kernel.h" |
@@ -53,9 +54,15 @@ int selected_setting; /* Used by the callback */ | |||
53 | void dec_sound_formatter(char *buffer, int buffer_size, int val, const char * unit) | 54 | void dec_sound_formatter(char *buffer, int buffer_size, int val, const char * unit) |
54 | { | 55 | { |
55 | val = sound_val2phys(selected_setting, val); | 56 | val = sound_val2phys(selected_setting, val); |
57 | char sign = ' '; | ||
58 | if(val < 0) | ||
59 | { | ||
60 | sign = '-'; | ||
61 | val = abs(val); | ||
62 | } | ||
56 | int integer = val / 10; | 63 | int integer = val / 10; |
57 | int dec = val % 10; | 64 | int dec = val % 10; |
58 | snprintf(buffer, buffer_size, "%d.%d %s", integer, dec, unit); | 65 | snprintf(buffer, buffer_size, "%c%d.%d %s", sign, integer, dec, unit); |
59 | } | 66 | } |
60 | 67 | ||
61 | bool set_sound(const unsigned char * string, | 68 | bool set_sound(const unsigned char * string, |
@@ -237,6 +244,9 @@ static bool recchannels(void) | |||
237 | 244 | ||
238 | static bool recquality(void) | 245 | static bool recquality(void) |
239 | { | 246 | { |
247 | #ifdef HAVE_UDA1380 | ||
248 | (void)recquality(); | ||
249 | #endif | ||
240 | return set_int(str(LANG_RECORDING_QUALITY), "", UNIT_INT, | 250 | return set_int(str(LANG_RECORDING_QUALITY), "", UNIT_INT, |
241 | &global_settings.rec_quality, | 251 | &global_settings.rec_quality, |
242 | NULL, 1, 0, 7, NULL ); | 252 | NULL, 1, 0, 7, NULL ); |
@@ -248,21 +258,6 @@ static bool receditable(void) | |||
248 | &global_settings.rec_editable); | 258 | &global_settings.rec_editable); |
249 | } | 259 | } |
250 | 260 | ||
251 | #ifdef HAVE_UDA1380 | ||
252 | static bool recadcleft(void) | ||
253 | { | ||
254 | return set_sound(str(LANG_RECORDING_ADC_LEFT), | ||
255 | &global_settings.rec_adc_left_gain, | ||
256 | SOUND_ADC_LEFT_GAIN); | ||
257 | } | ||
258 | |||
259 | static bool recadcright(void) | ||
260 | { | ||
261 | return set_sound(str(LANG_RECORDING_ADC_RIGHT), | ||
262 | &global_settings.rec_adc_right_gain, | ||
263 | SOUND_ADC_RIGHT_GAIN); | ||
264 | } | ||
265 | #endif | ||
266 | 261 | ||
267 | static bool rectimesplit(void) | 262 | static bool rectimesplit(void) |
268 | { | 263 | { |
@@ -791,8 +786,10 @@ bool recording_menu(bool no_source) | |||
791 | struct menu_item items[13]; | 786 | struct menu_item items[13]; |
792 | bool result; | 787 | bool result; |
793 | 788 | ||
789 | #ifndef HAVE_UDA1380 | ||
794 | items[i].desc = ID2P(LANG_RECORDING_QUALITY); | 790 | items[i].desc = ID2P(LANG_RECORDING_QUALITY); |
795 | items[i++].function = recquality; | 791 | items[i++].function = recquality; |
792 | #endif | ||
796 | items[i].desc = ID2P(LANG_RECORDING_FREQUENCY); | 793 | items[i].desc = ID2P(LANG_RECORDING_FREQUENCY); |
797 | items[i++].function = recfrequency; | 794 | items[i++].function = recfrequency; |
798 | if(!no_source) { | 795 | if(!no_source) { |
@@ -801,14 +798,6 @@ bool recording_menu(bool no_source) | |||
801 | } | 798 | } |
802 | items[i].desc = ID2P(LANG_RECORDING_CHANNELS); | 799 | items[i].desc = ID2P(LANG_RECORDING_CHANNELS); |
803 | items[i++].function = recchannels; | 800 | items[i++].function = recchannels; |
804 | |||
805 | #ifdef HAVE_UDA1380 | ||
806 | items[i].desc = ID2P(LANG_RECORDING_ADC_LEFT); | ||
807 | items[i++].function = recadcleft; | ||
808 | items[i].desc = ID2P(LANG_RECORDING_ADC_RIGHT); | ||
809 | items[i++].function = recadcright; | ||
810 | #endif | ||
811 | |||
812 | items[i].desc = ID2P(LANG_RECORDING_EDITABLE); | 801 | items[i].desc = ID2P(LANG_RECORDING_EDITABLE); |
813 | items[i++].function = receditable; | 802 | items[i++].function = receditable; |
814 | items[i].desc = ID2P(LANG_RECORD_TIMESPLIT); | 803 | items[i].desc = ID2P(LANG_RECORD_TIMESPLIT); |