summaryrefslogtreecommitdiff
path: root/apps/settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings.c')
-rw-r--r--apps/settings.c65
1 files changed, 35 insertions, 30 deletions
diff --git a/apps/settings.c b/apps/settings.c
index 5a532bf95e..717443f6cd 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -92,14 +92,10 @@ offset abs
920x12 0x26 <(int) Resume playlist index, or -1 if no playlist resume> 920x12 0x26 <(int) Resume playlist index, or -1 if no playlist resume>
930x16 0x2a <(int) Byte offset into resume file> 930x16 0x2a <(int) Byte offset into resume file>
940x1a 0x2e <time until disk spindown> 940x1a 0x2e <time until disk spindown>
950x1b 0x2f <browse current, play selected> 950x1b 0x2f <browse current, play selected, queue_resume>
960x1c 0x30 <peak meter hold timeout (bit 0-4)>, 960x1c 0x30 <peak meter hold timeout (bit 0-4)>,
97 peak_meter_performance (bit 7) 97 peak_meter_performance (bit 7)
980x1d 0x31 <peak meter clip hold timeout (bit 0-4) 980x1d 0x31 <(int) queue resume index>
990x1e 0x32 <peak meter release step size,
100 peak_meter_dbfs (bit 7)
1010x1f 0x33 <peak meter min either in -db or in percent>
1020x20 0x34 <peak meter max either in -db or in percent>
1030x21 0x35 <repeat mode (bit 0-1), rec. channels (bit 2), 990x21 0x35 <repeat mode (bit 0-1), rec. channels (bit 2),
104 mic gain (bit 4-7)> 100 mic gain (bit 4-7)>
1050x22 0x36 <rec. quality (bit 0-2), source (bit 3-4), frequency (bit 5-7)> 1010x22 0x36 <rec. quality (bit 0-2), source (bit 3-4), frequency (bit 5-7)>
@@ -125,7 +121,10 @@ modified unless the header & checksum test fails.
125 121
126 122
127Rest of config block, only saved to disk: 123Rest of config block, only saved to disk:
128 1240xB0 peak meter clip hold timeout (bit 0-4)
1250xB1 peak meter release step size, peak_meter_dbfs (bit 7)
1260xB2 peak meter min either in -db or in percent
1270xB3 peak meter max either in -db or in percent
1290xB4 battery capacity 1280xB4 battery capacity
1300xB5 scroll step in pixels 1290xB5 scroll step in pixels
1310xB6 scroll start and endpoint delay 1300xB6 scroll start and endpoint delay
@@ -330,15 +329,13 @@ int settings_save( void )
330 config_block[0x1a] = (unsigned char)global_settings.disk_spindown; 329 config_block[0x1a] = (unsigned char)global_settings.disk_spindown;
331 config_block[0x1b] = (unsigned char) 330 config_block[0x1b] = (unsigned char)
332 (((global_settings.browse_current & 1)) | 331 (((global_settings.browse_current & 1)) |
333 ((global_settings.play_selected & 1) << 1)); 332 ((global_settings.play_selected & 1) << 1) |
333 ((global_settings.queue_resume & 3) << 2));
334 334
335 config_block[0x1c] = (unsigned char)global_settings.peak_meter_hold; 335 config_block[0x1c] = (unsigned char)global_settings.peak_meter_hold;
336 config_block[0x1d] = (unsigned char)global_settings.peak_meter_clip_hold | 336
337 (global_settings.peak_meter_performance ? 0x80 : 0); 337 memcpy(&config_block[0x1d], &global_settings.queue_resume_index, 4);
338 config_block[0x1e] = global_settings.peak_meter_release | 338
339 (global_settings.peak_meter_dbfs ? 0x80 : 0);
340 config_block[0x1f] = (unsigned char)global_settings.peak_meter_min;
341 config_block[0x20] = (unsigned char)global_settings.peak_meter_max;
342 config_block[0x21] = (unsigned char) 339 config_block[0x21] = (unsigned char)
343 ((global_settings.repeat_mode & 3) | 340 ((global_settings.repeat_mode & 3) |
344 ((global_settings.rec_channels & 1) << 2) | 341 ((global_settings.rec_channels & 1) << 2) |
@@ -369,6 +366,13 @@ int settings_save( void )
369 config_block[0x29]=(unsigned char)(global_settings.topruntime >> 8); 366 config_block[0x29]=(unsigned char)(global_settings.topruntime >> 8);
370 } 367 }
371 368
369 config_block[0xb0] = (unsigned char)global_settings.peak_meter_clip_hold |
370 (global_settings.peak_meter_performance ? 0x80 : 0);
371 config_block[0xb1] = global_settings.peak_meter_release |
372 (global_settings.peak_meter_dbfs ? 0x80 : 0);
373 config_block[0xb2] = (unsigned char)global_settings.peak_meter_min;
374 config_block[0xb3] = (unsigned char)global_settings.peak_meter_max;
375
372 config_block[0xb4]=(global_settings.battery_capacity - 1000) / 50; 376 config_block[0xb4]=(global_settings.battery_capacity - 1000) / 50;
373 config_block[0xb5]=(unsigned char)global_settings.scroll_step; 377 config_block[0xb5]=(unsigned char)global_settings.scroll_step;
374 config_block[0xb6]=(unsigned char)global_settings.scroll_delay; 378 config_block[0xb6]=(unsigned char)global_settings.scroll_delay;
@@ -595,27 +599,15 @@ void settings_load(void)
595 if (config_block[0x1b] != 0xFF) { 599 if (config_block[0x1b] != 0xFF) {
596 global_settings.browse_current = (config_block[0x1b]) & 1; 600 global_settings.browse_current = (config_block[0x1b]) & 1;
597 global_settings.play_selected = (config_block[0x1b] >> 1) & 1; 601 global_settings.play_selected = (config_block[0x1b] >> 1) & 1;
602 global_settings.queue_resume = (config_block[0x1b] >> 2) & 3;
598 } 603 }
599 604
600 if (config_block[0x1c] != 0xFF) 605 if (config_block[0x1c] != 0xFF)
601 global_settings.peak_meter_hold = (config_block[0x1c]) & 0x1f; 606 global_settings.peak_meter_hold = (config_block[0x1c]) & 0x1f;
602 607
603 if (config_block[0x1d] != 0xFF) { 608 if (config_block[0x1d] != 0xFF)
604 global_settings.peak_meter_clip_hold = (config_block[0x1d]) & 0x1f; 609 memcpy(&global_settings.queue_resume_index, &config_block[0x1d],
605 global_settings.peak_meter_performance = 610 4);
606 (config_block[0x1d] & 0x80) != 0;
607 }
608
609 if (config_block[0x1e] != 0xFF) {
610 global_settings.peak_meter_release = config_block[0x1e] & 0x7f;
611 global_settings.peak_meter_dbfs = (config_block[0x1e] & 0x80) != 0;
612 }
613
614 if (config_block[0x1f] != 0xFF)
615 global_settings.peak_meter_min = config_block[0x1f];
616
617 if (config_block[0x20] != 0xFF)
618 global_settings.peak_meter_max = config_block[0x20];
619 611
620 if (config_block[0x21] != 0xFF) 612 if (config_block[0x21] != 0xFF)
621 { 613 {
@@ -652,6 +644,16 @@ void settings_load(void)
652 global_settings.topruntime = 644 global_settings.topruntime =
653 config_block[0x28] | (config_block[0x29] << 8); 645 config_block[0x28] | (config_block[0x29] << 8);
654 646
647 global_settings.peak_meter_clip_hold = (config_block[0xb0]) & 0x1f;
648 global_settings.peak_meter_performance =
649 (config_block[0xb0] & 0x80) != 0;
650
651 global_settings.peak_meter_release = config_block[0xb1] & 0x7f;
652 global_settings.peak_meter_dbfs = (config_block[0xb1] & 0x80) != 0;
653
654 global_settings.peak_meter_min = config_block[0xb2];
655 global_settings.peak_meter_max = config_block[0xb3];
656
655 global_settings.battery_capacity = config_block[0xb4]*50 + 1000; 657 global_settings.battery_capacity = config_block[0xb4]*50 + 1000;
656 658
657 if (config_block[0xb5] != 0xff) 659 if (config_block[0xb5] != 0xff)
@@ -857,6 +859,9 @@ void settings_reset(void) {
857 global_settings.ff_rewind_accel = DEFAULT_FF_REWIND_ACCEL_SETTING; 859 global_settings.ff_rewind_accel = DEFAULT_FF_REWIND_ACCEL_SETTING;
858 global_settings.resume_index = -1; 860 global_settings.resume_index = -1;
859 global_settings.resume_offset = -1; 861 global_settings.resume_offset = -1;
862 global_settings.save_queue_resume = true;
863 global_settings.queue_resume = 0;
864 global_settings.queue_resume_index = -1;
860 global_settings.disk_spindown = 5; 865 global_settings.disk_spindown = 5;
861 global_settings.disk_poweroff = false; 866 global_settings.disk_poweroff = false;
862 global_settings.buffer_margin = 0; 867 global_settings.buffer_margin = 0;