summaryrefslogtreecommitdiff
path: root/apps/recorder
diff options
context:
space:
mode:
Diffstat (limited to 'apps/recorder')
-rw-r--r--apps/recorder/backdrop.c18
-rw-r--r--apps/recorder/keyboard.c2
-rw-r--r--apps/recorder/peakmeter.c8
-rw-r--r--apps/recorder/radio.c50
-rw-r--r--apps/recorder/recording.c36
5 files changed, 57 insertions, 57 deletions
diff --git a/apps/recorder/backdrop.c b/apps/recorder/backdrop.c
index 7779792621..e17853493d 100644
--- a/apps/recorder/backdrop.c
+++ b/apps/recorder/backdrop.c
@@ -23,23 +23,23 @@
23#include "backdrop.h" 23#include "backdrop.h"
24 24
25#if LCD_DEPTH >= 8 25#if LCD_DEPTH >= 8
26fb_data main_backdrop[LCD_HEIGHT][LCD_WIDTH]; 26static fb_data main_backdrop[LCD_HEIGHT][LCD_WIDTH];
27fb_data wps_backdrop[LCD_HEIGHT][LCD_WIDTH]; 27static fb_data wps_backdrop[LCD_HEIGHT][LCD_WIDTH];
28#elif LCD_DEPTH == 2 28#elif LCD_DEPTH == 2
29#if LCD_PIXELFORMAT == VERTICAL_PACKING 29#if LCD_PIXELFORMAT == VERTICAL_PACKING
30fb_data main_backdrop[(LCD_HEIGHT+3)/4][LCD_WIDTH]; 30static fb_data main_backdrop[(LCD_HEIGHT+3)/4][LCD_WIDTH];
31fb_data wps_backdrop[(LCD_HEIGHT+3)/4][LCD_WIDTH]; 31static fb_data wps_backdrop[(LCD_HEIGHT+3)/4][LCD_WIDTH];
32#else 32#else
33fb_data main_backdrop[LCD_HEIGHT][LCD_FBWIDTH]; 33static fb_data main_backdrop[LCD_HEIGHT][LCD_FBWIDTH];
34fb_data wps_backdrop[LCD_HEIGHT][LCD_FBWIDTH]; 34static fb_data wps_backdrop[LCD_HEIGHT][LCD_FBWIDTH];
35#endif 35#endif
36#endif 36#endif
37 37
38bool main_backdrop_valid = false; 38static bool main_backdrop_valid = false;
39bool wps_backdrop_valid = false; 39static bool wps_backdrop_valid = false;
40 40
41/* load a backdrop into a buffer */ 41/* load a backdrop into a buffer */
42bool load_backdrop(char* filename, fb_data* backdrop_buffer) 42static bool load_backdrop(char* filename, fb_data* backdrop_buffer)
43{ 43{
44 struct bitmap bm; 44 struct bitmap bm;
45 int ret; 45 int ret;
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c
index 58bc179b64..8e006117c8 100644
--- a/apps/recorder/keyboard.c
+++ b/apps/recorder/keyboard.c
@@ -90,7 +90,7 @@ struct keyboard_parameters {
90 int y; 90 int y;
91}; 91};
92 92
93struct keyboard_parameters param[NB_SCREENS]; 93static struct keyboard_parameters param[NB_SCREENS];
94static bool kbd_loaded = false; 94static bool kbd_loaded = false;
95 95
96#ifdef KBD_MORSE_INPUT 96#ifdef KBD_MORSE_INPUT
diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c
index 1033ffee67..69c5e95893 100644
--- a/apps/recorder/peakmeter.c
+++ b/apps/recorder/peakmeter.c
@@ -50,7 +50,7 @@ static bool pm_playback = true; /* selects between playback and recording peaks
50 50
51#endif 51#endif
52 52
53struct meter_scales scales[NB_SCREENS]; 53static struct meter_scales scales[NB_SCREENS];
54 54
55#if !defined(SIMULATOR) && CONFIG_CODEC != SWCODEC 55#if !defined(SIMULATOR) && CONFIG_CODEC != SWCODEC
56/* Data source */ 56/* Data source */
@@ -84,7 +84,7 @@ unsigned short peak_meter_range_min; /* minimum of range in samples */
84unsigned short peak_meter_range_max; /* maximum of range in samples */ 84unsigned short peak_meter_range_max; /* maximum of range in samples */
85static unsigned short pm_range; /* range width in samples */ 85static unsigned short pm_range; /* range width in samples */
86static bool pm_use_dbfs = true; /* true if peakmeter displays dBfs */ 86static bool pm_use_dbfs = true; /* true if peakmeter displays dBfs */
87bool level_check; /* true if peeked at peakmeter before drawing */ 87static bool level_check; /* true if peeked at peakmeter before drawing */
88static unsigned short pm_db_min = 0; /* minimum of range in 1/100 dB */ 88static unsigned short pm_db_min = 0; /* minimum of range in 1/100 dB */
89static unsigned short pm_db_max = 9000; /* maximum of range in 1/100 dB */ 89static unsigned short pm_db_max = 9000; /* maximum of range in 1/100 dB */
90static unsigned short pm_db_range = 9000; /* range width in 1/100 dB */ 90static unsigned short pm_db_range = 9000; /* range width in 1/100 dB */
@@ -298,7 +298,7 @@ static int db_to_sample_bin_search(int min, int max, int db)
298 * @return int - The return value is in the range of 298 * @return int - The return value is in the range of
299 * 0 <= return value < MAX_PEAK 299 * 0 <= return value < MAX_PEAK
300 */ 300 */
301int peak_meter_db2sample(int db) 301int peak_meter_db2sample(int db)
302{ 302{
303 int retval = 0; 303 int retval = 0;
304 304
@@ -791,7 +791,7 @@ static int peak_meter_read_r(void)
791 * This is used by the histogram feature in the recording screen. 791 * This is used by the histogram feature in the recording screen.
792 * Values are in the range 0 <= peak_x < MAX_PEAK. MAX_PEAK is typ 32767. 792 * Values are in the range 0 <= peak_x < MAX_PEAK. MAX_PEAK is typ 32767.
793 */ 793 */
794extern void peak_meter_get_peakhold(int *peak_left, int *peak_right) 794void peak_meter_get_peakhold(int *peak_left, int *peak_right)
795{ 795{
796 if (peak_left) 796 if (peak_left)
797 *peak_left = pm_peakhold_left; 797 *peak_left = pm_peakhold_left;
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c
index 7a0cc6543e..51e206fc4f 100644
--- a/apps/recorder/radio.c
+++ b/apps/recorder/radio.c
@@ -127,13 +127,13 @@ static int preset_menu; /* The menu index of the preset list */
127static struct menu_item preset_menu_items[MAX_PRESETS]; 127static struct menu_item preset_menu_items[MAX_PRESETS];
128static int num_presets = 0; /* The number of presets in the preset list */ 128static int num_presets = 0; /* The number of presets in the preset list */
129 129
130void radio_save_presets(void); 130static void radio_save_presets(void);
131bool handle_radio_presets(void); 131static bool handle_radio_presets(void);
132bool radio_menu(void); 132static bool radio_menu(void);
133bool radio_add_preset(void); 133static bool radio_add_preset(void);
134bool save_preset_list(void); 134static bool save_preset_list(void);
135bool load_preset_list(void); 135static bool load_preset_list(void);
136bool clear_preset_list(void); 136static bool clear_preset_list(void);
137 137
138static bool scan_presets(void); 138static bool scan_presets(void);
139 139
@@ -148,14 +148,14 @@ int radio_get(int setting);
148#define radio_set philips_set 148#define radio_set philips_set
149#define radio_get philips_get 149#define radio_get philips_get
150#elif CONFIG_TUNER == (S1A0903X01 | TEA5767) /* OndioFM */ 150#elif CONFIG_TUNER == (S1A0903X01 | TEA5767) /* OndioFM */
151void (*radio_set)(int setting, int value); 151static void (*radio_set)(int setting, int value);
152int (*radio_get)(int setting); 152static int (*radio_get)(int setting);
153#endif 153#endif
154#endif 154#endif
155 155
156/* Function to manipulate all yesno dialogues. 156/* Function to manipulate all yesno dialogues.
157 This function needs the output text as an argument. */ 157 This function needs the output text as an argument. */
158bool yesno_pop(char* text) 158static bool yesno_pop(char* text)
159{ 159{
160 int i; 160 int i;
161 char *lines[]={text}; 161 char *lines[]={text};
@@ -338,7 +338,7 @@ static void remember_frequency(void)
338 settings_save(); 338 settings_save();
339} 339}
340 340
341void next_preset(int direction) 341static void next_preset(int direction)
342{ 342{
343 if (num_presets < 1) 343 if (num_presets < 1)
344 return; 344 return;
@@ -967,7 +967,7 @@ bool radio_screen(void)
967 return have_recorded; 967 return have_recorded;
968} /* radio_screen */ 968} /* radio_screen */
969 969
970void radio_save_presets(void) 970static void radio_save_presets(void)
971{ 971{
972 int fd; 972 int fd;
973 int i; 973 int i;
@@ -1064,7 +1064,7 @@ static void rebuild_preset_menu(void)
1064 } 1064 }
1065} 1065}
1066 1066
1067bool radio_add_preset(void) 1067static bool radio_add_preset(void)
1068{ 1068{
1069 char buf[MAX_FMPRESET_LEN]; 1069 char buf[MAX_FMPRESET_LEN];
1070 1070
@@ -1129,7 +1129,7 @@ static bool radio_edit_preset(void)
1129 return true; 1129 return true;
1130} 1130}
1131 1131
1132bool radio_delete_preset(void) 1132static bool radio_delete_preset(void)
1133{ 1133{
1134 int pos = menu_cursor(preset_menu); 1134 int pos = menu_cursor(preset_menu);
1135 int i; 1135 int i;
@@ -1157,12 +1157,12 @@ bool radio_delete_preset(void)
1157 return true; /* Make the menu return immediately */ 1157 return true; /* Make the menu return immediately */
1158} 1158}
1159 1159
1160bool load_preset_list(void) 1160static bool load_preset_list(void)
1161{ 1161{
1162 return !rockbox_browse(FMPRESET_PATH, SHOW_FMR); 1162 return !rockbox_browse(FMPRESET_PATH, SHOW_FMR);
1163} 1163}
1164 1164
1165bool save_preset_list(void) 1165static bool save_preset_list(void)
1166{ 1166{
1167 if(num_presets != 0) 1167 if(num_presets != 0)
1168 { 1168 {
@@ -1215,7 +1215,7 @@ bool save_preset_list(void)
1215 return true; 1215 return true;
1216} 1216}
1217 1217
1218bool clear_preset_list(void) 1218static bool clear_preset_list(void)
1219{ 1219{
1220 int i; 1220 int i;
1221 1221
@@ -1236,7 +1236,7 @@ bool clear_preset_list(void)
1236} 1236}
1237 1237
1238/* little menu on what to do with a preset entry */ 1238/* little menu on what to do with a preset entry */
1239bool handle_radio_presets_menu(void) 1239static bool handle_radio_presets_menu(void)
1240{ 1240{
1241 static const struct menu_item preset_menu_items[] = { 1241 static const struct menu_item preset_menu_items[] = {
1242 { ID2P(LANG_FM_EDIT_PRESET), radio_edit_preset }, 1242 { ID2P(LANG_FM_EDIT_PRESET), radio_edit_preset },
@@ -1254,7 +1254,7 @@ bool handle_radio_presets_menu(void)
1254} 1254}
1255 1255
1256/* button preprocessor for list of preset stations menu */ 1256/* button preprocessor for list of preset stations menu */
1257int handle_radio_presets_cb(int key, int m) 1257static int handle_radio_presets_cb(int key, int m)
1258{ 1258{
1259 (void)m; 1259 (void)m;
1260 1260
@@ -1292,7 +1292,7 @@ int handle_radio_presets_cb(int key, int m)
1292} 1292}
1293 1293
1294/* present a list of preset stations */ 1294/* present a list of preset stations */
1295bool handle_radio_presets(void) 1295static bool handle_radio_presets(void)
1296{ 1296{
1297 int result; 1297 int result;
1298 bool reload_dir = false; 1298 bool reload_dir = false;
@@ -1328,7 +1328,7 @@ bool handle_radio_presets(void)
1328 return reload_dir; 1328 return reload_dir;
1329} 1329}
1330 1330
1331char monomode_menu_string[32]; 1331static char monomode_menu_string[32];
1332 1332
1333static void create_monomode_menu(void) 1333static void create_monomode_menu(void)
1334{ 1334{
@@ -1347,7 +1347,7 @@ static bool toggle_mono_mode(void)
1347 return false; 1347 return false;
1348} 1348}
1349 1349
1350char region_menu_string[32]; 1350static char region_menu_string[32];
1351static void create_region_menu(void) 1351static void create_region_menu(void)
1352{ 1352{
1353 snprintf(region_menu_string, sizeof(region_menu_string), 1353 snprintf(region_menu_string, sizeof(region_menu_string),
@@ -1381,7 +1381,7 @@ static bool toggle_region_mode(void)
1381} 1381}
1382 1382
1383#ifndef FM_MODE 1383#ifndef FM_MODE
1384char radiomode_menu_string[32]; 1384static char radiomode_menu_string[32];
1385 1385
1386static void create_radiomode_menu(void) 1386static void create_radiomode_menu(void)
1387{ 1387{
@@ -1471,7 +1471,7 @@ static bool scan_presets(void)
1471} 1471}
1472 1472
1473/* button preprocessor for the main menu */ 1473/* button preprocessor for the main menu */
1474int radio_menu_cb(int key, int m) 1474static int radio_menu_cb(int key, int m)
1475{ 1475{
1476 (void)m; 1476 (void)m;
1477#if 0 /* this screen needs fixing! */ 1477#if 0 /* this screen needs fixing! */
@@ -1548,7 +1548,7 @@ static bool fm_recording_settings(void)
1548 1548
1549 1549
1550/* main menu of the radio screen */ 1550/* main menu of the radio screen */
1551bool radio_menu(void) 1551static bool radio_menu(void)
1552{ 1552{
1553 int m; 1553 int m;
1554 bool result; 1554 bool result;
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;