summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-10-31 14:55:13 +0000
committerThomas Martitz <kugel@rockbox.org>2009-10-31 14:55:13 +0000
commit28aef1f96ac06cdd094f46d4e47c148be17bc438 (patch)
tree145d12375bcbe08a0be8d44cc75718a88e41c6ac /apps/gui
parent48960bfe292c823ad0b63e4938aec6e5df758158 (diff)
downloadrockbox-28aef1f96ac06cdd094f46d4e47c148be17bc438.tar.gz
rockbox-28aef1f96ac06cdd094f46d4e47c148be17bc438.zip
Consolidate code duplication in WPS volume changing handling.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23436 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/wps.c52
1 files changed, 21 insertions, 31 deletions
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index 8d1a0b9bf9..e449644502 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -707,6 +707,7 @@ long gui_wps_show(void)
707 bool exit = false; 707 bool exit = false;
708 bool bookmark = false; 708 bool bookmark = false;
709 bool update = false; 709 bool update = false;
710 bool vol_changed = false;
710 int i; 711 int i;
711 long last_left = 0, last_right = 0; 712 long last_left = 0, last_right = 0;
712 713
@@ -867,40 +868,12 @@ long gui_wps_show(void)
867 break; 868 break;
868 869
869 case ACTION_WPS_VOLUP: 870 case ACTION_WPS_VOLUP:
870 {
871 FOR_NB_SCREENS(i)
872 gui_wps[i].data->button_time_volume = current_tick;
873 global_settings.volume++; 871 global_settings.volume++;
874 bool res = false; 872 vol_changed = true;
875 setvol(); 873 break;
876 FOR_NB_SCREENS(i)
877 {
878 if(update_onvol_change(&gui_wps[i]))
879 res = true;
880 }
881 if (res) {
882 restore = true;
883 restoretimer = RESTORE_WPS_NEXT_SECOND;
884 }
885 }
886 break;
887 case ACTION_WPS_VOLDOWN: 874 case ACTION_WPS_VOLDOWN:
888 {
889 FOR_NB_SCREENS(i)
890 gui_wps[i].data->button_time_volume = current_tick;
891 global_settings.volume--; 875 global_settings.volume--;
892 setvol(); 876 vol_changed = true;
893 bool res = false;
894 FOR_NB_SCREENS(i)
895 {
896 if(update_onvol_change(&gui_wps[i]))
897 res = true;
898 }
899 if (res) {
900 restore = true;
901 restoretimer = RESTORE_WPS_NEXT_SECOND;
902 }
903 }
904 break; 877 break;
905 /* fast forward 878 /* fast forward
906 OR next dir if this is straight after ACTION_WPS_SKIPNEXT */ 879 OR next dir if this is straight after ACTION_WPS_SKIPNEXT */
@@ -1155,6 +1128,23 @@ long gui_wps_show(void)
1155 break; 1128 break;
1156 } 1129 }
1157 1130
1131 if (vol_changed)
1132 {
1133 FOR_NB_SCREENS(i)
1134 gui_wps[i].data->button_time_volume = current_tick;
1135 bool res = false;
1136 setvol();
1137 FOR_NB_SCREENS(i)
1138 {
1139 if(update_onvol_change(&gui_wps[i]))
1140 res = true;
1141 }
1142 if (res) {
1143 restore = true;
1144 restoretimer = RESTORE_WPS_NEXT_SECOND;
1145 }
1146 }
1147
1158 if (wps_sync_data.do_full_update || update) 1148 if (wps_sync_data.do_full_update || update)
1159 { 1149 {
1160#if defined(HAVE_BACKLIGHT) || defined(HAVE_REMOTE_LCD) 1150#if defined(HAVE_BACKLIGHT) || defined(HAVE_REMOTE_LCD)