diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/lang/english.lang | 5 | ||||
-rw-r--r-- | apps/settings.c | 26 | ||||
-rw-r--r-- | apps/settings.h | 2 | ||||
-rw-r--r-- | apps/settings_menu.c | 15 |
4 files changed, 44 insertions, 4 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 813955d3b0..a3d8a03858 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -1762,3 +1762,8 @@ id: LANG_CAR_ADAPTER_MODE | |||
1762 | desc: Displayed for setting car adapter mode to on/off | 1762 | desc: Displayed for setting car adapter mode to on/off |
1763 | eng: "Car Adapter Mode" | 1763 | eng: "Car Adapter Mode" |
1764 | new: | 1764 | new: |
1765 | |||
1766 | id: LANG_LINE_IN | ||
1767 | desc: in settings_menu | ||
1768 | eng: "Line In" | ||
1769 | new: | ||
diff --git a/apps/settings.c b/apps/settings.c index 9b8f1b35e1..429366d8ed 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -58,11 +58,13 @@ | |||
58 | #include "sprintf.h" | 58 | #include "sprintf.h" |
59 | #include "keyboard.h" | 59 | #include "keyboard.h" |
60 | #include "version.h" | 60 | #include "version.h" |
61 | 61 | #ifdef HAVE_MAS3507D | |
62 | #include "dac.h" | ||
63 | #endif | ||
62 | struct user_settings global_settings; | 64 | struct user_settings global_settings; |
63 | char rockboxdir[] = ROCKBOX_DIR; /* config/font/data file directory */ | 65 | char rockboxdir[] = ROCKBOX_DIR; /* config/font/data file directory */ |
64 | 66 | ||
65 | #define CONFIG_BLOCK_VERSION 7 | 67 | #define CONFIG_BLOCK_VERSION 8 |
66 | #define CONFIG_BLOCK_SIZE 512 | 68 | #define CONFIG_BLOCK_SIZE 512 |
67 | #define RTC_BLOCK_SIZE 44 | 69 | #define RTC_BLOCK_SIZE 44 |
68 | 70 | ||
@@ -134,6 +136,7 @@ Rest of config block, only saved to disk: | |||
134 | 0xAE fade on pause/unpause/stop setting (bit 0) | 136 | 0xAE fade on pause/unpause/stop setting (bit 0) |
135 | caption backlight (bit 1) | 137 | caption backlight (bit 1) |
136 | car adapter mode (bit 2) | 138 | car adapter mode (bit 2) |
139 | line_in (Player only) (bit 3) | ||
137 | 0xAF [available/unused] | 140 | 0xAF [available/unused] |
138 | 0xB0 peak meter clip hold timeout (bit 0-4), peak meter performance (bit 7) | 141 | 0xB0 peak meter clip hold timeout (bit 0-4), peak meter performance (bit 7) |
139 | 0xB1 peak meter release step size, peak_meter_dbfs (bit 7) | 142 | 0xB1 peak meter release step size, peak_meter_dbfs (bit 7) |
@@ -405,7 +408,8 @@ int settings_save( void ) | |||
405 | config_block[0xae] = (unsigned char) | 408 | config_block[0xae] = (unsigned char) |
406 | ((global_settings.fade_on_stop & 1) | | 409 | ((global_settings.fade_on_stop & 1) | |
407 | ((global_settings.caption_backlight & 1) << 1) | | 410 | ((global_settings.caption_backlight & 1) << 1) | |
408 | ((global_settings.car_adapter_mode & 1) << 2)); | 411 | ((global_settings.car_adapter_mode & 1) << 2) | |
412 | ((global_settings.line_in & 1) << 3)); | ||
409 | config_block[0xb0] = (unsigned char)global_settings.peak_meter_clip_hold | | 413 | config_block[0xb0] = (unsigned char)global_settings.peak_meter_clip_hold | |
410 | (global_settings.peak_meter_performance ? 0x80 : 0); | 414 | (global_settings.peak_meter_performance ? 0x80 : 0); |
411 | config_block[0xb1] = global_settings.peak_meter_release | | 415 | config_block[0xb1] = global_settings.peak_meter_release | |
@@ -490,7 +494,9 @@ void settings_apply(void) | |||
490 | backlight_set_timeout(global_settings.backlight_timeout); | 494 | backlight_set_timeout(global_settings.backlight_timeout); |
491 | backlight_set_on_when_charging(global_settings.backlight_on_when_charging); | 495 | backlight_set_on_when_charging(global_settings.backlight_on_when_charging); |
492 | ata_spindown(global_settings.disk_spindown); | 496 | ata_spindown(global_settings.disk_spindown); |
493 | 497 | #ifdef HAVE_MAS3507D | |
498 | dac_line_in(global_settings.line_in); | ||
499 | #endif | ||
494 | #ifdef HAVE_ATA_POWER_OFF | 500 | #ifdef HAVE_ATA_POWER_OFF |
495 | ata_poweroff(global_settings.disk_poweroff); | 501 | ata_poweroff(global_settings.disk_poweroff); |
496 | #endif | 502 | #endif |
@@ -690,6 +696,7 @@ void settings_load(void) | |||
690 | global_settings.fade_on_stop = config_block[0xae] & 1; | 696 | global_settings.fade_on_stop = config_block[0xae] & 1; |
691 | global_settings.caption_backlight = (config_block[0xae] >> 1) & 1; | 697 | global_settings.caption_backlight = (config_block[0xae] >> 1) & 1; |
692 | global_settings.car_adapter_mode = (config_block[0xae] >> 2) & 1; | 698 | global_settings.car_adapter_mode = (config_block[0xae] >> 2) & 1; |
699 | global_settings.line_in = (config_block[0xae] >> 3) & 1; | ||
693 | } | 700 | } |
694 | 701 | ||
695 | if(config_block[0xb0] != 0xff) { | 702 | if(config_block[0xb0] != 0xff) { |
@@ -1059,6 +1066,12 @@ bool settings_load_config(char* file) | |||
1059 | "9","10","15","30","45","60"}; | 1066 | "9","10","15","30","45","60"}; |
1060 | set_cfg_option(&global_settings.poweroff, value, options, 15); | 1067 | set_cfg_option(&global_settings.poweroff, value, options, 15); |
1061 | } | 1068 | } |
1069 | #ifdef HAVE_MAS3507D | ||
1070 | else if (!strcasecmp(name, "line in")){ | ||
1071 | set_cfg_bool(&global_settings.line_in, value); | ||
1072 | dac_line_in(global_settings.line_in); | ||
1073 | } | ||
1074 | #endif | ||
1062 | else if (!strcasecmp(name, "battery capacity")) | 1075 | else if (!strcasecmp(name, "battery capacity")) |
1063 | set_cfg_int(&global_settings.battery_capacity, value, | 1076 | set_cfg_int(&global_settings.battery_capacity, value, |
1064 | 1500, BATTERY_CAPACITY_MAX); | 1077 | 1500, BATTERY_CAPACITY_MAX); |
@@ -1341,6 +1354,10 @@ bool settings_save_config(void) | |||
1341 | fprintf(fd, "car adapter mode: %s\r\n", | 1354 | fprintf(fd, "car adapter mode: %s\r\n", |
1342 | boolopt[global_settings.car_adapter_mode]); | 1355 | boolopt[global_settings.car_adapter_mode]); |
1343 | 1356 | ||
1357 | #ifdef HAVE_MAS3507D | ||
1358 | fprintf(fd, "line in: %s\r\n", boolopt[global_settings.line_in]); | ||
1359 | #endif | ||
1360 | |||
1344 | #ifdef HAVE_MAS3587F | 1361 | #ifdef HAVE_MAS3587F |
1345 | fprintf(fd, "#\r\n# Recording\r\n#\r\n"); | 1362 | fprintf(fd, "#\r\n# Recording\r\n#\r\n"); |
1346 | fprintf(fd, "rec quality: %d\r\n", global_settings.rec_quality); | 1363 | fprintf(fd, "rec quality: %d\r\n", global_settings.rec_quality); |
@@ -1472,6 +1489,7 @@ void settings_reset(void) { | |||
1472 | global_settings.max_files_in_playlist = 10000; | 1489 | global_settings.max_files_in_playlist = 10000; |
1473 | global_settings.show_icons = true; | 1490 | global_settings.show_icons = true; |
1474 | global_settings.recursive_dir_insert = RECURSE_OFF; | 1491 | global_settings.recursive_dir_insert = RECURSE_OFF; |
1492 | global_settings.line_in = false; | ||
1475 | } | 1493 | } |
1476 | 1494 | ||
1477 | bool set_bool(char* string, bool* variable ) | 1495 | bool set_bool(char* string, bool* variable ) |
diff --git a/apps/settings.h b/apps/settings.h index 635834cac0..93516d86cf 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -171,6 +171,8 @@ struct user_settings | |||
171 | int max_files_in_playlist; /* Max entries in playlist */ | 171 | int max_files_in_playlist; /* Max entries in playlist */ |
172 | bool show_icons; /* 0=hide 1=show */ | 172 | bool show_icons; /* 0=hide 1=show */ |
173 | int recursive_dir_insert; /* should directories be inserted recursively */ | 173 | int recursive_dir_insert; /* should directories be inserted recursively */ |
174 | |||
175 | bool line_in; /* false=off, true=active */ | ||
174 | }; | 176 | }; |
175 | 177 | ||
176 | enum optiontype { INT, BOOL }; | 178 | enum optiontype { INT, BOOL }; |
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 7af267389a..d6fe1c6316 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -43,6 +43,9 @@ | |||
43 | #include "peakmeter.h" | 43 | #include "peakmeter.h" |
44 | #endif | 44 | #endif |
45 | #include "lang.h" | 45 | #include "lang.h" |
46 | #ifdef HAVE_MAS3507D | ||
47 | #include "dac.h" | ||
48 | #endif | ||
46 | 49 | ||
47 | static bool car_adapter_mode(void) | 50 | static bool car_adapter_mode(void) |
48 | { | 51 | { |
@@ -630,6 +633,15 @@ static bool spindown(void) | |||
630 | ata_spindown, 1, 3, 254 ); | 633 | ata_spindown, 1, 3, 254 ); |
631 | } | 634 | } |
632 | 635 | ||
636 | #ifdef HAVE_MAS3507D | ||
637 | static bool line_in(void) | ||
638 | { | ||
639 | bool rc = set_bool(str(LANG_LINE_IN), &global_settings.line_in); | ||
640 | dac_line_in(global_settings.line_in); | ||
641 | return rc; | ||
642 | } | ||
643 | #endif | ||
644 | |||
633 | #ifdef HAVE_ATA_POWER_OFF | 645 | #ifdef HAVE_ATA_POWER_OFF |
634 | static bool poweroff(void) | 646 | static bool poweroff(void) |
635 | { | 647 | { |
@@ -893,6 +905,9 @@ static bool system_settings_menu(void) | |||
893 | 905 | ||
894 | struct menu_items items[] = { | 906 | struct menu_items items[] = { |
895 | { str(LANG_SPINDOWN), spindown }, | 907 | { str(LANG_SPINDOWN), spindown }, |
908 | #ifdef HAVE_MAS3507D | ||
909 | { str(LANG_LINE_IN), line_in }, | ||
910 | #endif | ||
896 | #ifdef HAVE_ATA_POWER_OFF | 911 | #ifdef HAVE_ATA_POWER_OFF |
897 | { str(LANG_POWEROFF), poweroff }, | 912 | { str(LANG_POWEROFF), poweroff }, |
898 | #endif | 913 | #endif |