summaryrefslogtreecommitdiff
path: root/apps/recorder/recording.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/recorder/recording.c')
-rw-r--r--apps/recorder/recording.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index fa97837fd5..266a035632 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -73,14 +73,14 @@
73#define PM_HEIGHT ((LCD_HEIGHT >= 72) ? 2 : 1) 73#define PM_HEIGHT ((LCD_HEIGHT >= 72) ? 2 : 1)
74 74
75#if CONFIG_KEYPAD == RECORDER_PAD 75#if CONFIG_KEYPAD == RECORDER_PAD
76bool f2_rec_screen(void); 76static bool f2_rec_screen(void);
77bool f3_rec_screen(void); 77static bool f3_rec_screen(void);
78#endif 78#endif
79 79
80#define MAX_FILE_SIZE 0x7F800000 /* 2 GB - 4 MB */ 80#define MAX_FILE_SIZE 0x7F800000 /* 2 GB - 4 MB */
81 81
82int screen_update = NB_SCREENS; 82static int screen_update = NB_SCREENS;
83bool remote_display_on = true; 83static bool remote_display_on = true;
84 84
85/** File name creation **/ 85/** File name creation **/
86#if CONFIG_CODEC == SWCODEC 86#if CONFIG_CODEC == SWCODEC
@@ -124,7 +124,7 @@ static short balance_mem[BAL_MEM_SIZE];
124#define AGC_MODE_SIZE 5 124#define AGC_MODE_SIZE 5
125#define AGC_SAFETY_MODE 0 125#define AGC_SAFETY_MODE 0
126 126
127static char* agc_preset_str[] = 127static const char* agc_preset_str[] =
128{ "Off", "S", "L", "D", "M", "V" }; 128{ "Off", "S", "L", "D", "M", "V" };
129/* "Off", 129/* "Off",
130 "Safety (clip)", 130 "Safety (clip)",
@@ -137,17 +137,17 @@ static char* agc_preset_str[] =
137#define AGC_HIGH 27254 /* accelerated gain reduction threshold -1.6dB */ 137#define AGC_HIGH 27254 /* accelerated gain reduction threshold -1.6dB */
138#define AGC_IMG 823 /* threshold for balance control -32dB */ 138#define AGC_IMG 823 /* threshold for balance control -32dB */
139/* autogain high level thresholds (-3dB, -7dB, -4dB, -5dB, -5dB) */ 139/* autogain high level thresholds (-3dB, -7dB, -4dB, -5dB, -5dB) */
140const short agc_th_hi[AGC_MODE_SIZE] = 140static const short agc_th_hi[AGC_MODE_SIZE] =
141{ 23197, 14637, 21156, 18428, 18426 }; 141{ 23197, 14637, 21156, 18428, 18426 };
142/* autogain low level thresholds (-14dB, -11dB, -6dB, -7dB, -8dB) */ 142/* autogain low level thresholds (-14dB, -11dB, -6dB, -7dB, -8dB) */
143const short agc_th_lo[AGC_MODE_SIZE] = 143static const short agc_th_lo[AGC_MODE_SIZE] =
144{ 6538, 9235, 16422, 14636, 13045 }; 144{ 6538, 9235, 16422, 14636, 13045 };
145/* autogain threshold times [1/5s] or [200ms] */ 145/* autogain threshold times [1/5s] or [200ms] */
146const short agc_tdrop[AGC_MODE_SIZE] = 146static const short agc_tdrop[AGC_MODE_SIZE] =
147{ 900, 225, 150, 60, 8 }; 147{ 900, 225, 150, 60, 8 };
148const short agc_trise[AGC_MODE_SIZE] = 148static const short agc_trise[AGC_MODE_SIZE] =
149{ 9000, 750, 400, 150, 20 }; 149{ 9000, 750, 400, 150, 20 };
150const short agc_tbal[AGC_MODE_SIZE] = 150static const short agc_tbal[AGC_MODE_SIZE] =
151{ 4500, 500, 300, 100, 15 }; 151{ 4500, 500, 300, 100, 15 };
152/* AGC operation */ 152/* AGC operation */
153static bool agc_enable = true; 153static bool agc_enable = true;
@@ -186,7 +186,7 @@ static void set_gain(void)
186 * Returns validity of peak values. 186 * Returns validity of peak values.
187 * Used for automatic gain control and history diagram. 187 * Used for automatic gain control and history diagram.
188 */ 188 */
189bool read_peak_levels(int *peak_l, int *peak_r, int *balance) 189static bool read_peak_levels(int *peak_l, int *peak_r, int *balance)
190{ 190{
191 peak_meter_get_peakhold(peak_l, peak_r); 191 peak_meter_get_peakhold(peak_l, peak_r);
192 peak_valid_mem[peak_time % 3] = *peak_l; 192 peak_valid_mem[peak_time % 3] = *peak_l;
@@ -215,7 +215,7 @@ bool read_peak_levels(int *peak_l, int *peak_r, int *balance)
215} 215}
216 216
217/* AGC helper function to check if maximum gain is reached */ 217/* AGC helper function to check if maximum gain is reached */
218bool agc_gain_is_max(bool left, bool right) 218static bool agc_gain_is_max(bool left, bool right)
219{ 219{
220 /* range -128...+108 [0.5dB] */ 220 /* range -128...+108 [0.5dB] */
221 short gain_current_l; 221 short gain_current_l;
@@ -242,7 +242,7 @@ bool agc_gain_is_max(bool left, bool right)
242 (right && (gain_current_r >= agc_maxgain))); 242 (right && (gain_current_r >= agc_maxgain)));
243} 243}
244 244
245void change_recording_gain(bool increment, bool left, bool right) 245static void change_recording_gain(bool increment, bool left, bool right)
246{ 246{
247 int factor = (increment ? 1 : -1); 247 int factor = (increment ? 1 : -1);
248 248
@@ -265,7 +265,7 @@ void change_recording_gain(bool increment, bool left, bool right)
265 * Change recording gain if peak_x levels are above or below 265 * Change recording gain if peak_x levels are above or below
266 * target volume for specified timeouts. 266 * target volume for specified timeouts.
267 */ 267 */
268void auto_gain_control(int *peak_l, int *peak_r, int *balance) 268static void auto_gain_control(int *peak_l, int *peak_r, int *balance)
269{ 269{
270 int agc_mono; 270 int agc_mono;
271 short agc_mode; 271 short agc_mode;
@@ -421,7 +421,7 @@ static const char* const fmtstr[] =
421 "%c%d.%02d %s " /* 2 decimals */ 421 "%c%d.%02d %s " /* 2 decimals */
422}; 422};
423 423
424char *fmt_gain(int snd, int val, char *str, int len) 424static char *fmt_gain(int snd, int val, char *str, int len)
425{ 425{
426 int i, d, numdec; 426 int i, d, numdec;
427 const char *unit; 427 const char *unit;
@@ -450,7 +450,7 @@ char *fmt_gain(int snd, int val, char *str, int len)
450 450
451static int cursor; 451static int cursor;
452 452
453void adjust_cursor(void) 453static void adjust_cursor(void)
454{ 454{
455 int max_cursor; 455 int max_cursor;
456 456
@@ -1776,7 +1776,7 @@ bool recording_screen(bool no_source)
1776} /* recording_screen */ 1776} /* recording_screen */
1777 1777
1778#if CONFIG_KEYPAD == RECORDER_PAD 1778#if CONFIG_KEYPAD == RECORDER_PAD
1779bool f2_rec_screen(void) 1779static bool f2_rec_screen(void)
1780{ 1780{
1781 static const char* const freq_str[6] = 1781 static const char* const freq_str[6] =
1782 { 1782 {
@@ -1916,7 +1916,7 @@ bool f2_rec_screen(void)
1916 return false; 1916 return false;
1917} 1917}
1918 1918
1919bool f3_rec_screen(void) 1919static bool f3_rec_screen(void)
1920{ 1920{
1921 bool exit = false; 1921 bool exit = false;
1922 bool used = false; 1922 bool used = false;