summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/lang/english.lang5
-rw-r--r--apps/onplay.c6
-rw-r--r--apps/recorder/recording.c30
-rw-r--r--apps/settings.c26
-rw-r--r--apps/settings.h1
-rw-r--r--apps/sound_menu.c7
6 files changed, 57 insertions, 18 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index e080491e2c..15d9039018 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -1467,3 +1467,8 @@ id: LANG_INVERT_CURSOR
1467desc: in settings_menu 1467desc: in settings_menu
1468eng: "Invert cursor" 1468eng: "Invert cursor"
1469new: 1469new:
1470
1471id: LANG_RECORDING_EDITABLE
1472desc: Editable recordings setting
1473eng: "Editable files"
1474new:
diff --git a/apps/onplay.c b/apps/onplay.c
index 3ba4c1b49c..14e3cdd7a7 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -251,11 +251,11 @@ static bool vbr_fix(void)
251 flen, xingupdate); 251 flen, xingupdate);
252 252
253 if(num_frames) { 253 if(num_frames) {
254 /* Note: We don't need to pass any values for mpeg_version and 254 /* Note: We don't need to pass a template header because it will be
255 sample_rate because they will be extracted from the mpeg stream */ 255 taken from the mpeg stream */
256 framelen = create_xing_header(fd, entry.first_frame_offset, 256 framelen = create_xing_header(fd, entry.first_frame_offset,
257 flen, xingbuf, num_frames, 257 flen, xingbuf, num_frames,
258 0, 0, xingupdate, true); 258 0, xingupdate, true);
259 259
260 /* Try to fit the Xing header first in the stream. Replace the existing 260 /* Try to fit the Xing header first in the stream. Replace the existing
261 VBR header if there is one, else see if there is room between the 261 VBR header if there is one, else see if there is room between the
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index cf295db19c..14bd37d950 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -169,7 +169,8 @@ bool recording_screen(void)
169 mpeg_set_recording_options(global_settings.rec_frequency, 169 mpeg_set_recording_options(global_settings.rec_frequency,
170 global_settings.rec_quality, 170 global_settings.rec_quality,
171 global_settings.rec_source, 171 global_settings.rec_source,
172 global_settings.rec_channels); 172 global_settings.rec_channels,
173 global_settings.rec_editable);
173 174
174 set_gain(); 175 set_gain();
175 176
@@ -312,22 +313,29 @@ bool recording_screen(void)
312 mpeg_set_recording_options(global_settings.rec_frequency, 313 mpeg_set_recording_options(global_settings.rec_frequency,
313 global_settings.rec_quality, 314 global_settings.rec_quality,
314 global_settings.rec_source, 315 global_settings.rec_source,
315 global_settings.rec_channels); 316 global_settings.rec_channels,
317 global_settings.rec_editable);
316 318
317 set_gain(); 319 set_gain();
318 update_countdown = 1; /* Update immediately */ 320 update_countdown = 1; /* Update immediately */
319 break; 321 break;
320 322
321 case BUTTON_F2: 323 case BUTTON_F2:
322 if (f2_rec_screen()) 324 if(mpeg_status())
323 return SYS_USB_CONNECTED; 325 {
324 update_countdown = 1; /* Update immediately */ 326 if (f2_rec_screen())
327 return SYS_USB_CONNECTED;
328 update_countdown = 1; /* Update immediately */
329 }
325 break; 330 break;
326 331
327 case BUTTON_F3: 332 case BUTTON_F3:
328 if (f3_rec_screen()) 333 if(mpeg_status())
329 return SYS_USB_CONNECTED; 334 {
330 update_countdown = 1; /* Update immediately */ 335 if (f3_rec_screen())
336 return SYS_USB_CONNECTED;
337 update_countdown = 1; /* Update immediately */
338 }
331 break; 339 break;
332 340
333 } 341 }
@@ -537,7 +545,8 @@ bool f2_rec_screen(void)
537 mpeg_set_recording_options(global_settings.rec_frequency, 545 mpeg_set_recording_options(global_settings.rec_frequency,
538 global_settings.rec_quality, 546 global_settings.rec_quality,
539 global_settings.rec_source, 547 global_settings.rec_source,
540 global_settings.rec_channels); 548 global_settings.rec_channels,
549 global_settings.rec_editable);
541 550
542 set_gain(); 551 set_gain();
543 552
@@ -621,7 +630,8 @@ bool f3_rec_screen(void)
621 mpeg_set_recording_options(global_settings.rec_frequency, 630 mpeg_set_recording_options(global_settings.rec_frequency,
622 global_settings.rec_quality, 631 global_settings.rec_quality,
623 global_settings.rec_source, 632 global_settings.rec_source,
624 global_settings.rec_channels); 633 global_settings.rec_channels,
634 global_settings.rec_editable);
625 635
626 set_gain(); 636 set_gain();
627 637
diff --git a/apps/settings.c b/apps/settings.c
index 8c132c5f9b..8b74df852b 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -96,8 +96,8 @@ offset abs
960x16 0x2a <(int) Byte offset into resume file> 960x16 0x2a <(int) Byte offset into resume file>
970x1a 0x2e <time until disk spindown> 970x1a 0x2e <time until disk spindown>
980x1b 0x2f <browse current, play selected, queue_resume> 980x1b 0x2f <browse current, play selected, queue_resume>
990x1c 0x30 <peak meter hold timeout (bit 0-4)>, 990x1c 0x30 <peak meter hold timeout (bit 0-4),
100 peak_meter_performance (bit 7) 100 rec_editable (bit 7)>
1010x1d 0x31 <(int) queue resume index> 1010x1d 0x31 <(int) queue resume index>
1020x21 0x35 <repeat mode (bit 0-1), rec. channels (bit 2), 1020x21 0x35 <repeat mode (bit 0-1), rec. channels (bit 2),
103 mic gain (bit 4-7)> 103 mic gain (bit 4-7)>
@@ -125,7 +125,7 @@ modified unless the header & checksum test fails.
125 125
126Rest of config block, only saved to disk: 126Rest of config block, only saved to disk:
1270xAE fade on pause/unpause/stop setting (bit 0) 1270xAE fade on pause/unpause/stop setting (bit 0)
1280xB0 peak meter clip hold timeout (bit 0-4) 1280xB0 peak meter clip hold timeout (bit 0-4), peak meter performance (bit 7)
1290xB1 peak meter release step size, peak_meter_dbfs (bit 7) 1290xB1 peak meter release step size, peak_meter_dbfs (bit 7)
1300xB2 peak meter min either in -db or in percent 1300xB2 peak meter min either in -db or in percent
1310xB3 peak meter max either in -db or in percent 1310xB3 peak meter max either in -db or in percent
@@ -341,7 +341,8 @@ int settings_save( void )
341 ((global_settings.play_selected & 1) << 1) | 341 ((global_settings.play_selected & 1) << 1) |
342 ((global_settings.queue_resume & 3) << 2)); 342 ((global_settings.queue_resume & 3) << 2));
343 343
344 config_block[0x1c] = (unsigned char)global_settings.peak_meter_hold; 344 config_block[0x1c] = (unsigned char)global_settings.peak_meter_hold |
345 (global_settings.rec_editable?0x80:0);
345 346
346 memcpy(&config_block[0x1d], &global_settings.queue_resume_index, 4); 347 memcpy(&config_block[0x1d], &global_settings.queue_resume_index, 4);
347 348
@@ -617,8 +618,11 @@ void settings_load(void)
617 global_settings.queue_resume = (config_block[0x1b] >> 2) & 3; 618 global_settings.queue_resume = (config_block[0x1b] >> 2) & 3;
618 } 619 }
619 620
620 if (config_block[0x1c] != 0xFF) 621 if (config_block[0x1c] != 0xFF) {
621 global_settings.peak_meter_hold = (config_block[0x1c]) & 0x1f; 622 global_settings.peak_meter_hold = (config_block[0x1c]) & 0x1f;
623 global_settings.rec_editable =
624 config_block[0x1c]?true:false;
625 }
622 626
623 if (config_block[0x1d] != 0xFF) 627 if (config_block[0x1d] != 0xFF)
624 memcpy(&global_settings.queue_resume_index, &config_block[0x1d], 628 memcpy(&global_settings.queue_resume_index, &config_block[0x1d],
@@ -1029,6 +1033,9 @@ bool settings_load_config(char* file)
1029 static char* options[] = {"stereo", "mono"}; 1033 static char* options[] = {"stereo", "mono"};
1030 set_cfg_option(&global_settings.rec_channels, value, options, 2); 1034 set_cfg_option(&global_settings.rec_channels, value, options, 2);
1031 } 1035 }
1036 else if (!strcasecmp(name, "editable recordings")) {
1037 set_cfg_bool(&global_settings.rec_editable, value);
1038 }
1032#endif 1039#endif
1033 else if (!strcasecmp(name, "idle poweroff")) { 1040 else if (!strcasecmp(name, "idle poweroff")) {
1034 static char* options[] = {"off","1","2","3","4","5","6","7","8", 1041 static char* options[] = {"off","1","2","3","4","5","6","7","8",
@@ -1434,6 +1441,14 @@ bool settings_save_config(void)
1434 global_settings.rec_left_gain, 1441 global_settings.rec_left_gain,
1435 global_settings.rec_right_gain); 1442 global_settings.rec_right_gain);
1436 write(fd, buf, strlen(buf)); 1443 write(fd, buf, strlen(buf));
1444
1445 {
1446 static char* options[] = {"off", "on"};
1447 snprintf(buf, sizeof(buf), "editable recordings: %s\r\n",
1448 options[global_settings.rec_editable]);
1449 write(fd, buf, strlen(buf));
1450 }
1451
1437#endif 1452#endif
1438 close(fd); 1453 close(fd);
1439 1454
@@ -1467,6 +1482,7 @@ void settings_reset(void) {
1467 global_settings.rec_mic_gain = 8; 1482 global_settings.rec_mic_gain = 8;
1468 global_settings.rec_left_gain = 2; /* 0dB */ 1483 global_settings.rec_left_gain = 2; /* 0dB */
1469 global_settings.rec_right_gain = 2; /* 0dB */ 1484 global_settings.rec_right_gain = 2; /* 0dB */
1485 global_settings.rec_editable = false;
1470 global_settings.resume = RESUME_ASK; 1486 global_settings.resume = RESUME_ASK;
1471 global_settings.contrast = DEFAULT_CONTRAST_SETTING; 1487 global_settings.contrast = DEFAULT_CONTRAST_SETTING;
1472 global_settings.invert = DEFAULT_INVERT_SETTING; 1488 global_settings.invert = DEFAULT_INVERT_SETTING;
diff --git a/apps/settings.h b/apps/settings.h
index 7876a18afa..0ff7cb2102 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -74,6 +74,7 @@ struct user_settings
74 int rec_mic_gain; /* 0-15 */ 74 int rec_mic_gain; /* 0-15 */
75 int rec_left_gain; /* 0-15 */ 75 int rec_left_gain; /* 0-15 */
76 int rec_right_gain; /* 0-15 */ 76 int rec_right_gain; /* 0-15 */
77 bool rec_editable; /* true means that the bit reservoir is off */
77 78
78 /* device settings */ 79 /* device settings */
79 80
diff --git a/apps/sound_menu.c b/apps/sound_menu.c
index 9ac95e46b8..84d389a47a 100644
--- a/apps/sound_menu.c
+++ b/apps/sound_menu.c
@@ -219,6 +219,12 @@ static bool recquality(void)
219 &global_settings.rec_quality, 219 &global_settings.rec_quality,
220 NULL, 1, 0, 7 ); 220 NULL, 1, 0, 7 );
221} 221}
222
223static bool receditable(void)
224{
225 return set_bool(str(LANG_RECORDING_EDITABLE),
226 &global_settings.rec_editable);
227}
222#endif /* HAVE_MAS3587F */ 228#endif /* HAVE_MAS3587F */
223 229
224static void set_chanconf(int val) 230static void set_chanconf(int val)
@@ -275,6 +281,7 @@ bool recording_menu(void)
275 { str(LANG_RECORDING_FREQUENCY), recfrequency }, 281 { str(LANG_RECORDING_FREQUENCY), recfrequency },
276 { str(LANG_RECORDING_SOURCE), recsource }, 282 { str(LANG_RECORDING_SOURCE), recsource },
277 { str(LANG_RECORDING_CHANNELS), recchannels }, 283 { str(LANG_RECORDING_CHANNELS), recchannels },
284 { str(LANG_RECORDING_EDITABLE), receditable },
278 }; 285 };
279 286
280 m=menu_init( items, sizeof items / sizeof(struct menu_items) ); 287 m=menu_init( items, sizeof items / sizeof(struct menu_items) );