diff options
Diffstat (limited to 'apps/settings.c')
-rw-r--r-- | apps/settings.c | 26 |
1 files changed, 21 insertions, 5 deletions
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 | |||
96 | 0x16 0x2a <(int) Byte offset into resume file> | 96 | 0x16 0x2a <(int) Byte offset into resume file> |
97 | 0x1a 0x2e <time until disk spindown> | 97 | 0x1a 0x2e <time until disk spindown> |
98 | 0x1b 0x2f <browse current, play selected, queue_resume> | 98 | 0x1b 0x2f <browse current, play selected, queue_resume> |
99 | 0x1c 0x30 <peak meter hold timeout (bit 0-4)>, | 99 | 0x1c 0x30 <peak meter hold timeout (bit 0-4), |
100 | peak_meter_performance (bit 7) | 100 | rec_editable (bit 7)> |
101 | 0x1d 0x31 <(int) queue resume index> | 101 | 0x1d 0x31 <(int) queue resume index> |
102 | 0x21 0x35 <repeat mode (bit 0-1), rec. channels (bit 2), | 102 | 0x21 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 | ||
126 | Rest of config block, only saved to disk: | 126 | Rest of config block, only saved to disk: |
127 | 0xAE fade on pause/unpause/stop setting (bit 0) | 127 | 0xAE fade on pause/unpause/stop setting (bit 0) |
128 | 0xB0 peak meter clip hold timeout (bit 0-4) | 128 | 0xB0 peak meter clip hold timeout (bit 0-4), peak meter performance (bit 7) |
129 | 0xB1 peak meter release step size, peak_meter_dbfs (bit 7) | 129 | 0xB1 peak meter release step size, peak_meter_dbfs (bit 7) |
130 | 0xB2 peak meter min either in -db or in percent | 130 | 0xB2 peak meter min either in -db or in percent |
131 | 0xB3 peak meter max either in -db or in percent | 131 | 0xB3 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; |