Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

wps.c cleanup gui_show_wps

remove some old cruft move a few things around clean-up flow

Change-Id: I138c6cd9e2d58ef526eb686333da413819df725d

+248 -237
+2 -2
apps/bookmark.c
··· 1122 1122 } 1123 1123 } 1124 1124 1125 - pop_current_activity(ACTIVITY_REFRESH_NOW); 1125 + pop_current_activity(); 1126 1126 return ret; 1127 1127 } 1128 1128 ··· 1143 1143 ret = play_bookmark(bookmark); 1144 1144 } 1145 1145 1146 - pop_current_activity(ACTIVITY_REFRESH_NOW); 1146 + pop_current_activity(); 1147 1147 return ret; 1148 1148 } 1149 1149
+1 -1
apps/gui/option_select.c
··· 574 574 if (function == sound_get_fn(SOUND_VOLUME)) 575 575 global_status.last_volume_change = current_tick; 576 576 } 577 - pop_current_activity(ACTIVITY_REFRESH_NOW); 577 + pop_current_activity(); 578 578 return false; 579 579 } 580 580
+2 -2
apps/gui/quickscreen.c
··· 410 410 } 411 411 412 412 if (ret & QUICKSCREEN_GOTO_SHORTCUTS_MENU) /* Eliminate flashing of parent during */ 413 - pop_current_activity(ACTIVITY_REFRESH_DEFERRED); /* transition to Shortcuts */ 413 + pop_current_activity_without_refresh(); /* transition to Shortcuts */ 414 414 else 415 - pop_current_activity(ACTIVITY_REFRESH_NOW); 415 + pop_current_activity(); 416 416 417 417 return ret; 418 418 }
+1 -1
apps/gui/usb_screen.c
··· 315 315 viewportmanager_theme_undo(i, false); 316 316 } 317 317 318 - pop_current_activity(ACTIVITY_REFRESH_NOW); 318 + pop_current_activity(); 319 319 }
+172 -182
apps/gui/wps.c
··· 65 65 #include "skin_engine/wps_internals.h" 66 66 #include "open_plugin.h" 67 67 68 - #define RESTORE_WPS_INSTANTLY 0l 69 - #define RESTORE_WPS_NEXT_SECOND ((long)(HZ+current_tick)) 70 - 71 68 #define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */ 72 69 /* 3% of 30min file == 54s step size */ 73 70 #define MIN_FF_REWIND_STEP 500 ··· 147 144 if (updatewps) 148 145 update_non_static(); 149 146 } 150 - 151 - static bool update_onvol_change(enum screen_type screen) 152 - { 153 - skin_update(WPS, screen, SKIN_REFRESH_NON_STATIC); 154 - 155 - return false; 156 - } 157 - 158 147 159 148 #ifdef HAVE_TOUCHSCREEN 160 149 static int skintouch_to_wps(void) ··· 340 329 return usb; 341 330 } 342 331 343 - #if defined(HAVE_BACKLIGHT) || defined(HAVE_REMOTE_LCD) 344 332 static void gwps_caption_backlight(struct wps_state *state) 345 333 { 334 + #if defined(HAVE_BACKLIGHT) || defined(HAVE_REMOTE_LCD) 346 335 if (state->id3) 347 336 { 348 337 #ifdef HAVE_BACKLIGHT ··· 379 368 } 380 369 #endif 381 370 } 371 + #else 372 + (void) state; 373 + #endif /* def HAVE_BACKLIGHT || def HAVE_REMOTE_LCD */ 382 374 } 383 - #endif 384 - 385 375 386 376 static void change_dir(int direction) 387 377 { ··· 498 488 audio_ff_rewind(elapsed); 499 489 } 500 490 501 - 502 491 #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) 503 492 /* 504 493 * If the user is unable to see the wps, because the display is deactivated, ··· 541 530 #endif 542 531 } 543 532 533 + static void restore_theme(void) 534 + { 535 + FOR_NB_SCREENS(i) 536 + { 537 + struct gui_wps *gwps = skin_get_gwps(WPS, i); 538 + struct screen *display = gwps->display; 539 + display->scroll_stop(); 540 + viewportmanager_theme_enable(i, skin_has_sbs(gwps), NULL); 541 + } 542 + } 543 + 544 544 /* 545 545 * display the wps on entering or restoring */ 546 546 static void gwps_enter_wps(bool theme_enabled) 547 547 { 548 548 struct gui_wps *gwps; 549 549 struct screen *display; 550 + if (theme_enabled) 551 + restore_theme(); 550 552 FOR_NB_SCREENS(i) 551 553 { 552 554 gwps = skin_get_gwps(WPS, i); 553 555 display = gwps->display; 554 556 display->scroll_stop(); 555 - if (theme_enabled) 556 - viewportmanager_theme_enable(i, skin_has_sbs(gwps), NULL); 557 - 558 557 /* Update the values in the first (default) viewport - in case the user 559 558 has modified the statusbar or colour settings */ 560 559 #if LCD_DEPTH > 1 ··· 607 606 } 608 607 } 609 608 609 + static long do_wps_exit(long action, bool bookmark) 610 + { 611 + audio_pause(); 612 + update_non_static(); 613 + if (bookmark) 614 + bookmark_autobookmark(true); 615 + audio_stop(); 616 + #ifdef AB_REPEAT_ENABLE 617 + ab_reset_markers(); 618 + #endif 619 + gwps_leave_wps(true); 620 + #ifdef HAVE_RECORDING 621 + if (action == ACTION_WPS_REC) 622 + return GO_TO_RECSCREEN; 623 + #else 624 + (void)action; 625 + #endif 626 + if (global_settings.browse_current) 627 + return GO_TO_PREVIOUS_BROWSER; 628 + return GO_TO_PREVIOUS; 629 + } 630 + 631 + static long do_party_mode(long action) 632 + { 633 + if (global_settings.party_mode) 634 + { 635 + switch (action) 636 + { 637 + #ifdef ACTION_WPSAB_SINGLE 638 + case ACTION_WPSAB_SINGLE: 639 + if (!ab_repeat_mode_enabled()) 640 + break; 641 + /* Note: currently all targets use ACTION_WPS_BROWSE 642 + * if mapped to any of below actions this will cause problems */ 643 + #endif 644 + case ACTION_WPS_PLAY: 645 + case ACTION_WPS_SEEKFWD: 646 + case ACTION_WPS_SEEKBACK: 647 + case ACTION_WPS_SKIPPREV: 648 + case ACTION_WPS_SKIPNEXT: 649 + case ACTION_WPS_ABSETB_NEXTDIR: 650 + case ACTION_WPS_ABSETA_PREVDIR: 651 + case ACTION_WPS_STOP: 652 + return ACTION_NONE; 653 + break; 654 + default: 655 + break; 656 + } 657 + } 658 + return action; 659 + } 610 660 611 661 /* The WPS can be left in two ways: 612 662 * a) call a function, which draws over the wps. In this case, the wps ··· 621 671 { 622 672 long button = 0; 623 673 bool restore = true; 624 - long restoretimer = RESTORE_WPS_INSTANTLY; /* timer to delay screen redraw temporarily */ 625 674 bool exit = false; 626 675 bool bookmark = false; 627 676 bool update = false; 628 - bool vol_changed = false; 677 + bool theme_enabled = true; 629 678 long last_left = 0, last_right = 0; 630 679 struct wps_state *state = get_wps_state(); 631 680 ··· 634 683 ab_reset_markers(); 635 684 #endif 636 685 wps_state_init(); 637 - 638 686 while ( 1 ) 639 687 { 640 - bool theme_enabled = true; 688 + bool hotkey = false; 641 689 bool audio_paused = (audio_status() & AUDIO_STATUS_PAUSE)?true:false; 642 - 643 690 /* did someone else (i.e power thread) change audio pause mode? */ 644 691 if (state->paused != audio_paused) { 645 692 state->paused = audio_paused; ··· 653 700 #endif 654 701 } 655 702 } 656 - button = skin_wait_for_action(WPS, CONTEXT_WPS|ALLOW_SOFTLOCK, 657 - restore ? 1 : HZ/5); 703 + 704 + if (restore) 705 + { 706 + restore = false; 707 + #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) 708 + add_event(LCD_EVENT_ACTIVATION, wps_lcd_activation_hook); 709 + #endif 710 + /* we remove the update delay since it's not very usable in the wps, 711 + * e.g. during volume changing or ffwd/rewind */ 712 + sb_skin_set_update_delay(0); 713 + skin_request_full_update(WPS); 714 + update = true; 715 + gwps_enter_wps(theme_enabled); 716 + theme_enabled = true; 717 + } 718 + else 719 + { 720 + gwps_caption_backlight(state); 721 + 722 + FOR_NB_SCREENS(i) 723 + { 724 + #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) 725 + /* currently, all remotes are readable without backlight 726 + * so still update those */ 727 + if (lcd_active() || (i != SCREEN_MAIN)) 728 + #endif 729 + { 730 + bool full_update = skin_do_full_update(WPS, i); 731 + if (update || full_update) 732 + { 733 + skin_update(WPS, i, full_update ? 734 + SKIN_REFRESH_ALL : SKIN_REFRESH_NON_STATIC); 735 + } 736 + } 737 + } 738 + update = false; 739 + } 740 + 741 + if (exit) 742 + { 743 + return do_wps_exit(button, bookmark); 744 + } 745 + 746 + if (button && !IS_SYSEVENT(button) ) 747 + storage_spin(); 748 + 749 + button = skin_wait_for_action(WPS, CONTEXT_WPS|ALLOW_SOFTLOCK, HZ/5); 658 750 659 751 /* Exit if audio has stopped playing. This happens e.g. at end of 660 752 playlist or if using the sleep timer. */ ··· 664 756 if (button == ACTION_TOUCHSCREEN) 665 757 button = skintouch_to_wps(); 666 758 #endif 759 + button = do_party_mode(button); /* block select actions in party mode */ 760 + 667 761 /* The iPods/X5/M5 use a single button for the A-B mode markers, 668 762 defined as ACTION_WPSAB_SINGLE in their config files. */ 669 763 #ifdef ACTION_WPSAB_SINGLE 670 - if (!global_settings.party_mode && ab_repeat_mode_enabled()) 764 + static int wps_ab_state = 0; 765 + if (button == ACTION_WPSAB_SINGLE && ab_repeat_mode_enabled()) 671 766 { 672 - static int wps_ab_state = 0; 673 - if (button == ACTION_WPSAB_SINGLE) 767 + switch (wps_ab_state) 674 768 { 675 - switch (wps_ab_state) 676 - { 677 - case 0: /* set the A spot */ 678 - button = ACTION_WPS_ABSETA_PREVDIR; 679 - break; 680 - case 1: /* set the B spot */ 681 - button = ACTION_WPS_ABSETB_NEXTDIR; 682 - break; 683 - case 2: 684 - button = ACTION_WPS_ABRESET; 685 - break; 686 - } 687 - wps_ab_state = (wps_ab_state+1) % 3; 769 + case 0: /* set the A spot */ 770 + button = ACTION_WPS_ABSETA_PREVDIR; 771 + break; 772 + case 1: /* set the B spot */ 773 + button = ACTION_WPS_ABSETB_NEXTDIR; 774 + break; 775 + case 2: 776 + button = ACTION_WPS_ABRESET; 777 + break; 688 778 } 779 + wps_ab_state = (wps_ab_state+1) % 3; 689 780 } 690 - #endif 781 + #endif /* def ACTION_WPSAB_SINGLE */ 782 + 691 783 switch(button) 692 784 { 693 785 #ifdef HAVE_HOTKEY 694 786 case ACTION_WPS_HOTKEY: 787 + { 788 + hotkey = true; 695 789 if (!global_settings.hotkey_wps) 696 790 break; 697 - /* fall through */ 698 - #endif 699 - case ACTION_WPS_CONTEXT: 700 - { 701 - bool hotkey = button == ACTION_WPS_HOTKEY; 702 - 703 - #ifdef HAVE_HOTKEY 704 - if (hotkey && global_settings.hotkey_wps == HOTKEY_PLUGIN) 791 + if (global_settings.hotkey_wps == HOTKEY_PLUGIN) 705 792 { 706 793 /* leave WPS without re-enabling theme */ 707 794 theme_enabled = false; ··· 711 798 if (!audio_status()) 712 799 { 713 800 /* re-enable theme since we're returning to SBS */ 714 - FOR_NB_SCREENS(i) 715 - { 716 - struct gui_wps *gwps = skin_get_gwps(WPS, i); 717 - #ifdef HAVE_BACKDROP_IMAGE 718 - skin_backdrop_show(sb_get_backdrop(i)); 719 - #endif 720 - viewportmanager_theme_undo(i, skin_has_sbs(gwps)); 721 - } 801 + gwps_leave_wps(true); 722 802 return GO_TO_ROOT; 723 803 } 804 + restore = true; 805 + break; 724 806 } 725 - else 726 - #endif 807 + } 808 + /* fall through */ 809 + #endif /* def HAVE_HOTKEY */ 810 + case ACTION_WPS_CONTEXT: 811 + { 812 + gwps_leave_wps(true); 813 + int retval = onplay(state->id3->path, 814 + FILE_ATTR_AUDIO, CONTEXT_WPS, hotkey); 815 + /* if music is stopped in the context menu we want to exit the wps */ 816 + if (retval == ONPLAY_MAINMENU 817 + || !audio_status()) 818 + return GO_TO_ROOT; 819 + else if (retval == ONPLAY_PLAYLIST) 820 + return GO_TO_PLAYLIST_VIEWER; 821 + else if (retval == ONPLAY_PLUGIN) 727 822 { 728 - gwps_leave_wps(true); 729 - int retval = onplay(state->id3->path, 730 - FILE_ATTR_AUDIO, CONTEXT_WPS, hotkey); 731 - /* if music is stopped in the context menu we want to exit the wps */ 732 - if (retval == ONPLAY_MAINMENU 733 - || !audio_status()) 734 - return GO_TO_ROOT; 735 - else if (retval == ONPLAY_PLAYLIST) 736 - return GO_TO_PLAYLIST_VIEWER; 737 - else if (retval == ONPLAY_PLUGIN) 738 - { 739 - FOR_NB_SCREENS(i) 740 - { 741 - struct gui_wps *gwps = skin_get_gwps(WPS, i); 742 - viewportmanager_theme_enable(i, skin_has_sbs(gwps), NULL); 743 - } 744 - theme_enabled = false; 745 - open_plugin_run(ID2P(LANG_OPEN_PLUGIN_SET_WPS_CONTEXT_PLUGIN)); 746 - } 823 + restore_theme(); 824 + theme_enabled = false; 825 + open_plugin_run(ID2P(LANG_OPEN_PLUGIN_SET_WPS_CONTEXT_PLUGIN)); 747 826 } 748 827 749 828 restore = true; ··· 757 836 758 837 /* play/pause */ 759 838 case ACTION_WPS_PLAY: 760 - if (global_settings.party_mode) 761 - break; 762 839 wps_do_playpause(true); 763 840 break; 764 841 765 - case ACTION_WPS_VOLUP: 766 - global_settings.volume += sound_steps(SOUND_VOLUME); 767 - vol_changed = true; 768 - break; 842 + case ACTION_WPS_VOLUP: /* fall through */ 769 843 case ACTION_WPS_VOLDOWN: 770 - global_settings.volume -= sound_steps(SOUND_VOLUME); 771 - vol_changed = true; 844 + if (button == ACTION_WPS_VOLUP) 845 + global_settings.volume += sound_steps(SOUND_VOLUME); 846 + else 847 + global_settings.volume -= sound_steps(SOUND_VOLUME); 848 + 849 + setvol(); 850 + FOR_NB_SCREENS(i) 851 + { 852 + skin_update(WPS, i, SKIN_REFRESH_NON_STATIC); 853 + } 854 + update = false; 772 855 break; 773 856 /* fast forward 774 857 OR next dir if this is straight after ACTION_WPS_SKIPNEXT */ 775 858 case ACTION_WPS_SEEKFWD: 776 - if (global_settings.party_mode) 777 - break; 778 859 if (current_tick -last_right < HZ) 779 860 { 780 861 if (state->id3->cuesheet) ··· 793 874 /* fast rewind 794 875 OR prev dir if this is straight after ACTION_WPS_SKIPPREV,*/ 795 876 case ACTION_WPS_SEEKBACK: 796 - if (global_settings.party_mode) 797 - break; 798 - if (current_tick -last_left < HZ) 877 + if (current_tick - last_left < HZ) 799 878 { 800 879 if (state->id3->cuesheet) 801 880 { ··· 824 903 825 904 /* prev / restart */ 826 905 case ACTION_WPS_SKIPPREV: 827 - if (global_settings.party_mode) 828 - break; 829 906 last_left = current_tick; 830 907 #ifdef AB_REPEAT_ENABLE 831 908 /* if we're in A/B repeat mode and the current position ··· 844 921 /* next 845 922 OR if skip length set, hop by predetermined amount. */ 846 923 case ACTION_WPS_SKIPNEXT: 847 - if (global_settings.party_mode) 848 - break; 849 924 last_right = current_tick; 850 925 #ifdef AB_REPEAT_ENABLE 851 926 /* if we're in A/B repeat mode and the current position is ··· 866 941 /* next / prev directories */ 867 942 /* and set A-B markers if in a-b mode */ 868 943 case ACTION_WPS_ABSETB_NEXTDIR: 869 - if (global_settings.party_mode) 870 - break; 871 944 #if defined(AB_REPEAT_ENABLE) 872 945 if (ab_repeat_mode_enabled()) 873 946 { ··· 881 954 } 882 955 break; 883 956 case ACTION_WPS_ABSETA_PREVDIR: 884 - if (global_settings.party_mode) 885 - break; 886 957 #if defined(AB_REPEAT_ENABLE) 887 958 if (ab_repeat_mode_enabled()) 888 959 ab_set_A_marker(state->id3->elapsed); ··· 915 986 restore = true; 916 987 } 917 988 918 - if (enter_shortcuts_menu) 989 + if (enter_shortcuts_menu) /* enter_shortcuts_menu */ 919 990 { 920 991 global_status.last_screen = GO_TO_SHORTCUTMENU; 921 992 int ret = do_shortcut_menu(NULL); ··· 952 1023 953 1024 /* stop and exit wps */ 954 1025 case ACTION_WPS_STOP: 955 - if (global_settings.party_mode) 956 - break; 957 1026 bookmark = true; 958 1027 exit = true; 959 1028 break; ··· 1013 1082 update = true; 1014 1083 break; 1015 1084 } 1016 - 1017 - if (vol_changed) 1018 - { 1019 - bool res = false; 1020 - vol_changed = false; 1021 - setvol(); 1022 - FOR_NB_SCREENS(i) 1023 - { 1024 - if(update_onvol_change(i)) 1025 - res = true; 1026 - } 1027 - if (res) { 1028 - restore = true; 1029 - restoretimer = RESTORE_WPS_NEXT_SECOND; 1030 - } 1031 - } 1032 - 1033 - 1034 - if (restore && 1035 - ((restoretimer == RESTORE_WPS_INSTANTLY) || 1036 - TIME_AFTER(current_tick, restoretimer))) 1037 - { 1038 - restore = false; 1039 - restoretimer = RESTORE_WPS_INSTANTLY; 1040 - #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) 1041 - add_event(LCD_EVENT_ACTIVATION, wps_lcd_activation_hook); 1042 - #endif 1043 - /* we remove the update delay since it's not very usable in the wps, 1044 - * e.g. during volume changing or ffwd/rewind */ 1045 - sb_skin_set_update_delay(0); 1046 - skin_request_full_update(WPS); 1047 - update = true; 1048 - gwps_enter_wps(theme_enabled); 1049 - } 1050 - else 1051 - { 1052 - #if defined(HAVE_BACKLIGHT) || defined(HAVE_REMOTE_LCD) 1053 - gwps_caption_backlight(state); 1054 - #endif 1055 - FOR_NB_SCREENS(i) 1056 - { 1057 - #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) 1058 - /* currently, all remotes are readable without backlight 1059 - * so still update those */ 1060 - if (lcd_active() || (i != SCREEN_MAIN)) 1061 - #endif 1062 - { 1063 - bool full_update = skin_do_full_update(WPS, i); 1064 - if (update || full_update) 1065 - { 1066 - skin_update(WPS, i, full_update ? 1067 - SKIN_REFRESH_ALL : SKIN_REFRESH_NON_STATIC); 1068 - } 1069 - } 1070 - } 1071 - update = false; 1072 - } 1073 - 1074 - if (exit) { 1075 - audio_pause(); 1076 - update_non_static(); 1077 - if (bookmark) 1078 - bookmark_autobookmark(true); 1079 - audio_stop(); 1080 - #ifdef AB_REPEAT_ENABLE 1081 - ab_reset_markers(); 1082 - #endif 1083 - gwps_leave_wps(true); 1084 - #ifdef HAVE_RECORDING 1085 - if (button == ACTION_WPS_REC) 1086 - return GO_TO_RECSCREEN; 1087 - #endif 1088 - if (global_settings.browse_current) 1089 - return GO_TO_PREVIOUS_BROWSER; 1090 - return GO_TO_PREVIOUS; 1091 - } 1092 - 1093 - if (button && !IS_SYSEVENT(button) ) 1094 - storage_spin(); 1095 1085 } 1096 1086 return GO_TO_ROOT; /* unreachable - just to reduce compiler warnings */ 1097 1087 }
+1 -1
apps/menus/time_menu.c
··· 304 304 #endif 305 305 306 306 ret = do_menu(&time_menu, NULL, menu, false); 307 - pop_current_activity(ACTIVITY_REFRESH_NOW); 307 + pop_current_activity(); 308 308 /* see comments above in the button callback */ 309 309 if (!menu_was_pressed && ret == GO_TO_PREVIOUS) 310 310 return 0;
+30 -5
apps/misc.c
··· 1569 1569 static enum current_activity 1570 1570 current_activity[MAX_ACTIVITY_DEPTH] = {ACTIVITY_UNKNOWN}; 1571 1571 static int current_activity_top = 0; 1572 - void push_current_activity(enum current_activity screen) 1572 + 1573 + static void push_current_activity_refresh(enum current_activity screen, bool refresh) 1573 1574 { 1574 1575 current_activity[current_activity_top++] = screen; 1575 1576 FOR_NB_SCREENS(i) 1576 1577 { 1577 1578 skinlist_set_cfg(i, NULL); 1578 - skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_ALL); 1579 + if (refresh) 1580 + skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_ALL); 1579 1581 } 1580 1582 } 1581 1583 1582 - void push_activity_without_refresh(enum current_activity screen) 1584 + static void pop_current_activity_refresh(bool refresh) 1583 1585 { 1584 - current_activity[current_activity_top++] = screen; 1586 + current_activity_top--; 1585 1587 FOR_NB_SCREENS(i) 1588 + { 1586 1589 skinlist_set_cfg(i, NULL); 1590 + if (refresh) 1591 + skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_ALL); 1592 + } 1587 1593 } 1588 1594 1589 - void pop_current_activity(enum activity_refresh refresh) 1595 + void push_current_activity(enum current_activity screen) 1596 + { 1597 + push_current_activity_refresh(screen, true); 1598 + } 1599 + 1600 + void push_activity_without_refresh(enum current_activity screen) 1601 + { 1602 + push_current_activity_refresh(screen, false); 1603 + } 1604 + 1605 + void pop_current_activity(void) 1590 1606 { 1607 + pop_current_activity_refresh(true); 1608 + #if 0 1591 1609 current_activity_top--; 1592 1610 FOR_NB_SCREENS(i) 1593 1611 { ··· 1595 1613 if (ACTIVITY_REFRESH_NOW == refresh) 1596 1614 skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_ALL); 1597 1615 } 1616 + #endif 1598 1617 } 1618 + 1619 + void pop_current_activity_without_refresh(void) 1620 + { 1621 + pop_current_activity_refresh(false); 1622 + } 1623 + 1599 1624 enum current_activity get_current_activity(void) 1600 1625 { 1601 1626 return current_activity[current_activity_top?current_activity_top-1:0];
+2 -7
apps/misc.h
··· 214 214 int id3_get_replaygain_mode(const struct mp3entry *id3); 215 215 void replaygain_update(void); 216 216 217 - enum activity_refresh 218 - { 219 - ACTIVITY_REFRESH_DEFERRED = 0, 220 - ACTIVITY_REFRESH_NOW, 221 - }; 222 - 223 217 void push_current_activity(enum current_activity screen); 224 218 void push_activity_without_refresh(enum current_activity screen); 225 - void pop_current_activity(enum activity_refresh refresh); 219 + void pop_current_activity(void); 220 + void pop_current_activity_without_refresh(void); 226 221 enum current_activity get_current_activity(void); 227 222 228 223 /* format a sound value like: -1.05 dB */
+4 -4
apps/onplay.c
··· 148 148 static int bookmark_load_menu_wrapper(void) 149 149 { 150 150 if (get_current_activity() == ACTIVITY_CONTEXTMENU) /* get rid of parent activity */ 151 - pop_current_activity(ACTIVITY_REFRESH_DEFERRED); /* when called from ctxt menu */ 151 + pop_current_activity_without_refresh(); /* when called from ctxt menu */ 152 152 153 153 return bookmark_load_menu(); 154 154 } ··· 474 474 static int wps_view_cur_playlist(void) 475 475 { 476 476 if (get_current_activity() == ACTIVITY_CONTEXTMENU) /* get rid of parent activity */ 477 - pop_current_activity(ACTIVITY_REFRESH_DEFERRED); /* when called from ctxt menu */ 477 + pop_current_activity_without_refresh(); /* when called from ctxt menu */ 478 478 479 479 playlist_viewer_ex(NULL, NULL); 480 480 ··· 1520 1520 static int browse_id3_wrapper(void) 1521 1521 { 1522 1522 if (get_current_activity() == ACTIVITY_CONTEXTMENU) /* get rid of parent activity */ 1523 - pop_current_activity(ACTIVITY_REFRESH_DEFERRED); /* when called from ctxt menu */ 1523 + pop_current_activity_without_refresh(); /* when called from ctxt menu */ 1524 1524 1525 1525 if (browse_id3(audio_current_track(), 1526 1526 playlist_get_display_index(), ··· 1979 1979 menu_selection = do_menu(menu, NULL, NULL, false); 1980 1980 1981 1981 if (get_current_activity() == ACTIVITY_CONTEXTMENU) /* Activity may have been */ 1982 - pop_current_activity(ACTIVITY_REFRESH_NOW); /* popped already by menu item */ 1982 + pop_current_activity(); /* popped already by menu item */ 1983 1983 1984 1984 switch (menu_selection) 1985 1985 {
+8 -9
apps/playlist_viewer.c
··· 143 143 static bool update_playlist(bool force); 144 144 static enum pv_onplay_result onplay_menu(int index); 145 145 146 - static void close_playlist_viewer(bool pop_activity); 146 + static void close_playlist_viewer(void); 147 147 148 148 static void playlist_buffer_init(struct playlist_buffer *pb, char *names_buffer, 149 149 int names_buffer_size) ··· 525 525 static enum pv_onplay_result open_with(const struct playlist_entry *current_track) 526 526 { 527 527 char selected_track[MAX_PATH]; 528 - close_playlist_viewer(false); /* don't pop activity yet – relevant for plugin_load */ 528 + close_playlist_viewer(); /* don't pop activity yet – relevant for plugin_load */ 529 529 530 530 strmemccpy(selected_track, current_track->name, sizeof(selected_track)); 531 531 532 532 int plugin_return = filetype_list_viewers(selected_track); 533 - pop_current_activity(ACTIVITY_REFRESH_DEFERRED); 533 + pop_current_activity_without_refresh(); 534 534 535 535 switch (plugin_return) 536 536 { ··· 548 548 static enum pv_onplay_result open_pictureflow(const struct playlist_entry *current_track) 549 549 { 550 550 char selected_track[MAX_PATH]; 551 - close_playlist_viewer(false); /* don't pop activity yet – relevant for plugin_load */ 551 + close_playlist_viewer(); /* don't pop activity yet – relevant for plugin_load */ 552 552 553 553 strmemccpy(selected_track, current_track->name, sizeof(selected_track)); 554 554 int plugin_return = filetype_load_plugin((void *)"pictureflow", selected_track); 555 - pop_current_activity(ACTIVITY_REFRESH_DEFERRED); 555 + pop_current_activity_without_refresh(); 556 556 557 557 switch (plugin_return) 558 558 { ··· 1093 1093 } 1094 1094 1095 1095 exit: 1096 - close_playlist_viewer(true); 1096 + pop_current_activity_without_refresh(); 1097 + close_playlist_viewer(); 1097 1098 return ret; 1098 1099 } 1099 1100 1100 - static void close_playlist_viewer(bool pop_activity) 1101 + static void close_playlist_viewer(void) 1101 1102 { 1102 1103 talk_shutup(); 1103 - if (pop_activity) 1104 - pop_current_activity(ACTIVITY_REFRESH_DEFERRED); 1105 1104 if (viewer.playlist) 1106 1105 { 1107 1106 if (viewer.initial_selection)
+9 -7
apps/plugin.c
··· 925 925 926 926 tree_unlock_cache(tree_get_context()); 927 927 928 - pop_current_activity(ACTIVITY_REFRESH_DEFERRED); 929 - int curr_activity = get_current_activity(); 930 - if ((curr_activity != ACTIVITY_PLAYLISTVIEWER) && 931 - (curr_activity != ACTIVITY_WPS) && 932 - (rc != PLUGIN_GOTO_WPS)) 928 + pop_current_activity_without_refresh(); 929 + if (rc != PLUGIN_GOTO_WPS) 933 930 { 934 - FOR_NB_SCREENS(i) 935 - skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_ALL); 931 + int curr_activity = get_current_activity(); 932 + if ((curr_activity != ACTIVITY_PLAYLISTVIEWER) && 933 + (curr_activity != ACTIVITY_WPS)) 934 + { 935 + FOR_NB_SCREENS(i) 936 + skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_ALL); 937 + } 936 938 } 937 939 938 940 if (!pfn_tsr_exit)
+1 -1
apps/plugins/pitch_screen.c
··· 1109 1109 } 1110 1110 1111 1111 //rb->pcmbuf_set_low_latency(false); 1112 - //pop_current_activity(ACTIVITY_REFRESH_NOW); 1112 + //pop_current_activity(); 1113 1113 1114 1114 /* Clean up */ 1115 1115 FOR_NB_SCREENS(i)
+1 -1
apps/radio/radio.c
··· 729 729 cpu_idle_mode(false); 730 730 #endif 731 731 fms_fix_displays(FMS_EXIT); 732 - pop_current_activity(ACTIVITY_REFRESH_NOW); 732 + pop_current_activity(); 733 733 in_screen = false; 734 734 } /* radio_screen */ 735 735
+1 -1
apps/recorder/recording.c
··· 1844 1844 #endif 1845 1845 1846 1846 settings_save(); 1847 - pop_current_activity(ACTIVITY_REFRESH_NOW); 1847 + pop_current_activity(); 1848 1848 return (rec_status & RCSTAT_BEEN_IN_USB_MODE) != 0; 1849 1849 } /* recording_screen */ 1850 1850
+10 -10
apps/root_menu.c
··· 280 280 if (ret_val == GO_TO_WPS 281 281 || ret_val == GO_TO_PREVIOUS_MUSIC 282 282 || ret_val == GO_TO_PLUGIN) 283 - pop_current_activity(ACTIVITY_REFRESH_DEFERRED); 283 + pop_current_activity_without_refresh(); 284 284 else 285 - pop_current_activity(ACTIVITY_REFRESH_NOW); 285 + pop_current_activity(); 286 286 287 287 switch ((intptr_t)param) 288 288 { ··· 355 355 || last_screen == GO_TO_SYSTEM_SCREEN 356 356 || last_screen == GO_TO_PLAYLISTS_SCREEN))) 357 357 { 358 - pop_current_activity(ACTIVITY_REFRESH_DEFERRED); 358 + pop_current_activity_without_refresh(); 359 359 } 360 360 else 361 - pop_current_activity(ACTIVITY_REFRESH_NOW); 361 + pop_current_activity(); 362 362 363 363 return ret_val; 364 364 } ··· 396 396 397 397 if (item_was_selected) 398 398 { 399 - pop_current_activity(ACTIVITY_REFRESH_DEFERRED); 399 + pop_current_activity_without_refresh(); 400 400 return GO_TO_WPS; 401 401 } 402 - pop_current_activity(ACTIVITY_REFRESH_NOW); 402 + pop_current_activity(); 403 403 return GO_TO_ROOT; 404 404 } 405 405 ··· 714 714 || ret_val == GO_TO_PREVIOUS_BROWSER 715 715 || ret_val == GO_TO_FILEBROWSER) 716 716 { 717 - pop_current_activity(ACTIVITY_REFRESH_DEFERRED); 717 + pop_current_activity_without_refresh(); 718 718 } 719 719 else 720 - pop_current_activity(ACTIVITY_REFRESH_NOW); 720 + pop_current_activity(); 721 721 } 722 722 723 723 last_screen = screen; ··· 744 744 745 745 if (context_menu) 746 746 retval = do_menu(context_menu, NULL, NULL, false); 747 - pop_current_activity(ACTIVITY_REFRESH_NOW); 747 + pop_current_activity(); 748 748 return retval; 749 749 } 750 750 ··· 992 992 993 993 push_activity_without_refresh(ACTIVITY_UNKNOWN); /* prevent plugin_load */ 994 994 next_screen = load_plugin_screen(key); /* from flashing root */ 995 - pop_current_activity(ACTIVITY_REFRESH_DEFERRED); /* menu activity */ 995 + pop_current_activity_without_refresh(); /* menu activity */ 996 996 997 997 if (next_screen == GO_TO_PREVIOUS) 998 998 {
+1 -1
apps/screens.c
··· 733 733 } 734 734 } 735 735 736 - pop_current_activity(ACTIVITY_REFRESH_NOW); 736 + pop_current_activity(); 737 737 return ret; 738 738 } 739 739
+2 -2
apps/shortcuts.c
··· 719 719 } 720 720 } 721 721 if (GO_TO_PLUGIN == done) 722 - pop_current_activity(ACTIVITY_REFRESH_DEFERRED); 722 + pop_current_activity_without_refresh(); 723 723 else 724 - pop_current_activity(ACTIVITY_REFRESH_NOW); 724 + pop_current_activity(); 725 725 --buflib_move_lock; 726 726 727 727 return done;