diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings.c | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/apps/settings.c b/apps/settings.c index 47b4959521..54f6eaf240 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -370,7 +370,7 @@ static const struct bit_entry hd_bits[] = | |||
370 | {4, S_O(scroll_speed), 9, "scroll speed", NULL }, /* 0...15 */ | 370 | {4, S_O(scroll_speed), 9, "scroll speed", NULL }, /* 0...15 */ |
371 | {8, S_O(scroll_delay), 100, "scroll delay", NULL }, /* 0...250 */ | 371 | {8, S_O(scroll_delay), 100, "scroll delay", NULL }, /* 0...250 */ |
372 | {8, S_O(bidir_limit), 50, "bidir limit", NULL }, /* 0...200 */ | 372 | {8, S_O(bidir_limit), 50, "bidir limit", NULL }, /* 0...200 */ |
373 | 373 | ||
374 | #ifdef HAVE_REMOTE_LCD | 374 | #ifdef HAVE_REMOTE_LCD |
375 | {4, S_O(remote_scroll_speed), 9, "remote scroll speed", NULL }, /* 0...15 */ | 375 | {4, S_O(remote_scroll_speed), 9, "remote scroll speed", NULL }, /* 0...15 */ |
376 | {8, S_O(remote_scroll_step), 6, "remote scroll step", NULL }, /* 1...160 */ | 376 | {8, S_O(remote_scroll_step), 6, "remote scroll step", NULL }, /* 1...160 */ |
@@ -426,7 +426,7 @@ static const struct bit_entry hd_bits[] = | |||
426 | {3, S_O(dirfilter), SHOW_SUPPORTED, | 426 | {3, S_O(dirfilter), SHOW_SUPPORTED, |
427 | "show files", "all,supported,music,playlists" | 427 | "show files", "all,supported,music,playlists" |
428 | #ifdef HAVE_TAGCACHE | 428 | #ifdef HAVE_TAGCACHE |
429 | ",id3 database" | 429 | ",id3 database" |
430 | #endif | 430 | #endif |
431 | }, | 431 | }, |
432 | {1, S_O(sort_case), false, "sort case", off_on }, | 432 | {1, S_O(sort_case), false, "sort case", off_on }, |
@@ -508,7 +508,7 @@ static const struct bit_entry hd_bits[] = | |||
508 | "rec directory", REC_BASE_DIR ",current" }, | 508 | "rec directory", REC_BASE_DIR ",current" }, |
509 | #ifdef CONFIG_BACKLIGHT | 509 | #ifdef CONFIG_BACKLIGHT |
510 | {2, S_O(cliplight), 0, "cliplight", "off,main,both,remote" }, | 510 | {2, S_O(cliplight), 0, "cliplight", "off,main,both,remote" }, |
511 | #endif | 511 | #endif |
512 | #if CONFIG_CODEC == MAS3587F | 512 | #if CONFIG_CODEC == MAS3587F |
513 | {4, S_O(rec_mic_gain), 8, "rec mic gain", NULL }, | 513 | {4, S_O(rec_mic_gain), 8, "rec mic gain", NULL }, |
514 | {4, S_O(rec_left_gain), 2 /* 0dB */, "rec left gain", NULL }, /* 0...15 */ | 514 | {4, S_O(rec_left_gain), 2 /* 0dB */, "rec left gain", NULL }, /* 0...15 */ |
@@ -653,7 +653,7 @@ static const struct bit_entry hd_bits[] = | |||
653 | 653 | ||
654 | #ifdef HAVE_WM8758 | 654 | #ifdef HAVE_WM8758 |
655 | {1, S_O(eq_hw_enabled), false, "eq hardware enabled", off_on }, | 655 | {1, S_O(eq_hw_enabled), false, "eq hardware enabled", off_on }, |
656 | 656 | ||
657 | {2, S_O(eq_hw_band0_cutoff), 1, "eq hardware band 0 cutoff", "80Hz,105Hz,135Hz,175Hz" }, | 657 | {2, S_O(eq_hw_band0_cutoff), 1, "eq hardware band 0 cutoff", "80Hz,105Hz,135Hz,175Hz" }, |
658 | {5|SIGNED, S_O(eq_hw_band0_gain), 0, "eq hardware band 0 gain", NULL }, | 658 | {5|SIGNED, S_O(eq_hw_band0_gain), 0, "eq hardware band 0 gain", NULL }, |
659 | 659 | ||
@@ -1207,7 +1207,8 @@ void settings_apply(void) | |||
1207 | lcd_set_invert_display(global_settings.invert); | 1207 | lcd_set_invert_display(global_settings.invert); |
1208 | lcd_set_flip(global_settings.flip_display); | 1208 | lcd_set_flip(global_settings.flip_display); |
1209 | button_set_flip(global_settings.flip_display); | 1209 | button_set_flip(global_settings.flip_display); |
1210 | lcd_update(); /* refresh after flipping the screen */ | 1210 | if(global_settings.invert || global_settings.flip_display) |
1211 | lcd_update(); /* refresh after flipping the screen */ | ||
1211 | settings_apply_pm_range(); | 1212 | settings_apply_pm_range(); |
1212 | peak_meter_init_times( | 1213 | peak_meter_init_times( |
1213 | global_settings.peak_meter_release, global_settings.peak_meter_hold, | 1214 | global_settings.peak_meter_release, global_settings.peak_meter_hold, |
@@ -1237,9 +1238,13 @@ void settings_apply(void) | |||
1237 | } else { | 1238 | } else { |
1238 | unload_main_backdrop(); | 1239 | unload_main_backdrop(); |
1239 | } | 1240 | } |
1241 | /* Gigabeat displays a bootsplash - keep it up as long as we can */ | ||
1242 | #if !defined(TOSHIBA_GIGABEAT_F) || defined(SIMULATOR) | ||
1240 | show_main_backdrop(); | 1243 | show_main_backdrop(); |
1241 | #endif | 1244 | #endif |
1242 | 1245 | ||
1246 | #endif | ||
1247 | |||
1243 | #ifdef HAVE_LCD_COLOR | 1248 | #ifdef HAVE_LCD_COLOR |
1244 | screens[SCREEN_MAIN].set_foreground(global_settings.fg_color); | 1249 | screens[SCREEN_MAIN].set_foreground(global_settings.fg_color); |
1245 | screens[SCREEN_MAIN].set_background(global_settings.bg_color); | 1250 | screens[SCREEN_MAIN].set_background(global_settings.bg_color); |
@@ -1900,7 +1905,7 @@ void settings_reset(void) { | |||
1900 | global_settings.mdb_enable = sound_default(SOUND_MDB_ENABLE); | 1905 | global_settings.mdb_enable = sound_default(SOUND_MDB_ENABLE); |
1901 | global_settings.superbass = sound_default(SOUND_SUPERBASS); | 1906 | global_settings.superbass = sound_default(SOUND_SUPERBASS); |
1902 | #endif | 1907 | #endif |
1903 | #ifdef HAVE_LCD_CONTRAST | 1908 | #ifdef HAVE_LCD_CONTRAST |
1904 | global_settings.contrast = lcd_default_contrast(); | 1909 | global_settings.contrast = lcd_default_contrast(); |
1905 | #endif | 1910 | #endif |
1906 | #ifdef HAVE_LCD_REMOTE | 1911 | #ifdef HAVE_LCD_REMOTE |
@@ -1994,12 +1999,12 @@ struct value_setting_data { | |||
1994 | void (*formatter)(char* dest, int dest_length, | 1999 | void (*formatter)(char* dest, int dest_length, |
1995 | int variable, const char* unit); | 2000 | int variable, const char* unit); |
1996 | /* used for BOOL and "choice" settings */ | 2001 | /* used for BOOL and "choice" settings */ |
1997 | struct opt_items* options; | 2002 | struct opt_items* options; |
1998 | }; | 2003 | }; |
1999 | 2004 | ||
2000 | static char * value_setting_get_name_cb(int selected_item,void * data, char *buffer) | 2005 | static char * value_setting_get_name_cb(int selected_item,void * data, char *buffer) |
2001 | { | 2006 | { |
2002 | struct value_setting_data* cb_data = | 2007 | struct value_setting_data* cb_data = |
2003 | (struct value_setting_data*)data; | 2008 | (struct value_setting_data*)data; |
2004 | if (cb_data->type == INT && !cb_data->options) | 2009 | if (cb_data->type == INT && !cb_data->options) |
2005 | { | 2010 | { |
@@ -2011,7 +2016,7 @@ static char * value_setting_get_name_cb(int selected_item,void * data, char *buf | |||
2011 | } | 2016 | } |
2012 | else strcpy(buffer,P2STR(cb_data->options[selected_item].string)); | 2017 | else strcpy(buffer,P2STR(cb_data->options[selected_item].string)); |
2013 | return buffer; | 2018 | return buffer; |
2014 | } | 2019 | } |
2015 | #define type_fromvoidptr(type, value) \ | 2020 | #define type_fromvoidptr(type, value) \ |
2016 | (type == INT)? \ | 2021 | (type == INT)? \ |
2017 | (int)(*(int*)(value)) \ | 2022 | (int)(*(int*)(value)) \ |
@@ -2027,7 +2032,7 @@ static bool do_set_setting(const unsigned char* string, void *variable, | |||
2027 | struct gui_synclist lists; | 2032 | struct gui_synclist lists; |
2028 | int oldvalue; | 2033 | int oldvalue; |
2029 | bool allow_wrap = true; | 2034 | bool allow_wrap = true; |
2030 | 2035 | ||
2031 | if (cb_data->type == INT) | 2036 | if (cb_data->type == INT) |
2032 | { | 2037 | { |
2033 | oldvalue = *(int*)variable; | 2038 | oldvalue = *(int*)variable; |
@@ -2035,26 +2040,26 @@ static bool do_set_setting(const unsigned char* string, void *variable, | |||
2035 | allow_wrap = false; | 2040 | allow_wrap = false; |
2036 | } | 2041 | } |
2037 | else oldvalue = *(bool*)variable; | 2042 | else oldvalue = *(bool*)variable; |
2038 | 2043 | ||
2039 | gui_synclist_init(&lists,value_setting_get_name_cb,(void*)cb_data,false,1); | 2044 | gui_synclist_init(&lists,value_setting_get_name_cb,(void*)cb_data,false,1); |
2040 | gui_synclist_set_title(&lists, (char*)string, NOICON); | 2045 | gui_synclist_set_title(&lists, (char*)string, NOICON); |
2041 | gui_synclist_set_icon_callback(&lists,NULL); | 2046 | gui_synclist_set_icon_callback(&lists,NULL); |
2042 | gui_synclist_set_nb_items(&lists,nb_items); | 2047 | gui_synclist_set_nb_items(&lists,nb_items); |
2043 | gui_synclist_limit_scroll(&lists,true); | 2048 | gui_synclist_limit_scroll(&lists,true); |
2044 | gui_synclist_select_item(&lists, selected); | 2049 | gui_synclist_select_item(&lists, selected); |
2045 | 2050 | ||
2046 | if (global_settings.talk_menu) | 2051 | if (global_settings.talk_menu) |
2047 | { | 2052 | { |
2048 | if (cb_data->type == INT && !cb_data->options) | 2053 | if (cb_data->type == INT && !cb_data->options) |
2049 | talk_unit(cb_data->voice_unit, *(int*)variable); | 2054 | talk_unit(cb_data->voice_unit, *(int*)variable); |
2050 | else talk_id(cb_data->options[selected].voice_id, false); | 2055 | else talk_id(cb_data->options[selected].voice_id, false); |
2051 | } | 2056 | } |
2052 | 2057 | ||
2053 | gui_synclist_draw(&lists); | 2058 | gui_synclist_draw(&lists); |
2054 | while (!done) | 2059 | while (!done) |
2055 | { | 2060 | { |
2056 | 2061 | ||
2057 | action = get_action(CONTEXT_LIST,TIMEOUT_BLOCK); | 2062 | action = get_action(CONTEXT_LIST,TIMEOUT_BLOCK); |
2058 | if (action == ACTION_NONE) | 2063 | if (action == ACTION_NONE) |
2059 | continue; | 2064 | continue; |
2060 | if (gui_synclist_do_button(&lists,action, | 2065 | if (gui_synclist_do_button(&lists,action, |
@@ -2065,23 +2070,23 @@ static bool do_set_setting(const unsigned char* string, void *variable, | |||
2065 | int value; | 2070 | int value; |
2066 | if (cb_data->type == INT && !cb_data->options) | 2071 | if (cb_data->type == INT && !cb_data->options) |
2067 | { | 2072 | { |
2068 | value = cb_data->max - | 2073 | value = cb_data->max - |
2069 | gui_synclist_get_sel_pos(&lists)*cb_data->step; | 2074 | gui_synclist_get_sel_pos(&lists)*cb_data->step; |
2070 | talk_unit(cb_data->voice_unit, value); | 2075 | talk_unit(cb_data->voice_unit, value); |
2071 | } | 2076 | } |
2072 | else | 2077 | else |
2073 | { | 2078 | { |
2074 | value = gui_synclist_get_sel_pos(&lists); | 2079 | value = gui_synclist_get_sel_pos(&lists); |
2075 | talk_id(cb_data->options[value].voice_id, false); | 2080 | talk_id(cb_data->options[value].voice_id, false); |
2076 | } | 2081 | } |
2077 | } | 2082 | } |
2078 | if (cb_data->type == INT && !cb_data->options) | 2083 | if (cb_data->type == INT && !cb_data->options) |
2079 | *(int*)variable = cb_data->max - | 2084 | *(int*)variable = cb_data->max - |
2080 | gui_synclist_get_sel_pos(&lists)*cb_data->step; | 2085 | gui_synclist_get_sel_pos(&lists)*cb_data->step; |
2081 | else if (cb_data->type == BOOL) | 2086 | else if (cb_data->type == BOOL) |
2082 | *(bool*)variable = gui_synclist_get_sel_pos(&lists) ? true : false; | 2087 | *(bool*)variable = gui_synclist_get_sel_pos(&lists) ? true : false; |
2083 | else *(int*)variable = gui_synclist_get_sel_pos(&lists); | 2088 | else *(int*)variable = gui_synclist_get_sel_pos(&lists); |
2084 | } | 2089 | } |
2085 | else if (action == ACTION_STD_CANCEL) | 2090 | else if (action == ACTION_STD_CANCEL) |
2086 | { | 2091 | { |
2087 | gui_syncsplash(HZ/2,true,str(LANG_MENU_SETTING_CANCEL)); | 2092 | gui_syncsplash(HZ/2,true,str(LANG_MENU_SETTING_CANCEL)); |
@@ -2140,7 +2145,7 @@ bool set_int(const unsigned char* string, | |||
2140 | 2145 | ||
2141 | The type separation is necessary since int and bool are fundamentally | 2146 | The type separation is necessary since int and bool are fundamentally |
2142 | different and bit-incompatible types and can not share the same access | 2147 | different and bit-incompatible types and can not share the same access |
2143 | code. */ | 2148 | code. */ |
2144 | bool set_option(const char* string, void* variable, enum optiontype type, | 2149 | bool set_option(const char* string, void* variable, enum optiontype type, |
2145 | const struct opt_items* options, int numoptions, void (*function)(int)) | 2150 | const struct opt_items* options, int numoptions, void (*function)(int)) |
2146 | { | 2151 | { |