summaryrefslogtreecommitdiff
path: root/apps/settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings.c')
-rw-r--r--apps/settings.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/apps/settings.c b/apps/settings.c
index bfc943bef0..7b9c1feb60 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -146,6 +146,9 @@ Rest of config block, only saved to disk:
146 caption backlight (bit 1) 146 caption backlight (bit 1)
147 car adapter mode (bit 2) 147 car adapter mode (bit 2)
148 line_in (Player only) (bit 3) 148 line_in (Player only) (bit 3)
149 playlist viewer icons (bit 4)
150 playlist viewer indices (bit 5)
151 playlist viewer track display (bit 6)
1490xAF <most-recent-bookmarks, auto-bookmark, autoload> 1520xAF <most-recent-bookmarks, auto-bookmark, autoload>
1500xB0 peak meter clip hold timeout (bit 0-4), peak meter performance (bit 7) 1530xB0 peak meter clip hold timeout (bit 0-4), peak meter performance (bit 7)
1510xB1 peak meter release step size, peak_meter_dbfs (bit 7) 1540xB1 peak meter release step size, peak_meter_dbfs (bit 7)
@@ -421,7 +424,10 @@ int settings_save( void )
421 ((global_settings.fade_on_stop & 1) | 424 ((global_settings.fade_on_stop & 1) |
422 ((global_settings.caption_backlight & 1) << 1) | 425 ((global_settings.caption_backlight & 1) << 1) |
423 ((global_settings.car_adapter_mode & 1) << 2) | 426 ((global_settings.car_adapter_mode & 1) << 2) |
424 ((global_settings.line_in & 1) << 3)); 427 ((global_settings.line_in & 1) << 3) |
428 ((global_settings.playlist_viewer_icons & 1) << 4) |
429 ((global_settings.playlist_viewer_indices & 1) << 5) |
430 ((global_settings.playlist_viewer_track_display & 1) << 6));
425 config_block[0xaf] = ((global_settings.usemrb << 5) | 431 config_block[0xaf] = ((global_settings.usemrb << 5) |
426 (global_settings.autocreatebookmark << 2) | 432 (global_settings.autocreatebookmark << 2) |
427 (global_settings.autoloadbookmark)); 433 (global_settings.autoloadbookmark));
@@ -726,6 +732,12 @@ void settings_load(void)
726 global_settings.caption_backlight = (config_block[0xae] >> 1) & 1; 732 global_settings.caption_backlight = (config_block[0xae] >> 1) & 1;
727 global_settings.car_adapter_mode = (config_block[0xae] >> 2) & 1; 733 global_settings.car_adapter_mode = (config_block[0xae] >> 2) & 1;
728 global_settings.line_in = (config_block[0xae] >> 3) & 1; 734 global_settings.line_in = (config_block[0xae] >> 3) & 1;
735 global_settings.playlist_viewer_icons =
736 (config_block[0xae] >> 4) & 1;
737 global_settings.playlist_viewer_indices =
738 (config_block[0xae] >> 5) & 1;
739 global_settings.playlist_viewer_track_display =
740 (config_block[0xae] >> 6) & 1;
729 } 741 }
730 742
731 if(config_block[0xb0] != 0xff) { 743 if(config_block[0xb0] != 0xff) {
@@ -1161,6 +1173,16 @@ bool settings_load_config(char* file)
1161 static char* options[] = {"off", "on", "unique only"}; 1173 static char* options[] = {"off", "on", "unique only"};
1162 set_cfg_option(&global_settings.usemrb, value, options, 3); 1174 set_cfg_option(&global_settings.usemrb, value, options, 3);
1163 } 1175 }
1176 else if (!strcasecmp(name, "playlist viewer icons"))
1177 set_cfg_bool(&global_settings.playlist_viewer_icons, value);
1178 else if (!strcasecmp(name, "playlist viewer indices"))
1179 set_cfg_bool(&global_settings.playlist_viewer_indices, value);
1180 else if (!strcasecmp(name, "playlist viewer track display"))
1181 {
1182 static char* options[] = {"track name", "full path"};
1183 set_cfg_option(&global_settings.playlist_viewer_track_display,
1184 value, options, 2);
1185 }
1164 } 1186 }
1165 1187
1166 close(fd); 1188 close(fd);
@@ -1494,6 +1516,19 @@ bool settings_save_config(void)
1494 triopt[global_settings.recursive_dir_insert]); 1516 triopt[global_settings.recursive_dir_insert]);
1495 } 1517 }
1496 1518
1519 fprintf(fd, "#\r\n# Playlist viewer\r\n#\r\n");
1520 {
1521 fprintf(fd, "playlist viewer icons: %s\r\n",
1522 boolopt[global_settings.playlist_viewer_icons]);
1523 fprintf(fd, "playlist viewer indices: %s\r\n",
1524 boolopt[global_settings.playlist_viewer_indices]);
1525 {
1526 static char* options[] = {"track name", "full path"};
1527 fprintf(fd, "playlist viewer track display: %s\r\n",
1528 options[global_settings.playlist_viewer_track_display]);
1529 }
1530 }
1531
1497 close(fd); 1532 close(fd);
1498 1533
1499 lcd_clear_display(); 1534 lcd_clear_display();
@@ -1596,6 +1631,9 @@ void settings_reset(void) {
1596 global_settings.show_icons = true; 1631 global_settings.show_icons = true;
1597 global_settings.recursive_dir_insert = RECURSE_OFF; 1632 global_settings.recursive_dir_insert = RECURSE_OFF;
1598 global_settings.line_in = false; 1633 global_settings.line_in = false;
1634 global_settings.playlist_viewer_icons = true;
1635 global_settings.playlist_viewer_indices = true;
1636 global_settings.playlist_viewer_track_display = 0;
1599} 1637}
1600 1638
1601bool set_bool(char* string, bool* variable ) 1639bool set_bool(char* string, bool* variable )