summaryrefslogtreecommitdiff
path: root/apps/screens.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/screens.c')
-rw-r--r--apps/screens.c152
1 files changed, 0 insertions, 152 deletions
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)
633} 633}
634#endif /* HAVE_PITCHSCREEN */ 634#endif /* HAVE_PITCHSCREEN */
635 635
636#ifdef HAVE_QUICKSCREEN
637
638#define bool_to_int(b)\
639 b?1:0
640#define int_to_bool(i)\
641 i==0?false:true
642
643static void quick_screen_quick_apply(struct gui_quickscreen *qs)
644{
645 global_settings.playlist_shuffle=int_to_bool(qs->left_option->option);
646 global_settings.dirfilter=qs->bottom_option->option;
647 global_settings.repeat_mode=qs->right_option->option;
648}
649
650bool quick_screen_quick(int button_enter)
651{
652 bool res, oldshuffle;
653 struct option_select left_option;
654 struct option_select bottom_option;
655 struct option_select right_option;
656 int oldrepeat, old_x_margin, old_y_margin;
657
658 static const struct opt_items left_items[] = {
659 [0]={ STR(LANG_SYSFONT_OFF) },
660 [1]={ STR(LANG_SYSFONT_ON) }
661 };
662 static const struct opt_items bottom_items[] = {
663 [SHOW_ALL]={ STR(LANG_SYSFONT_ALL) },
664 [SHOW_SUPPORTED]={ STR(LANG_SYSFONT_FILTER_SUPPORTED) },
665 [SHOW_MUSIC]={ STR(LANG_SYSFONT_FILTER_MUSIC) },
666 [SHOW_PLAYLIST]={ STR(LANG_SYSFONT_FILTER_PLAYLIST) },
667 };
668 static const struct opt_items right_items[] = {
669 [REPEAT_OFF]={ STR(LANG_SYSFONT_OFF) },
670 [REPEAT_ALL]={ STR(LANG_SYSFONT_ALL) },
671 [REPEAT_ONE]={ STR(LANG_SYSFONT_REPEAT_ONE) },
672 [REPEAT_SHUFFLE]={ STR(LANG_SYSFONT_SHUFFLE) },
673#ifdef AB_REPEAT_ENABLE
674 [REPEAT_AB]={ STR(LANG_SYSFONT_REPEAT_AB) }
675#endif
676 };
677 struct gui_quickscreen qs;
678
679 old_x_margin = lcd_getxmargin();
680 old_y_margin = lcd_getymargin();
681 lcd_setmargins(0, 0);
682
683 option_select_init_items(&left_option,
684 (char *)str(LANG_SYSFONT_SHUFFLE),
685 bool_to_int(global_settings.playlist_shuffle),
686 left_items,
687 2);
688 option_select_init_items(&bottom_option,
689 (char *)str(LANG_SYSFONT_FILTER),
690 global_settings.dirfilter,
691 bottom_items,
692 sizeof(bottom_items)/sizeof(struct opt_items));
693 option_select_init_items(&right_option,
694 (char *)str(LANG_SYSFONT_REPEAT),
695 global_settings.repeat_mode,
696 right_items,
697 sizeof(right_items)/sizeof(struct opt_items));
698
699 gui_quickscreen_init(&qs, &left_option, &bottom_option, &right_option,
700 &quick_screen_quick_apply);
701 oldrepeat=global_settings.repeat_mode;
702 oldshuffle=global_settings.playlist_shuffle;
703 res=gui_syncquickscreen_run(&qs, button_enter);
704 if(!res)
705 {
706 if ( oldrepeat != global_settings.repeat_mode &&
707 (audio_status() & AUDIO_STATUS_PLAY) )
708 audio_flush_and_reload_tracks();
709 if(oldshuffle != global_settings.playlist_shuffle
710 && audio_status() & AUDIO_STATUS_PLAY)
711 {
712#if CONFIG_CODEC == SWCODEC
713 dsp_set_replaygain();
714#endif
715 if (global_settings.playlist_shuffle)
716 playlist_randomise(NULL, current_tick, true);
717 else
718 playlist_sort(NULL, true);
719 }
720 settings_save();
721 }
722 lcd_setmargins(old_x_margin, old_y_margin);
723 return(res);
724}
725
726#ifdef BUTTON_F3
727static void quick_screen_f3_apply(struct gui_quickscreen *qs)
728{
729 global_settings.scrollbar=int_to_bool(qs->left_option->option);
730
731 global_settings.flip_display=int_to_bool(qs->bottom_option->option);
732 button_set_flip(global_settings.flip_display);
733 lcd_set_flip(global_settings.flip_display);
734
735 global_settings.statusbar=int_to_bool(qs->right_option->option);
736 gui_syncstatusbar_draw(&statusbars, true);
737}
738
739bool quick_screen_f3(int button_enter)
740{
741 bool res;
742 struct option_select left_option;
743 struct option_select bottom_option;
744 struct option_select right_option;
745 int old_x_margin, old_y_margin;
746
747 static const struct opt_items onoff_items[] = {
748 [0]={ STR(LANG_SYSFONT_OFF) },
749 [1]={ STR(LANG_SYSFONT_ON) }
750 };
751 static const struct opt_items yesno_items[] = {
752 [0]={ STR(LANG_SYSFONT_SET_BOOL_NO) },
753 [1]={ STR(LANG_SYSFONT_SET_BOOL_YES) }
754 };
755
756 struct gui_quickscreen qs;
757
758 old_x_margin = lcd_getxmargin();
759 old_y_margin = lcd_getymargin();
760 lcd_setmargins(0, 0);
761
762 option_select_init_items(&left_option,
763 str(LANG_SYSFONT_SCROLL_BAR),
764 bool_to_int(global_settings.scrollbar),
765 onoff_items,
766 2);
767 option_select_init_items(&bottom_option,
768 str(LANG_SYSFONT_FLIP_DISPLAY),
769 bool_to_int(global_settings.flip_display),
770 yesno_items,
771 2);
772 option_select_init_items(&right_option,
773 str(LANG_SYSFONT_STATUS_BAR),
774 bool_to_int(global_settings.statusbar),
775 onoff_items,
776 2);
777 gui_quickscreen_init(&qs, &left_option, &bottom_option, &right_option,
778 &quick_screen_f3_apply);
779 res=gui_syncquickscreen_run(&qs, button_enter);
780 if(!res)
781 settings_save();
782 lcd_setmargins(old_x_margin, old_y_margin);
783 return(res);
784}
785#endif /* BUTTON_F3 */
786#endif /* CONFIG_KEYPAD in (RECORDER_PAD |IRIVER_H100_PAD | IRIVER_H300_PAD) */
787
788#if CONFIG_CHARGING 636#if CONFIG_CHARGING
789void charging_splash(void) 637void charging_splash(void)
790{ 638{