From ea664e06476cb572bab2eadbb9c060902a95a34a Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Sat, 3 May 2008 12:30:40 +0000 Subject: Viewported quickscreen (take 2 :D) (FS#8553) - no customization support - no top item - much better use of the screen - deprecates 20 odd lang strings (the QS can now use the regular lang strings and user font) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17315 a1c6a512-1295-4272-9138-f99709370657 --- apps/screens.c | 152 --------------------------------------------------------- 1 file changed, 152 deletions(-) (limited to 'apps/screens.c') diff --git a/apps/screens.c b/apps/screens.c index 0855b12002..f9dd49b995 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -633,158 +633,6 @@ bool pitch_screen(void) } #endif /* HAVE_PITCHSCREEN */ -#ifdef HAVE_QUICKSCREEN - -#define bool_to_int(b)\ - b?1:0 -#define int_to_bool(i)\ - i==0?false:true - -static void quick_screen_quick_apply(struct gui_quickscreen *qs) -{ - global_settings.playlist_shuffle=int_to_bool(qs->left_option->option); - global_settings.dirfilter=qs->bottom_option->option; - global_settings.repeat_mode=qs->right_option->option; -} - -bool quick_screen_quick(int button_enter) -{ - bool res, oldshuffle; - struct option_select left_option; - struct option_select bottom_option; - struct option_select right_option; - int oldrepeat, old_x_margin, old_y_margin; - - static const struct opt_items left_items[] = { - [0]={ STR(LANG_SYSFONT_OFF) }, - [1]={ STR(LANG_SYSFONT_ON) } - }; - static const struct opt_items bottom_items[] = { - [SHOW_ALL]={ STR(LANG_SYSFONT_ALL) }, - [SHOW_SUPPORTED]={ STR(LANG_SYSFONT_FILTER_SUPPORTED) }, - [SHOW_MUSIC]={ STR(LANG_SYSFONT_FILTER_MUSIC) }, - [SHOW_PLAYLIST]={ STR(LANG_SYSFONT_FILTER_PLAYLIST) }, - }; - static const struct opt_items right_items[] = { - [REPEAT_OFF]={ STR(LANG_SYSFONT_OFF) }, - [REPEAT_ALL]={ STR(LANG_SYSFONT_ALL) }, - [REPEAT_ONE]={ STR(LANG_SYSFONT_REPEAT_ONE) }, - [REPEAT_SHUFFLE]={ STR(LANG_SYSFONT_SHUFFLE) }, -#ifdef AB_REPEAT_ENABLE - [REPEAT_AB]={ STR(LANG_SYSFONT_REPEAT_AB) } -#endif - }; - struct gui_quickscreen qs; - - old_x_margin = lcd_getxmargin(); - old_y_margin = lcd_getymargin(); - lcd_setmargins(0, 0); - - option_select_init_items(&left_option, - (char *)str(LANG_SYSFONT_SHUFFLE), - bool_to_int(global_settings.playlist_shuffle), - left_items, - 2); - option_select_init_items(&bottom_option, - (char *)str(LANG_SYSFONT_FILTER), - global_settings.dirfilter, - bottom_items, - sizeof(bottom_items)/sizeof(struct opt_items)); - option_select_init_items(&right_option, - (char *)str(LANG_SYSFONT_REPEAT), - global_settings.repeat_mode, - right_items, - sizeof(right_items)/sizeof(struct opt_items)); - - gui_quickscreen_init(&qs, &left_option, &bottom_option, &right_option, - &quick_screen_quick_apply); - oldrepeat=global_settings.repeat_mode; - oldshuffle=global_settings.playlist_shuffle; - res=gui_syncquickscreen_run(&qs, button_enter); - if(!res) - { - if ( oldrepeat != global_settings.repeat_mode && - (audio_status() & AUDIO_STATUS_PLAY) ) - audio_flush_and_reload_tracks(); - if(oldshuffle != global_settings.playlist_shuffle - && audio_status() & AUDIO_STATUS_PLAY) - { -#if CONFIG_CODEC == SWCODEC - dsp_set_replaygain(); -#endif - if (global_settings.playlist_shuffle) - playlist_randomise(NULL, current_tick, true); - else - playlist_sort(NULL, true); - } - settings_save(); - } - lcd_setmargins(old_x_margin, old_y_margin); - return(res); -} - -#ifdef BUTTON_F3 -static void quick_screen_f3_apply(struct gui_quickscreen *qs) -{ - global_settings.scrollbar=int_to_bool(qs->left_option->option); - - global_settings.flip_display=int_to_bool(qs->bottom_option->option); - button_set_flip(global_settings.flip_display); - lcd_set_flip(global_settings.flip_display); - - global_settings.statusbar=int_to_bool(qs->right_option->option); - gui_syncstatusbar_draw(&statusbars, true); -} - -bool quick_screen_f3(int button_enter) -{ - bool res; - struct option_select left_option; - struct option_select bottom_option; - struct option_select right_option; - int old_x_margin, old_y_margin; - - static const struct opt_items onoff_items[] = { - [0]={ STR(LANG_SYSFONT_OFF) }, - [1]={ STR(LANG_SYSFONT_ON) } - }; - static const struct opt_items yesno_items[] = { - [0]={ STR(LANG_SYSFONT_SET_BOOL_NO) }, - [1]={ STR(LANG_SYSFONT_SET_BOOL_YES) } - }; - - struct gui_quickscreen qs; - - old_x_margin = lcd_getxmargin(); - old_y_margin = lcd_getymargin(); - lcd_setmargins(0, 0); - - option_select_init_items(&left_option, - str(LANG_SYSFONT_SCROLL_BAR), - bool_to_int(global_settings.scrollbar), - onoff_items, - 2); - option_select_init_items(&bottom_option, - str(LANG_SYSFONT_FLIP_DISPLAY), - bool_to_int(global_settings.flip_display), - yesno_items, - 2); - option_select_init_items(&right_option, - str(LANG_SYSFONT_STATUS_BAR), - bool_to_int(global_settings.statusbar), - onoff_items, - 2); - gui_quickscreen_init(&qs, &left_option, &bottom_option, &right_option, - &quick_screen_f3_apply); - res=gui_syncquickscreen_run(&qs, button_enter); - if(!res) - settings_save(); - lcd_setmargins(old_x_margin, old_y_margin); - return(res); -} -#endif /* BUTTON_F3 */ -#endif /* CONFIG_KEYPAD in (RECORDER_PAD |IRIVER_H100_PAD | IRIVER_H300_PAD) */ - #if CONFIG_CHARGING void charging_splash(void) { -- cgit v1.2.3