diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/lang/english.lang | 5 | ||||
-rw-r--r-- | apps/settings.c | 12 | ||||
-rw-r--r-- | apps/settings.h | 1 | ||||
-rw-r--r-- | apps/settings_menu.c | 29 |
4 files changed, 40 insertions, 7 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index ce2b300d8c..ffdc12b306 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -1842,3 +1842,8 @@ id: LANG_MOVE_FAILED | |||
1842 | desc: Error message displayed in playlist viewer | 1842 | desc: Error message displayed in playlist viewer |
1843 | eng: "Move failed" | 1843 | eng: "Move failed" |
1844 | new: | 1844 | new: |
1845 | |||
1846 | id: LANG_FLIP_DISPLAY | ||
1847 | desc: in settings_menu, option to turn display+buttos by 180 degreed | ||
1848 | eng: "Upside Down" | ||
1849 | new: | ||
diff --git a/apps/settings.c b/apps/settings.c index 3c56257db4..b2fa22170b 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -103,6 +103,7 @@ offset abs | |||
103 | 0x1a 0x2e <time until disk spindown> | 103 | 0x1a 0x2e <time until disk spindown> |
104 | 0x1b 0x2f <browse current, play selected, recursive dir insert> | 104 | 0x1b 0x2f <browse current, play selected, recursive dir insert> |
105 | 0x1c 0x30 <peak meter hold timeout (bit 0-4), | 105 | 0x1c 0x30 <peak meter hold timeout (bit 0-4), |
106 | flip_display (bit 6) | ||
106 | rec_editable (bit 7)> | 107 | rec_editable (bit 7)> |
107 | 0x1d 0x31 <(int) Resume shuffle seed, or -1 if no shuffle> | 108 | 0x1d 0x31 <(int) Resume shuffle seed, or -1 if no shuffle> |
108 | 0x21 0x35 <repeat mode (bit 0-1), rec. channels (bit 2), | 109 | 0x21 0x35 <repeat mode (bit 0-1), rec. channels (bit 2), |
@@ -362,6 +363,7 @@ int settings_save( void ) | |||
362 | ((global_settings.recursive_dir_insert & 3) << 2)); | 363 | ((global_settings.recursive_dir_insert & 3) << 2)); |
363 | 364 | ||
364 | config_block[0x1c] = (unsigned char)global_settings.peak_meter_hold | | 365 | config_block[0x1c] = (unsigned char)global_settings.peak_meter_hold | |
366 | (global_settings.flip_display ? 0x40 : 0) | | ||
365 | (global_settings.rec_editable?0x80:0); | 367 | (global_settings.rec_editable?0x80:0); |
366 | 368 | ||
367 | memcpy(&config_block[0x1d], &global_settings.resume_seed, 4); | 369 | memcpy(&config_block[0x1d], &global_settings.resume_seed, 4); |
@@ -516,6 +518,9 @@ void settings_apply(void) | |||
516 | 518 | ||
517 | #ifdef HAVE_LCD_BITMAP | 519 | #ifdef HAVE_LCD_BITMAP |
518 | lcd_set_invert_display(global_settings.invert); | 520 | lcd_set_invert_display(global_settings.invert); |
521 | lcd_set_flip(global_settings.flip_display); | ||
522 | button_set_flip(global_settings.flip_display); | ||
523 | lcd_update(); /* refresh after flipping the screen */ | ||
519 | settings_apply_pm_range(); | 524 | settings_apply_pm_range(); |
520 | peak_meter_init_times( | 525 | peak_meter_init_times( |
521 | global_settings.peak_meter_release, global_settings.peak_meter_hold, | 526 | global_settings.peak_meter_release, global_settings.peak_meter_hold, |
@@ -660,6 +665,8 @@ void settings_load(void) | |||
660 | 665 | ||
661 | if (config_block[0x1c] != 0xFF) { | 666 | if (config_block[0x1c] != 0xFF) { |
662 | global_settings.peak_meter_hold = (config_block[0x1c]) & 0x1f; | 667 | global_settings.peak_meter_hold = (config_block[0x1c]) & 0x1f; |
668 | global_settings.flip_display = | ||
669 | (config_block[0x1c] & 0x40)?true:false; | ||
663 | global_settings.rec_editable = | 670 | global_settings.rec_editable = |
664 | (config_block[0x1c] & 0x80)?true:false; | 671 | (config_block[0x1c] & 0x80)?true:false; |
665 | } | 672 | } |
@@ -970,6 +977,8 @@ bool settings_load_config(char* file) | |||
970 | set_cfg_bool(&global_settings.scrollbar, value); | 977 | set_cfg_bool(&global_settings.scrollbar, value); |
971 | else if (!strcasecmp(name, "invert")) | 978 | else if (!strcasecmp(name, "invert")) |
972 | set_cfg_bool(&global_settings.invert, value); | 979 | set_cfg_bool(&global_settings.invert, value); |
980 | else if (!strcasecmp(name, "flip diplay")) | ||
981 | set_cfg_bool(&global_settings.flip_display, value); | ||
973 | else if (!strcasecmp(name, "invert cursor")) | 982 | else if (!strcasecmp(name, "invert cursor")) |
974 | set_cfg_bool(&global_settings.invert_cursor, value); | 983 | set_cfg_bool(&global_settings.invert_cursor, value); |
975 | else if (!strcasecmp(name, "show icons")) | 984 | else if (!strcasecmp(name, "show icons")) |
@@ -1295,6 +1304,8 @@ bool settings_save_config(void) | |||
1295 | #ifdef HAVE_LCD_BITMAP | 1304 | #ifdef HAVE_LCD_BITMAP |
1296 | fprintf(fd, "invert: %s\r\n", boolopt[global_settings.invert]); | 1305 | fprintf(fd, "invert: %s\r\n", boolopt[global_settings.invert]); |
1297 | 1306 | ||
1307 | fprintf(fd, "flip display: %s\r\n", boolopt[global_settings.flip_display]); | ||
1308 | |||
1298 | fprintf(fd, "invert cursor: %s\r\n", | 1309 | fprintf(fd, "invert cursor: %s\r\n", |
1299 | boolopt[global_settings.invert_cursor]); | 1310 | boolopt[global_settings.invert_cursor]); |
1300 | 1311 | ||
@@ -1446,6 +1457,7 @@ void settings_reset(void) { | |||
1446 | global_settings.resume = RESUME_ASK; | 1457 | global_settings.resume = RESUME_ASK; |
1447 | global_settings.contrast = lcd_default_contrast(); | 1458 | global_settings.contrast = lcd_default_contrast(); |
1448 | global_settings.invert = DEFAULT_INVERT_SETTING; | 1459 | global_settings.invert = DEFAULT_INVERT_SETTING; |
1460 | global_settings.flip_display= false; | ||
1449 | global_settings.poweroff = DEFAULT_POWEROFF_SETTING; | 1461 | global_settings.poweroff = DEFAULT_POWEROFF_SETTING; |
1450 | global_settings.backlight_timeout = DEFAULT_BACKLIGHT_TIMEOUT_SETTING; | 1462 | global_settings.backlight_timeout = DEFAULT_BACKLIGHT_TIMEOUT_SETTING; |
1451 | global_settings.invert_cursor = DEFAULT_INVERT_CURSOR_SETTING; | 1463 | global_settings.invert_cursor = DEFAULT_INVERT_CURSOR_SETTING; |
diff --git a/apps/settings.h b/apps/settings.h index b96f4c6410..074be0690a 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -92,6 +92,7 @@ struct user_settings | |||
92 | bool invert; /* invert display */ | 92 | bool invert; /* invert display */ |
93 | bool invert_cursor; /* invert the current file in dir browser and menu | 93 | bool invert_cursor; /* invert the current file in dir browser and menu |
94 | instead of using the default cursor */ | 94 | instead of using the default cursor */ |
95 | bool flip_display; /* turn display (and button layout) by 180 degrees */ | ||
95 | int poweroff; /* power off timer */ | 96 | int poweroff; /* power off timer */ |
96 | int backlight_timeout; /* backlight off timeout: 0-18 0=never, | 97 | int backlight_timeout; /* backlight off timeout: 0-18 0=never, |
97 | 1=always, | 98 | 1=always, |
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index c26aa125a2..c3932f3264 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -107,6 +107,20 @@ static bool invert_cursor(void) | |||
107 | } | 107 | } |
108 | 108 | ||
109 | /** | 109 | /** |
110 | * Menu to turn the display+buttons by 180 degrees | ||
111 | */ | ||
112 | static bool flip_display(void) | ||
113 | { | ||
114 | bool rc = set_bool( str(LANG_FLIP_DISPLAY), | ||
115 | &global_settings.flip_display); | ||
116 | |||
117 | button_set_flip(global_settings.flip_display); | ||
118 | lcd_set_flip(global_settings.flip_display); | ||
119 | |||
120 | return rc; | ||
121 | } | ||
122 | |||
123 | /** | ||
110 | * Menu to configure the battery display on status bar | 124 | * Menu to configure the battery display on status bar |
111 | */ | 125 | */ |
112 | static bool battery_type(void) | 126 | static bool battery_type(void) |
@@ -362,7 +376,7 @@ static bool peak_meter_menu(void) | |||
362 | { str(LANG_PM_MAX) , peak_meter_max }, | 376 | { str(LANG_PM_MAX) , peak_meter_max }, |
363 | }; | 377 | }; |
364 | 378 | ||
365 | m=menu_init( items, sizeof items / sizeof(struct menu_items) ); | 379 | m=menu_init( items, sizeof(items) / sizeof(*items) ); |
366 | result = menu_run(m); | 380 | result = menu_run(m); |
367 | menu_exit(m); | 381 | menu_exit(m); |
368 | return result; | 382 | return result; |
@@ -757,7 +771,7 @@ static bool playback_settings_menu(void) | |||
757 | 771 | ||
758 | bool old_shuffle = global_settings.playlist_shuffle; | 772 | bool old_shuffle = global_settings.playlist_shuffle; |
759 | 773 | ||
760 | m=menu_init( items, sizeof items / sizeof(struct menu_items) ); | 774 | m=menu_init( items, sizeof(items) / sizeof(*items) ); |
761 | result = menu_run(m); | 775 | result = menu_run(m); |
762 | menu_exit(m); | 776 | menu_exit(m); |
763 | 777 | ||
@@ -836,7 +850,7 @@ static bool fileview_settings_menu(void) | |||
836 | { str(LANG_FOLLOW), browse_current }, | 850 | { str(LANG_FOLLOW), browse_current }, |
837 | }; | 851 | }; |
838 | 852 | ||
839 | m = menu_init( items, sizeof items / sizeof(struct menu_items) ); | 853 | m=menu_init( items, sizeof(items) / sizeof(*items) ); |
840 | result = menu_run(m); | 854 | result = menu_run(m); |
841 | menu_exit(m); | 855 | menu_exit(m); |
842 | return result; | 856 | return result; |
@@ -861,7 +875,7 @@ static bool scroll_settings_menu(void) | |||
861 | #endif | 875 | #endif |
862 | }; | 876 | }; |
863 | 877 | ||
864 | m = menu_init( items, sizeof items / sizeof(struct menu_items) ); | 878 | m=menu_init( items, sizeof(items) / sizeof(*items) ); |
865 | result = menu_run(m); | 879 | result = menu_run(m); |
866 | menu_exit(m); | 880 | menu_exit(m); |
867 | return result; | 881 | return result; |
@@ -884,6 +898,7 @@ static bool display_settings_menu(void) | |||
884 | { str(LANG_STATUS_BAR), status_bar }, | 898 | { str(LANG_STATUS_BAR), status_bar }, |
885 | { str(LANG_INVERT), invert }, | 899 | { str(LANG_INVERT), invert }, |
886 | { str(LANG_INVERT_CURSOR), invert_cursor }, | 900 | { str(LANG_INVERT_CURSOR), invert_cursor }, |
901 | { str(LANG_FLIP_DISPLAY), flip_display }, | ||
887 | { str(LANG_PM_MENU), peak_meter_menu }, | 902 | { str(LANG_PM_MENU), peak_meter_menu }, |
888 | { str(LANG_VOLUME_DISPLAY), volume_type }, | 903 | { str(LANG_VOLUME_DISPLAY), volume_type }, |
889 | { str(LANG_BATTERY_DISPLAY), battery_type }, | 904 | { str(LANG_BATTERY_DISPLAY), battery_type }, |
@@ -892,7 +907,7 @@ static bool display_settings_menu(void) | |||
892 | { str(LANG_CAPTION_BACKLIGHT), caption_backlight }, | 907 | { str(LANG_CAPTION_BACKLIGHT), caption_backlight }, |
893 | }; | 908 | }; |
894 | 909 | ||
895 | m=menu_init( items, sizeof items / sizeof(struct menu_items) ); | 910 | m=menu_init( items, sizeof(items) / sizeof(*items) ); |
896 | result = menu_run(m); | 911 | result = menu_run(m); |
897 | menu_exit(m); | 912 | menu_exit(m); |
898 | return result; | 913 | return result; |
@@ -929,7 +944,7 @@ static bool system_settings_menu(void) | |||
929 | { str(LANG_RESET), reset_settings }, | 944 | { str(LANG_RESET), reset_settings }, |
930 | }; | 945 | }; |
931 | 946 | ||
932 | m=menu_init( items, sizeof items / sizeof(struct menu_items) ); | 947 | m=menu_init( items, sizeof(items) / sizeof(*items) ); |
933 | result = menu_run(m); | 948 | result = menu_run(m); |
934 | menu_exit(m); | 949 | menu_exit(m); |
935 | return result; | 950 | return result; |
@@ -954,7 +969,7 @@ bool settings_menu(void) | |||
954 | { str(LANG_SAVE_SETTINGS), settings_save_config }, | 969 | { str(LANG_SAVE_SETTINGS), settings_save_config }, |
955 | }; | 970 | }; |
956 | 971 | ||
957 | m = menu_init( items, sizeof items / sizeof(struct menu_items) ); | 972 | m=menu_init( items, sizeof(items) / sizeof(*items) ); |
958 | result = menu_run(m); | 973 | result = menu_run(m); |
959 | menu_exit(m); | 974 | menu_exit(m); |
960 | return result; | 975 | return result; |