diff options
author | Björn Stenberg <bjorn@haxx.se> | 2003-10-17 14:49:00 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2003-10-17 14:49:00 +0000 |
commit | b1c429e6fb9a2f6881af2c2dd48cfb17c4477fc4 (patch) | |
tree | 122eea193a5dc8689ecf989b34f09e8d28271215 /apps/settings.c | |
parent | 3953211531b382ad23b82f35223c0ca82ed9814f (diff) | |
download | rockbox-b1c429e6fb9a2f6881af2c2dd48cfb17c4477fc4.tar.gz rockbox-b1c429e6fb9a2f6881af2c2dd48cfb17c4477fc4.zip |
Car Ignition Auto Stop (patch #736339 by Craig Sather)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3976 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings.c')
-rw-r--r-- | apps/settings.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/apps/settings.c b/apps/settings.c index e31a2d47d3..9b8f1b35e1 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -133,6 +133,8 @@ Rest of config block, only saved to disk: | |||
133 | 0xAC Max number of files in dir (50-10000) | 133 | 0xAC Max number of files in dir (50-10000) |
134 | 0xAE fade on pause/unpause/stop setting (bit 0) | 134 | 0xAE fade on pause/unpause/stop setting (bit 0) |
135 | caption backlight (bit 1) | 135 | caption backlight (bit 1) |
136 | car adapter mode (bit 2) | ||
137 | 0xAF [available/unused] | ||
136 | 0xB0 peak meter clip hold timeout (bit 0-4), peak meter performance (bit 7) | 138 | 0xB0 peak meter clip hold timeout (bit 0-4), peak meter performance (bit 7) |
137 | 0xB1 peak meter release step size, peak_meter_dbfs (bit 7) | 139 | 0xB1 peak meter release step size, peak_meter_dbfs (bit 7) |
138 | 0xB2 peak meter min either in -db or in percent | 140 | 0xB2 peak meter min either in -db or in percent |
@@ -402,7 +404,8 @@ int settings_save( void ) | |||
402 | (global_settings.max_files_in_dir >> 8) & 0xff; | 404 | (global_settings.max_files_in_dir >> 8) & 0xff; |
403 | config_block[0xae] = (unsigned char) | 405 | config_block[0xae] = (unsigned char) |
404 | ((global_settings.fade_on_stop & 1) | | 406 | ((global_settings.fade_on_stop & 1) | |
405 | ((global_settings.caption_backlight & 1) << 1)); | 407 | ((global_settings.caption_backlight & 1) << 1) | |
408 | ((global_settings.car_adapter_mode & 1) << 2)); | ||
406 | config_block[0xb0] = (unsigned char)global_settings.peak_meter_clip_hold | | 409 | config_block[0xb0] = (unsigned char)global_settings.peak_meter_clip_hold | |
407 | (global_settings.peak_meter_performance ? 0x80 : 0); | 410 | (global_settings.peak_meter_performance ? 0x80 : 0); |
408 | config_block[0xb1] = global_settings.peak_meter_release | | 411 | config_block[0xb1] = global_settings.peak_meter_release | |
@@ -542,6 +545,8 @@ void settings_apply(void) | |||
542 | global_settings.lang_file); | 545 | global_settings.lang_file); |
543 | lang_load(buf); | 546 | lang_load(buf); |
544 | } | 547 | } |
548 | |||
549 | set_car_adapter_mode(global_settings.car_adapter_mode); | ||
545 | } | 550 | } |
546 | 551 | ||
547 | /* | 552 | /* |
@@ -684,6 +689,7 @@ void settings_load(void) | |||
684 | if (config_block[0xae] != 0xff) { | 689 | if (config_block[0xae] != 0xff) { |
685 | global_settings.fade_on_stop = config_block[0xae] & 1; | 690 | global_settings.fade_on_stop = config_block[0xae] & 1; |
686 | global_settings.caption_backlight = (config_block[0xae] >> 1) & 1; | 691 | global_settings.caption_backlight = (config_block[0xae] >> 1) & 1; |
692 | global_settings.car_adapter_mode = (config_block[0xae] >> 2) & 1; | ||
687 | } | 693 | } |
688 | 694 | ||
689 | if(config_block[0xb0] != 0xff) { | 695 | if(config_block[0xb0] != 0xff) { |
@@ -1070,6 +1076,8 @@ bool settings_load_config(char* file) | |||
1070 | else if (!strcasecmp(name, "max files in playlist")) | 1076 | else if (!strcasecmp(name, "max files in playlist")) |
1071 | set_cfg_int(&global_settings.max_files_in_playlist, value, | 1077 | set_cfg_int(&global_settings.max_files_in_playlist, value, |
1072 | 1000, 20000); | 1078 | 1000, 20000); |
1079 | else if (!strcasecmp(name, "car adapter mode")) | ||
1080 | set_cfg_bool(&global_settings.car_adapter_mode, value); | ||
1073 | else if (!strcasecmp(name, "recursive directory insert")) { | 1081 | else if (!strcasecmp(name, "recursive directory insert")) { |
1074 | static char* options[] = {"off", "on", "ask"}; | 1082 | static char* options[] = {"off", "on", "ask"}; |
1075 | set_cfg_option(&global_settings.recursive_dir_insert, value, | 1083 | set_cfg_option(&global_settings.recursive_dir_insert, value, |
@@ -1330,6 +1338,9 @@ bool settings_save_config(void) | |||
1330 | options[global_settings.poweroff]); | 1338 | options[global_settings.poweroff]); |
1331 | } | 1339 | } |
1332 | 1340 | ||
1341 | fprintf(fd, "car adapter mode: %s\r\n", | ||
1342 | boolopt[global_settings.car_adapter_mode]); | ||
1343 | |||
1333 | #ifdef HAVE_MAS3587F | 1344 | #ifdef HAVE_MAS3587F |
1334 | fprintf(fd, "#\r\n# Recording\r\n#\r\n"); | 1345 | fprintf(fd, "#\r\n# Recording\r\n#\r\n"); |
1335 | fprintf(fd, "rec quality: %d\r\n", global_settings.rec_quality); | 1346 | fprintf(fd, "rec quality: %d\r\n", global_settings.rec_quality); |
@@ -1456,6 +1467,7 @@ void settings_reset(void) { | |||
1456 | global_settings.topruntime = 0; | 1467 | global_settings.topruntime = 0; |
1457 | global_settings.fade_on_stop = true; | 1468 | global_settings.fade_on_stop = true; |
1458 | global_settings.caption_backlight = false; | 1469 | global_settings.caption_backlight = false; |
1470 | global_settings.car_adapter_mode = false; | ||
1459 | global_settings.max_files_in_dir = 400; | 1471 | global_settings.max_files_in_dir = 400; |
1460 | global_settings.max_files_in_playlist = 10000; | 1472 | global_settings.max_files_in_playlist = 10000; |
1461 | global_settings.show_icons = true; | 1473 | global_settings.show_icons = true; |