diff options
author | Dave Chapman <dave@dchapman.com> | 2006-07-03 22:13:20 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2006-07-03 22:13:20 +0000 |
commit | 397eb42dcf0e7f3a821b5ea505d40faf0cd9d4c1 (patch) | |
tree | 16583d4042abf8b441a68c545836f254cc282e42 /apps/main_menu.c | |
parent | b1a272eee20cd3ca616432e81ca9adccc8f55e29 (diff) | |
download | rockbox-397eb42dcf0e7f3a821b5ea505d40faf0cd9d4c1.tar.gz rockbox-397eb42dcf0e7f3a821b5ea505d40faf0cd9d4c1.zip |
Patch #5616 from Martin Scarratt (mmmm) - multi-screen support for the Rockbox Info screen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10182 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/main_menu.c')
-rw-r--r-- | apps/main_menu.c | 57 |
1 files changed, 45 insertions, 12 deletions
diff --git a/apps/main_menu.c b/apps/main_menu.c index eb94498c7e..c21066cb5d 100644 --- a/apps/main_menu.c +++ b/apps/main_menu.c | |||
@@ -78,6 +78,7 @@ bool show_info(void) | |||
78 | unsigned long size, free; | 78 | unsigned long size, free; |
79 | long buflen = ((audiobufend - audiobuf) * 2) / 2097; /* avoid overflow */ | 79 | long buflen = ((audiobufend - audiobuf) * 2) / 2097; /* avoid overflow */ |
80 | int key; | 80 | int key; |
81 | int i; | ||
81 | bool done = false; | 82 | bool done = false; |
82 | bool new_info = true; | 83 | bool new_info = true; |
83 | #ifdef HAVE_MULTIVOLUME | 84 | #ifdef HAVE_MULTIVOLUME |
@@ -147,10 +148,13 @@ bool show_info(void) | |||
147 | new_info = false; | 148 | new_info = false; |
148 | } | 149 | } |
149 | 150 | ||
150 | lcd_clear_display(); | 151 | FOR_NB_SCREENS(i) |
152 | { | ||
153 | screens[i].clear_display(); | ||
151 | #ifdef HAVE_LCD_BITMAP | 154 | #ifdef HAVE_LCD_BITMAP |
152 | lcd_puts(0, y++, str(LANG_ROCKBOX_INFO)); | 155 | screens[i].puts(0, y, str(LANG_ROCKBOX_INFO)); |
153 | y++; | 156 | } |
157 | y = y + 2; | ||
154 | #endif | 158 | #endif |
155 | 159 | ||
156 | #ifdef HAVE_LCD_CHARCELLS | 160 | #ifdef HAVE_LCD_CHARCELLS |
@@ -167,8 +171,9 @@ bool show_info(void) | |||
167 | snprintf(s, sizeof(s), (char *)str(LANG_BUFFER_STAT_RECORDER), | 171 | snprintf(s, sizeof(s), (char *)str(LANG_BUFFER_STAT_RECORDER), |
168 | integer, decimal); | 172 | integer, decimal); |
169 | #endif | 173 | #endif |
170 | lcd_puts_scroll(0, y++, (unsigned char *)s); | 174 | FOR_NB_SCREENS(i) |
171 | 175 | screens[i].puts_scroll(0, y, (unsigned char *)s); | |
176 | y++; | ||
172 | #if CONFIG_CHARGING == CHARGING_CONTROL | 177 | #if CONFIG_CHARGING == CHARGING_CONTROL |
173 | if (charge_state == CHARGING) | 178 | if (charge_state == CHARGING) |
174 | snprintf(s, sizeof(s), (char *)str(LANG_BATTERY_CHARGE)); | 179 | snprintf(s, sizeof(s), (char *)str(LANG_BATTERY_CHARGE)); |
@@ -183,7 +188,9 @@ bool show_info(void) | |||
183 | battery_time() / 60, battery_time() % 60); | 188 | battery_time() / 60, battery_time() % 60); |
184 | else | 189 | else |
185 | strncpy(s, "(n/a)", sizeof(s)); | 190 | strncpy(s, "(n/a)", sizeof(s)); |
186 | lcd_puts_scroll(0, y++, (unsigned char *)s); | 191 | FOR_NB_SCREENS(i) |
192 | screens[i].puts_scroll(0, y, (unsigned char *)s); | ||
193 | y++; | ||
187 | } | 194 | } |
188 | 195 | ||
189 | #ifdef HAVE_LCD_CHARCELLS | 196 | #ifdef HAVE_LCD_CHARCELLS |
@@ -195,36 +202,53 @@ bool show_info(void) | |||
195 | output_dyn_value(s2, sizeof s2, size, kbyte_units, true); | 202 | output_dyn_value(s2, sizeof s2, size, kbyte_units, true); |
196 | snprintf(s, sizeof s, "%s %s/%s", str(LANG_DISK_NAME_INTERNAL), | 203 | snprintf(s, sizeof s, "%s %s/%s", str(LANG_DISK_NAME_INTERNAL), |
197 | s1, s2); | 204 | s1, s2); |
198 | lcd_puts_scroll(0, y++, (unsigned char *)s); | 205 | FOR_NB_SCREENS(i) |
206 | screens[i].puts_scroll(0, y, (unsigned char *)s); | ||
207 | y++; | ||
199 | 208 | ||
200 | if (size2) { | 209 | if (size2) { |
201 | output_dyn_value(s1, sizeof s1, free2, kbyte_units, true); | 210 | output_dyn_value(s1, sizeof s1, free2, kbyte_units, true); |
202 | output_dyn_value(s2, sizeof s2, size2, kbyte_units, true); | 211 | output_dyn_value(s2, sizeof s2, size2, kbyte_units, true); |
203 | snprintf(s, sizeof s, "%s %s/%s", str(LANG_DISK_NAME_MMC), | 212 | snprintf(s, sizeof s, "%s %s/%s", str(LANG_DISK_NAME_MMC), |
204 | s1, s2); | 213 | s1, s2); |
205 | lcd_puts_scroll(0, y++, (unsigned char *)s); | 214 | FOR_NB_SCREENS(i) |
215 | screens[i].puts_scroll(0, y, (unsigned char *)s); | ||
216 | y++; | ||
206 | } | 217 | } |
207 | #else | 218 | #else |
208 | output_dyn_value(s1, sizeof s1, size, kbyte_units, true); | 219 | output_dyn_value(s1, sizeof s1, size, kbyte_units, true); |
209 | snprintf(s, sizeof s, SIZE_FMT, str(LANG_DISK_SIZE_INFO), s1); | 220 | snprintf(s, sizeof s, SIZE_FMT, str(LANG_DISK_SIZE_INFO), s1); |
210 | lcd_puts_scroll(0, y++, (unsigned char *)s); | 221 | FOR_NB_SCREENS(i) |
211 | 222 | screens[i].puts_scroll(0, y, (unsigned char *)s); | |
223 | y++; | ||
212 | output_dyn_value(s1, sizeof s1, free, kbyte_units, true); | 224 | output_dyn_value(s1, sizeof s1, free, kbyte_units, true); |
213 | snprintf(s, sizeof s, SIZE_FMT, str(LANG_DISK_FREE_INFO), s1); | 225 | snprintf(s, sizeof s, SIZE_FMT, str(LANG_DISK_FREE_INFO), s1); |
214 | lcd_puts_scroll(0, y++, (unsigned char *)s); | 226 | FOR_NB_SCREENS(i) |
227 | screens[i].puts_scroll(0, y, (unsigned char *)s); | ||
228 | y++; | ||
215 | #endif | 229 | #endif |
216 | } | 230 | } |
217 | 231 | ||
218 | lcd_update(); | 232 | FOR_NB_SCREENS(i) |
233 | screens[i].update(); | ||
219 | 234 | ||
220 | /* Wait for a key to be pushed */ | 235 | /* Wait for a key to be pushed */ |
221 | key = button_get_w_tmo(HZ*5); | 236 | key = button_get_w_tmo(HZ*5); |
222 | switch(key) { | 237 | switch(key) { |
223 | 238 | ||
224 | case SETTINGS_OK: | 239 | case SETTINGS_OK: |
240 | #ifdef SETTINGS_RC_OK | ||
241 | case SETTINGS_RC_OK: | ||
242 | #endif | ||
225 | #ifdef SETTINGS_OK2 | 243 | #ifdef SETTINGS_OK2 |
226 | case SETTINGS_OK2: | 244 | case SETTINGS_OK2: |
227 | #endif | 245 | #endif |
246 | #ifdef SETTINGS_RC_OK2 | ||
247 | case SETTINGS_RC_OK2: | ||
248 | #endif | ||
249 | #ifdef SETTINGS_RC_CANCEL | ||
250 | case SETTINGS_RC_CANCEL: | ||
251 | #endif | ||
228 | case SETTINGS_CANCEL: | 252 | case SETTINGS_CANCEL: |
229 | done = true; | 253 | done = true; |
230 | break; | 254 | break; |
@@ -232,11 +256,20 @@ bool show_info(void) | |||
232 | #ifdef HAVE_LCD_CHARCELLS | 256 | #ifdef HAVE_LCD_CHARCELLS |
233 | case SETTINGS_INC: | 257 | case SETTINGS_INC: |
234 | case SETTINGS_DEC: | 258 | case SETTINGS_DEC: |
259 | #ifdef SETTINGS_RC_INC | ||
260 | case SETTINGS_RC_INC: | ||
261 | #endif | ||
262 | #ifdef SETTINGS_RC_DEC | ||
263 | case SETTINGS_RC_DEC: | ||
264 | #endif | ||
235 | page = (page == 0) ? 1 : 0; | 265 | page = (page == 0) ? 1 : 0; |
236 | break; | 266 | break; |
237 | #endif | 267 | #endif |
238 | 268 | ||
239 | #ifndef SIMULATOR | 269 | #ifndef SIMULATOR |
270 | #ifdef SETTINGS_RC_ACCEPT | ||
271 | case SETTINGS_RC_ACCEPT: | ||
272 | #endif | ||
240 | #ifdef SETTINGS_ACCEPT | 273 | #ifdef SETTINGS_ACCEPT |
241 | case SETTINGS_ACCEPT: | 274 | case SETTINGS_ACCEPT: |
242 | #else | 275 | #else |