diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/gwps-common.c | 16 | ||||
-rw-r--r-- | apps/gui/gwps.c | 30 | ||||
-rw-r--r-- | apps/gui/gwps.h | 21 | ||||
-rw-r--r-- | apps/gui/viewport.c | 1 |
4 files changed, 33 insertions, 35 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index b60377de78..005fefd0fb 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c | |||
@@ -353,16 +353,6 @@ bool gui_wps_display(void) | |||
353 | FOR_NB_SCREENS(i) | 353 | FOR_NB_SCREENS(i) |
354 | { | 354 | { |
355 | gui_wps_refresh(&gui_wps[i], 0, WPS_REFRESH_ALL); | 355 | gui_wps_refresh(&gui_wps[i], 0, WPS_REFRESH_ALL); |
356 | #ifdef HAVE_LCD_BITMAP | ||
357 | /* temporary work around so the statusbar doesnt disappear when the WPS | ||
358 | * is first entered. This should be removed when the | ||
359 | * WPS-statusbar handling is fixed up a bit more */ | ||
360 | bool draw = global_settings.statusbar; | ||
361 | if (gui_wps[i].data->wps_sb_tag) | ||
362 | draw = gui_wps[i].data->show_sb_on_wps; | ||
363 | if (draw) | ||
364 | gui_statusbar_draw(&statusbars.statusbars[i], true); | ||
365 | #endif | ||
366 | } | 356 | } |
367 | return false; | 357 | return false; |
368 | } | 358 | } |
@@ -2114,6 +2104,10 @@ bool gui_wps_refresh(struct gui_wps *gwps, | |||
2114 | data->peak_meter_enabled = enable_pm; | 2104 | data->peak_meter_enabled = enable_pm; |
2115 | #endif | 2105 | #endif |
2116 | 2106 | ||
2107 | if (refresh_mode & WPS_REFRESH_STATUSBAR) | ||
2108 | { | ||
2109 | gwps_draw_statusbars(); | ||
2110 | } | ||
2117 | /* Restore the default viewport */ | 2111 | /* Restore the default viewport */ |
2118 | display->set_viewport(NULL); | 2112 | display->set_viewport(NULL); |
2119 | 2113 | ||
@@ -2152,7 +2146,5 @@ bool gui_wps_refresh(struct gui_wps *gwps, | |||
2152 | remote_backlight_on(); | 2146 | remote_backlight_on(); |
2153 | } | 2147 | } |
2154 | #endif | 2148 | #endif |
2155 | /* force a bars update if they are being displayed */ | ||
2156 | viewportmanager_draw_statusbars(NULL); | ||
2157 | return true; | 2149 | return true; |
2158 | } | 2150 | } |
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 89b8bf1960..cbce0f5973 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c | |||
@@ -151,7 +151,7 @@ static void play_hop(int direction) | |||
151 | #endif | 151 | #endif |
152 | } | 152 | } |
153 | 153 | ||
154 | void gwps_fix_statusbars(void) | 154 | static void gwps_fix_statusbars(void) |
155 | { | 155 | { |
156 | #ifdef HAVE_LCD_BITMAP | 156 | #ifdef HAVE_LCD_BITMAP |
157 | int i; | 157 | int i; |
@@ -161,9 +161,11 @@ void gwps_fix_statusbars(void) | |||
161 | bool draw = false; | 161 | bool draw = false; |
162 | if (gui_wps[i].data->wps_sb_tag) | 162 | if (gui_wps[i].data->wps_sb_tag) |
163 | draw = gui_wps[i].data->show_sb_on_wps; | 163 | draw = gui_wps[i].data->show_sb_on_wps; |
164 | else if (global_settings.statusbar) | ||
165 | wpsbars |= VP_SB_ONSCREEN(i); | ||
164 | if (draw) | 166 | if (draw) |
165 | wpsbars |= (VP_SB_ONSCREEN(i) | VP_SB_IGNORE_SETTING(i)); | 167 | wpsbars |= (VP_SB_ONSCREEN(i) | VP_SB_IGNORE_SETTING(i)); |
166 | } | 168 | } |
167 | #else | 169 | #else |
168 | wpsbars = VP_SB_ALLSCREENS; | 170 | wpsbars = VP_SB_ALLSCREENS; |
169 | #endif | 171 | #endif |
@@ -188,6 +190,11 @@ static void gwps_leave_wps(void) | |||
188 | viewportmanager_set_statusbar(oldbars); | 190 | viewportmanager_set_statusbar(oldbars); |
189 | } | 191 | } |
190 | 192 | ||
193 | void gwps_draw_statusbars(void) | ||
194 | { | ||
195 | viewportmanager_set_statusbar(wpsbars); | ||
196 | } | ||
197 | |||
191 | /* The WPS can be left in two ways: | 198 | /* The WPS can be left in two ways: |
192 | * a) call a function, which draws over the wps. In this case, the wps | 199 | * a) call a function, which draws over the wps. In this case, the wps |
193 | * will be still active (i.e. the below function didn't return) | 200 | * will be still active (i.e. the below function didn't return) |
@@ -207,7 +214,6 @@ long gui_wps_show(void) | |||
207 | bool update_track = false; | 214 | bool update_track = false; |
208 | int i; | 215 | int i; |
209 | long last_left = 0, last_right = 0; | 216 | long last_left = 0, last_right = 0; |
210 | |||
211 | wps_state_init(); | 217 | wps_state_init(); |
212 | 218 | ||
213 | #ifdef HAVE_LCD_CHARCELLS | 219 | #ifdef HAVE_LCD_CHARCELLS |
@@ -685,7 +691,7 @@ long gui_wps_show(void) | |||
685 | 691 | ||
686 | if (restore && | 692 | if (restore && |
687 | ((restoretimer == RESTORE_WPS_INSTANTLY) || | 693 | ((restoretimer == RESTORE_WPS_INSTANTLY) || |
688 | TIME_AFTER(restore, current_tick))) | 694 | TIME_AFTER(current_tick, restoretimer))) |
689 | { | 695 | { |
690 | /* restore wps backrops and statusbars */ | 696 | /* restore wps backrops and statusbars */ |
691 | #if LCD_DEPTH > 1 | 697 | #if LCD_DEPTH > 1 |
@@ -694,7 +700,6 @@ long gui_wps_show(void) | |||
694 | #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 | 700 | #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 |
695 | show_remote_wps_backdrop(); | 701 | show_remote_wps_backdrop(); |
696 | #endif | 702 | #endif |
697 | viewportmanager_set_statusbar(wpsbars); | ||
698 | restore = false; | 703 | restore = false; |
699 | restoretimer = RESTORE_WPS_INSTANTLY; | 704 | restoretimer = RESTORE_WPS_INSTANTLY; |
700 | if (gui_wps_display()) { | 705 | if (gui_wps_display()) { |
@@ -751,22 +756,21 @@ static void statusbar_toggle_handler(void *data) | |||
751 | { | 756 | { |
752 | (void)data; | 757 | (void)data; |
753 | int i; | 758 | int i; |
754 | bool draw = global_settings.statusbar; | 759 | gwps_fix_statusbars(); |
755 | 760 | ||
756 | FOR_NB_SCREENS(i) | 761 | FOR_NB_SCREENS(i) |
757 | { | 762 | { |
758 | struct wps_viewport *vp = &gui_wps[i].data->viewports[0]; | 763 | struct viewport *vp = &gui_wps[i].data->viewports[0].vp; |
759 | if (gui_wps[i].data->wps_sb_tag) | 764 | bool draw = wpsbars & (VP_SB_ONSCREEN(i) | VP_SB_IGNORE_SETTING(i)); |
760 | draw = gui_wps[i].data->show_sb_on_wps; | ||
761 | if (!draw) | 765 | if (!draw) |
762 | { | 766 | { |
763 | vp->vp.y = 0; | 767 | vp->y = 0; |
764 | vp->vp.height = screens[i].lcdheight; | 768 | vp->height = screens[i].lcdheight; |
765 | } | 769 | } |
766 | else | 770 | else |
767 | { | 771 | { |
768 | vp->vp.y = STATUSBAR_HEIGHT; | 772 | vp->y = STATUSBAR_HEIGHT; |
769 | vp->vp.height = screens[i].lcdheight - STATUSBAR_HEIGHT; | 773 | vp->height = screens[i].lcdheight - STATUSBAR_HEIGHT; |
770 | } | 774 | } |
771 | } | 775 | } |
772 | } | 776 | } |
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h index 70725df40b..d1239c1b34 100644 --- a/apps/gui/gwps.h +++ b/apps/gui/gwps.h | |||
@@ -26,15 +26,18 @@ | |||
26 | #include "metadata.h" | 26 | #include "metadata.h" |
27 | 27 | ||
28 | /* constants used in line_type and as refresh_mode for wps_refresh */ | 28 | /* constants used in line_type and as refresh_mode for wps_refresh */ |
29 | #define WPS_REFRESH_STATIC 1 /* line doesn't change over time */ | 29 | #define WPS_REFRESH_STATIC (1<<0) /* line doesn't change over time */ |
30 | #define WPS_REFRESH_DYNAMIC 2 /* line may change (e.g. time flag) */ | 30 | #define WPS_REFRESH_DYNAMIC (1<<1) /* line may change (e.g. time flag) */ |
31 | #define WPS_REFRESH_SCROLL 4 /* line scrolls */ | 31 | #define WPS_REFRESH_SCROLL (1<<2) /* line scrolls */ |
32 | #define WPS_REFRESH_PLAYER_PROGRESS 8 /* line contains a progress bar */ | 32 | #define WPS_REFRESH_PLAYER_PROGRESS (1<<3) /* line contains a progress bar */ |
33 | #define WPS_REFRESH_PEAK_METER 16 /* line contains a peak meter */ | 33 | #define WPS_REFRESH_PEAK_METER (1<<4) /* line contains a peak meter */ |
34 | #define WPS_REFRESH_STATUSBAR (1<<5) /* refresh statusbar */ | ||
34 | #define WPS_REFRESH_ALL 0xff /* to refresh all line types */ | 35 | #define WPS_REFRESH_ALL 0xff /* to refresh all line types */ |
35 | /* to refresh only those lines that change over time */ | ||
36 | #define WPS_REFRESH_NON_STATIC (WPS_REFRESH_ALL & ~WPS_REFRESH_STATIC & ~WPS_REFRESH_SCROLL) | ||
37 | 36 | ||
37 | /* to refresh only those lines that change over time */ | ||
38 | #define WPS_REFRESH_NON_STATIC (WPS_REFRESH_DYNAMIC| \ | ||
39 | WPS_REFRESH_PLAYER_PROGRESS| \ | ||
40 | WPS_REFRESH_PEAK_METER) | ||
38 | /* alignments */ | 41 | /* alignments */ |
39 | #define WPS_ALIGN_RIGHT 32 | 42 | #define WPS_ALIGN_RIGHT 32 |
40 | #define WPS_ALIGN_CENTER 64 | 43 | #define WPS_ALIGN_CENTER 64 |
@@ -440,8 +443,8 @@ bool wps_data_load(struct wps_data *wps_data, | |||
440 | const char *buf, | 443 | const char *buf, |
441 | bool isfile); | 444 | bool isfile); |
442 | 445 | ||
443 | /* Sets up the statusbars for the wps and each screen */ | 446 | /* Redraw statusbars if necessary */ |
444 | void gwps_fix_statusbars(void); | 447 | void gwps_draw_statusbars(void); |
445 | 448 | ||
446 | /* Returns the index of the subline in the subline array | 449 | /* Returns the index of the subline in the subline array |
447 | line - 0-based line number | 450 | line - 0-based line number |
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c index bc1ce8e9d3..a6313b88bd 100644 --- a/apps/gui/viewport.c +++ b/apps/gui/viewport.c | |||
@@ -125,7 +125,6 @@ void viewportmanager_draw_statusbars(void* data) | |||
125 | (void)data; | 125 | (void)data; |
126 | int i; | 126 | int i; |
127 | 127 | ||
128 | gwps_fix_statusbars(); | ||
129 | FOR_NB_SCREENS(i) | 128 | FOR_NB_SCREENS(i) |
130 | { | 129 | { |
131 | if (showing_bars(i)) | 130 | if (showing_bars(i)) |