diff options
author | Kevin Ferrare <kevin@rockbox.org> | 2005-11-16 15:12:15 +0000 |
---|---|---|
committer | Kevin Ferrare <kevin@rockbox.org> | 2005-11-16 15:12:15 +0000 |
commit | e991beed6df8700b41796c4c14ef786f45fb54c5 (patch) | |
tree | 63543693276236f18a91c3de87e2353625eb85dc | |
parent | 76b75efa060b55bc7cbf66bae3401af57d907440 (diff) | |
download | rockbox-e991beed6df8700b41796c4c14ef786f45fb54c5.tar.gz rockbox-e991beed6df8700b41796c4c14ef786f45fb54c5.zip |
replaced all the splash calls by gui_sync_splash, added some missing remote key in the playlist viewer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7909 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/alarm_menu.c | 7 | ||||
-rw-r--r-- | apps/bookmark.c | 8 | ||||
-rw-r--r-- | apps/codecs.c | 6 | ||||
-rw-r--r-- | apps/database.c | 25 | ||||
-rw-r--r-- | apps/dbtree.c | 5 | ||||
-rw-r--r-- | apps/debug_menu.c | 4 | ||||
-rw-r--r-- | apps/filetree.c | 3 | ||||
-rw-r--r-- | apps/filetypes.c | 17 | ||||
-rw-r--r-- | apps/misc.c | 3 | ||||
-rw-r--r-- | apps/onplay.c | 5 | ||||
-rw-r--r-- | apps/playback.c | 9 | ||||
-rw-r--r-- | apps/playlist_viewer.c | 25 | ||||
-rw-r--r-- | apps/plugin.c | 15 | ||||
-rw-r--r-- | apps/recorder/radio.c | 6 | ||||
-rw-r--r-- | apps/recorder/recording.c | 6 | ||||
-rw-r--r-- | apps/screens.c | 172 | ||||
-rw-r--r-- | apps/screens.h | 6 | ||||
-rw-r--r-- | apps/settings_menu.c | 3 | ||||
-rw-r--r-- | apps/sound_menu.c | 3 | ||||
-rw-r--r-- | apps/wps-display.c | 6 | ||||
-rw-r--r-- | apps/wps.c | 4 |
21 files changed, 102 insertions, 236 deletions
diff --git a/apps/alarm_menu.c b/apps/alarm_menu.c index e8b421955c..9df664f8a8 100644 --- a/apps/alarm_menu.c +++ b/apps/alarm_menu.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include "alarm_menu.h" | 43 | #include "alarm_menu.h" |
44 | #include "backlight.h" | 44 | #include "backlight.h" |
45 | 45 | ||
46 | #include "splash.h" | ||
46 | #define MARGIN_Y (global_settings.statusbar ? STATUSBAR_HEIGHT : 0) | 47 | #define MARGIN_Y (global_settings.statusbar ? STATUSBAR_HEIGHT : 0) |
47 | 48 | ||
48 | bool alarm_screen(void) | 49 | bool alarm_screen(void) |
@@ -92,11 +93,11 @@ bool alarm_screen(void) | |||
92 | rtc_init(); | 93 | rtc_init(); |
93 | rtc_set_alarm(h,m); | 94 | rtc_set_alarm(h,m); |
94 | rtc_enable_alarm(true); | 95 | rtc_enable_alarm(true); |
95 | splash(HZ*2, true, str(LANG_ALARM_MOD_TIME_TO_GO), | 96 | gui_syncsplash(HZ*2, true, str(LANG_ALARM_MOD_TIME_TO_GO), |
96 | togo / 60, togo % 60); | 97 | togo / 60, togo % 60); |
97 | done = true; | 98 | done = true; |
98 | } else { | 99 | } else { |
99 | splash(HZ, true, str(LANG_ALARM_MOD_ERROR)); | 100 | gui_syncsplash(HZ, true, str(LANG_ALARM_MOD_ERROR)); |
100 | update = true; | 101 | update = true; |
101 | } | 102 | } |
102 | break; | 103 | break; |
@@ -146,7 +147,7 @@ bool alarm_screen(void) | |||
146 | case BUTTON_MENU: | 147 | case BUTTON_MENU: |
147 | #endif | 148 | #endif |
148 | rtc_enable_alarm(false); | 149 | rtc_enable_alarm(false); |
149 | splash(HZ*2, true, str(LANG_ALARM_MOD_DISABLE)); | 150 | gui_syncsplash(HZ*2, true, str(LANG_ALARM_MOD_DISABLE)); |
150 | done = true; | 151 | done = true; |
151 | break; | 152 | break; |
152 | 153 | ||
diff --git a/apps/bookmark.c b/apps/bookmark.c index 593bfe98cb..788aebe582 100644 --- a/apps/bookmark.c +++ b/apps/bookmark.c | |||
@@ -48,7 +48,7 @@ | |||
48 | #include "talk.h" | 48 | #include "talk.h" |
49 | #include "misc.h" | 49 | #include "misc.h" |
50 | #include "abrepeat.h" | 50 | #include "abrepeat.h" |
51 | 51 | #include "splash.h" | |
52 | #define MAX_BOOKMARKS 10 | 52 | #define MAX_BOOKMARKS 10 |
53 | #define MAX_BOOKMARK_SIZE 350 | 53 | #define MAX_BOOKMARK_SIZE 350 |
54 | #define RECENT_BOOKMARK_FILE ROCKBOX_DIR "/most-recent.bmark" | 54 | #define RECENT_BOOKMARK_FILE ROCKBOX_DIR "/most-recent.bmark" |
@@ -283,9 +283,9 @@ static bool write_bookmark(bool create_bookmark_file) | |||
283 | } | 283 | } |
284 | 284 | ||
285 | if (success) | 285 | if (success) |
286 | splash(HZ, true, str(LANG_BOOKMARK_CREATE_SUCCESS)); | 286 | gui_syncsplash(HZ, true, str(LANG_BOOKMARK_CREATE_SUCCESS)); |
287 | else | 287 | else |
288 | splash(HZ, true, str(LANG_BOOKMARK_CREATE_FAILURE)); | 288 | gui_syncsplash(HZ, true, str(LANG_BOOKMARK_CREATE_FAILURE)); |
289 | 289 | ||
290 | return true; | 290 | return true; |
291 | } | 291 | } |
@@ -621,7 +621,7 @@ static char* select_bookmark(const char* bookmark_file_name) | |||
621 | /* if there were no bookmarks in the file, delete the file and exit. */ | 621 | /* if there were no bookmarks in the file, delete the file and exit. */ |
622 | if(bookmark_id <= 0) | 622 | if(bookmark_id <= 0) |
623 | { | 623 | { |
624 | splash(HZ, true, str(LANG_BOOKMARK_LOAD_EMPTY)); | 624 | gui_syncsplash(HZ, true, str(LANG_BOOKMARK_LOAD_EMPTY)); |
625 | remove(bookmark_file_name); | 625 | remove(bookmark_file_name); |
626 | return NULL; | 626 | return NULL; |
627 | } | 627 | } |
diff --git a/apps/codecs.c b/apps/codecs.c index a227eb1fc4..e443127208 100644 --- a/apps/codecs.c +++ b/apps/codecs.c | |||
@@ -48,6 +48,8 @@ | |||
48 | #include "system.h" | 48 | #include "system.h" |
49 | #include "sound.h" | 49 | #include "sound.h" |
50 | #include "database.h" | 50 | #include "database.h" |
51 | #include "splash.h" | ||
52 | |||
51 | #if (CONFIG_CODEC == SWCODEC) | 53 | #if (CONFIG_CODEC == SWCODEC) |
52 | #include "pcm_playback.h" | 54 | #include "pcm_playback.h" |
53 | #endif | 55 | #endif |
@@ -94,7 +96,7 @@ struct codec_api ci = { | |||
94 | NULL, | 96 | NULL, |
95 | NULL, | 97 | NULL, |
96 | 98 | ||
97 | splash, | 99 | gui_syncsplash, |
98 | 100 | ||
99 | /* file */ | 101 | /* file */ |
100 | (open_func)PREFIX(open), | 102 | (open_func)PREFIX(open), |
@@ -304,7 +306,7 @@ int codec_load_file(const char *plugin, struct codec_api *api) | |||
304 | if (fd < 0) { | 306 | if (fd < 0) { |
305 | snprintf(msgbuf, sizeof(msgbuf)-1, "Couldn't load codec: %s", plugin); | 307 | snprintf(msgbuf, sizeof(msgbuf)-1, "Couldn't load codec: %s", plugin); |
306 | logf("Codec load error:%d", fd); | 308 | logf("Codec load error:%d", fd); |
307 | splash(HZ*2, true, msgbuf); | 309 | gui_syncsplash(HZ*2, true, msgbuf); |
308 | return fd; | 310 | return fd; |
309 | } | 311 | } |
310 | 312 | ||
diff --git a/apps/database.c b/apps/database.c index a84baa2a5c..6d74ce88a9 100644 --- a/apps/database.c +++ b/apps/database.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include "keyboard.h" | 43 | #include "keyboard.h" |
44 | #include "database.h" | 44 | #include "database.h" |
45 | #include "autoconf.h" | 45 | #include "autoconf.h" |
46 | #include "splash.h" | ||
46 | 47 | ||
47 | #if CONFIG_CODEC == SWCODEC | 48 | #if CONFIG_CODEC == SWCODEC |
48 | #include "playback.h" | 49 | #include "playback.h" |
@@ -94,7 +95,7 @@ int tagdb_init(void) | |||
94 | ptr[1] != 'D' || | 95 | ptr[1] != 'D' || |
95 | ptr[2] != 'B') | 96 | ptr[2] != 'B') |
96 | { | 97 | { |
97 | splash(HZ,true,"Not a rockbox ID3 database!"); | 98 | gui_syncsplash(HZ,true,"Not a rockbox ID3 database!"); |
98 | return -1; | 99 | return -1; |
99 | } | 100 | } |
100 | #ifdef ROCKBOX_LITTLE_ENDIAN | 101 | #ifdef ROCKBOX_LITTLE_ENDIAN |
@@ -106,7 +107,7 @@ int tagdb_init(void) | |||
106 | #endif | 107 | #endif |
107 | if ( (tagdbheader.version&0xFF) != TAGDB_VERSION) | 108 | if ( (tagdbheader.version&0xFF) != TAGDB_VERSION) |
108 | { | 109 | { |
109 | splash(HZ,true,"Unsupported database version %d!", | 110 | gui_syncsplash(HZ,true,"Unsupported database version %d!", |
110 | tagdbheader.version&0xFF); | 111 | tagdbheader.version&0xFF); |
111 | return -1; | 112 | return -1; |
112 | } | 113 | } |
@@ -115,7 +116,7 @@ int tagdb_init(void) | |||
115 | tagdbheader.albumstart > tagdbheader.songstart || | 116 | tagdbheader.albumstart > tagdbheader.songstart || |
116 | tagdbheader.artiststart > tagdbheader.albumstart) | 117 | tagdbheader.artiststart > tagdbheader.albumstart) |
117 | { | 118 | { |
118 | splash(HZ,true,"Corrupt ID3 database!"); | 119 | gui_syncsplash(HZ,true,"Corrupt ID3 database!"); |
119 | return -1; | 120 | return -1; |
120 | } | 121 | } |
121 | 122 | ||
@@ -232,7 +233,7 @@ void update_fentryoffsets(int start, int end) | |||
232 | } | 233 | } |
233 | } | 234 | } |
234 | if(fe.rundbentry!=-1) { | 235 | if(fe.rundbentry!=-1) { |
235 | splash(HZ*2,true, "o.o.. found a rundbentry? o.o; didn't update " | 236 | gui_syncsplash(HZ*2,true, "o.o.. found a rundbentry? o.o; didn't update " |
236 | "it, update the code o.o;"); | 237 | "it, update the code o.o;"); |
237 | } | 238 | } |
238 | } | 239 | } |
@@ -242,7 +243,7 @@ int tagdb_shiftdown(int targetoffset, int startingoffset, int bytes) | |||
242 | { | 243 | { |
243 | int amount; | 244 | int amount; |
244 | if(targetoffset>=startingoffset) { | 245 | if(targetoffset>=startingoffset) { |
245 | splash(HZ*2,true,"Woah. no beeping way. (tagdb_shiftdown)"); | 246 | gui_syncsplash(HZ*2,true,"Woah. no beeping way. (tagdb_shiftdown)"); |
246 | return 0; | 247 | return 0; |
247 | } | 248 | } |
248 | lseek(tagdb_fd,startingoffset,SEEK_SET); | 249 | lseek(tagdb_fd,startingoffset,SEEK_SET); |
@@ -253,7 +254,7 @@ int tagdb_shiftdown(int targetoffset, int startingoffset, int bytes) | |||
253 | written=write(tagdb_fd,sbuf,amount); | 254 | written=write(tagdb_fd,sbuf,amount); |
254 | targetoffset+=written; | 255 | targetoffset+=written; |
255 | if(amount!=written) { | 256 | if(amount!=written) { |
256 | splash(HZ*2,true,"Something went very wrong. expect database " | 257 | gui_syncsplash(HZ*2,true,"Something went very wrong. expect database " |
257 | "corruption. (tagdb_shiftdown)"); | 258 | "corruption. (tagdb_shiftdown)"); |
258 | return 0; | 259 | return 0; |
259 | } | 260 | } |
@@ -268,7 +269,7 @@ int tagdb_shiftup(int targetoffset, int startingoffset, int bytes) | |||
268 | int amount,amount2; | 269 | int amount,amount2; |
269 | int readpos,writepos,filelen; | 270 | int readpos,writepos,filelen; |
270 | if(targetoffset<=startingoffset) { | 271 | if(targetoffset<=startingoffset) { |
271 | splash(HZ*2,true,"Um. no. (tagdb_shiftup)"); | 272 | gui_syncsplash(HZ*2,true,"Um. no. (tagdb_shiftup)"); |
272 | return 0; | 273 | return 0; |
273 | } | 274 | } |
274 | filelen=lseek(tagdb_fd,0,SEEK_END); | 275 | filelen=lseek(tagdb_fd,0,SEEK_END); |
@@ -280,14 +281,14 @@ int tagdb_shiftup(int targetoffset, int startingoffset, int bytes) | |||
280 | lseek(tagdb_fd,readpos,SEEK_SET); | 281 | lseek(tagdb_fd,readpos,SEEK_SET); |
281 | amount2=read(tagdb_fd,sbuf,amount); | 282 | amount2=read(tagdb_fd,sbuf,amount); |
282 | if(amount2!=amount) { | 283 | if(amount2!=amount) { |
283 | splash(HZ*2,true,"Something went very wrong. expect database " | 284 | gui_syncsplash(HZ*2,true,"Something went very wrong. expect database " |
284 | "corruption. (tagdb_shiftup)"); | 285 | "corruption. (tagdb_shiftup)"); |
285 | return 0; | 286 | return 0; |
286 | } | 287 | } |
287 | lseek(tagdb_fd,writepos,SEEK_SET); | 288 | lseek(tagdb_fd,writepos,SEEK_SET); |
288 | amount=write(tagdb_fd,sbuf,amount2); | 289 | amount=write(tagdb_fd,sbuf,amount2); |
289 | if(amount2!=amount) { | 290 | if(amount2!=amount) { |
290 | splash(HZ*2,true,"Something went very wrong. expect database " | 291 | gui_syncsplash(HZ*2,true,"Something went very wrong. expect database " |
291 | "corruption. (tagdb_shiftup)"); | 292 | "corruption. (tagdb_shiftup)"); |
292 | return 0; | 293 | return 0; |
293 | } | 294 | } |
@@ -296,7 +297,7 @@ int tagdb_shiftup(int targetoffset, int startingoffset, int bytes) | |||
296 | if(bytes==0) | 297 | if(bytes==0) |
297 | return 1; | 298 | return 1; |
298 | else { | 299 | else { |
299 | splash(HZ*2,true,"Something went wrong, >.>;; (tagdb_shiftup)"); | 300 | gui_syncsplash(HZ*2,true,"Something went wrong, >.>;; (tagdb_shiftup)"); |
300 | return 0; | 301 | return 0; |
301 | } | 302 | } |
302 | } | 303 | } |
@@ -361,7 +362,7 @@ int rundb_init(void) | |||
361 | ptr[1] != 'R' || | 362 | ptr[1] != 'R' || |
362 | ptr[2] != 'D') | 363 | ptr[2] != 'D') |
363 | { | 364 | { |
364 | splash(HZ,true,"Not a rockbox runtime database!"); | 365 | gui_syncsplash(HZ,true,"Not a rockbox runtime database!"); |
365 | return -1; | 366 | return -1; |
366 | } | 367 | } |
367 | #ifdef ROCKBOX_LITTLE_ENDIAN | 368 | #ifdef ROCKBOX_LITTLE_ENDIAN |
@@ -373,7 +374,7 @@ int rundb_init(void) | |||
373 | #endif | 374 | #endif |
374 | if ( (rundbheader.version&0xFF) != RUNDB_VERSION) | 375 | if ( (rundbheader.version&0xFF) != RUNDB_VERSION) |
375 | { | 376 | { |
376 | splash(HZ,true,"Unsupported runtime database version %d!", | 377 | gui_syncsplash(HZ,true,"Unsupported runtime database version %d!", |
377 | rundbheader.version&0xFF); | 378 | rundbheader.version&0xFF); |
378 | return -1; | 379 | return -1; |
379 | } | 380 | } |
diff --git a/apps/dbtree.c b/apps/dbtree.c index 9ea0706245..9115c5902c 100644 --- a/apps/dbtree.c +++ b/apps/dbtree.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include "keyboard.h" | 44 | #include "keyboard.h" |
45 | #include "autoconf.h" | 45 | #include "autoconf.h" |
46 | #include "list.h" | 46 | #include "list.h" |
47 | #include "splash.h" | ||
47 | 48 | ||
48 | static int db_play_folder(struct tree_context* c); | 49 | static int db_play_folder(struct tree_context* c); |
49 | static int db_search(struct tree_context* c, char* string); | 50 | static int db_search(struct tree_context* c, char* string); |
@@ -130,13 +131,13 @@ int db_load(struct tree_context* c) | |||
130 | i = db_search(c, searchstring); | 131 | i = db_search(c, searchstring); |
131 | c->dirlength = c->filesindir = i; | 132 | c->dirlength = c->filesindir = i; |
132 | if (c->dirfull) { | 133 | if (c->dirfull) { |
133 | splash(HZ, true, "%s %s", | 134 | gui_syncsplash(HZ, true, "%s %s", |
134 | str(LANG_SHOWDIR_ERROR_BUFFER), | 135 | str(LANG_SHOWDIR_ERROR_BUFFER), |
135 | str(LANG_SHOWDIR_ERROR_FULL)); | 136 | str(LANG_SHOWDIR_ERROR_FULL)); |
136 | c->dirfull = false; | 137 | c->dirfull = false; |
137 | } | 138 | } |
138 | else | 139 | else |
139 | splash(HZ, true, str(LANG_ID3DB_MATCHES), i); | 140 | gui_syncsplash(HZ, true, str(LANG_ID3DB_MATCHES), i); |
140 | return i; | 141 | return i; |
141 | 142 | ||
142 | case allsongs: | 143 | case allsongs: |
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 79448b14aa..1364637ab0 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -47,6 +47,8 @@ | |||
47 | #include "panic.h" | 47 | #include "panic.h" |
48 | #include "screens.h" | 48 | #include "screens.h" |
49 | #include "misc.h" | 49 | #include "misc.h" |
50 | #include "splash.h" | ||
51 | |||
50 | #ifdef HAVE_LCD_BITMAP | 52 | #ifdef HAVE_LCD_BITMAP |
51 | #include "widgets.h" | 53 | #include "widgets.h" |
52 | #include "peakmeter.h" | 54 | #include "peakmeter.h" |
@@ -1748,7 +1750,7 @@ extern bool do_screendump_instead_of_usb; | |||
1748 | bool dbg_screendump(void) | 1750 | bool dbg_screendump(void) |
1749 | { | 1751 | { |
1750 | do_screendump_instead_of_usb = !do_screendump_instead_of_usb; | 1752 | do_screendump_instead_of_usb = !do_screendump_instead_of_usb; |
1751 | splash(HZ, true, "Screendump %s", | 1753 | gui_syncsplash(HZ, true, "Screendump %s", |
1752 | do_screendump_instead_of_usb?"enabled":"disabled"); | 1754 | do_screendump_instead_of_usb?"enabled":"disabled"); |
1753 | return false; | 1755 | return false; |
1754 | } | 1756 | } |
diff --git a/apps/filetree.c b/apps/filetree.c index 8a365cc574..a873d85f1c 100644 --- a/apps/filetree.c +++ b/apps/filetree.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include "rolo.h" | 39 | #include "rolo.h" |
40 | #include "sprintf.h" | 40 | #include "sprintf.h" |
41 | #include "dircache.h" | 41 | #include "dircache.h" |
42 | #include "splash.h" | ||
42 | 43 | ||
43 | #ifndef SIMULATOR | 44 | #ifndef SIMULATOR |
44 | static int boot_size = 0; | 45 | static int boot_size = 0; |
@@ -406,7 +407,7 @@ int ft_enter(struct tree_context* c) | |||
406 | set_file(buf, global_settings.lang_file, | 407 | set_file(buf, global_settings.lang_file, |
407 | MAX_FILENAME); | 408 | MAX_FILENAME); |
408 | talk_init(); /* use voice of same language */ | 409 | talk_init(); /* use voice of same language */ |
409 | splash(HZ, true, str(LANG_LANGUAGE_LOADED)); | 410 | gui_syncsplash(HZ, true, str(LANG_LANGUAGE_LOADED)); |
410 | } | 411 | } |
411 | break; | 412 | break; |
412 | 413 | ||
diff --git a/apps/filetypes.c b/apps/filetypes.c index d5a900317f..e2240089ce 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include "dir.h" | 35 | #include "dir.h" |
36 | #include "file.h" | 36 | #include "file.h" |
37 | #include "icons.h" | 37 | #include "icons.h" |
38 | #include "splash.h" | ||
38 | 39 | ||
39 | /* max plugin name size without extensions and path */ | 40 | /* max plugin name size without extensions and path */ |
40 | #define MAX_PLUGIN_LENGTH 32 | 41 | #define MAX_PLUGIN_LENGTH 32 |
@@ -316,14 +317,14 @@ static void scan_plugins(void) | |||
316 | /* exttypes[] full, bail out */ | 317 | /* exttypes[] full, bail out */ |
317 | if (cnt_exttypes >= MAX_EXTTYPES) | 318 | if (cnt_exttypes >= MAX_EXTTYPES) |
318 | { | 319 | { |
319 | splash(HZ,true,str(LANG_FILETYPES_EXTENSION_FULL)); | 320 | gui_syncsplash(HZ,true,str(LANG_FILETYPES_EXTENSION_FULL)); |
320 | break; | 321 | break; |
321 | } | 322 | } |
322 | 323 | ||
323 | /* filetypes[] full, bail out */ | 324 | /* filetypes[] full, bail out */ |
324 | if (cnt_filetypes >= MAX_FILETYPES) | 325 | if (cnt_filetypes >= MAX_FILETYPES) |
325 | { | 326 | { |
326 | splash(HZ,true,str(LANG_FILETYPES_FULL)); | 327 | gui_syncsplash(HZ,true,str(LANG_FILETYPES_FULL)); |
327 | break; | 328 | break; |
328 | } | 329 | } |
329 | 330 | ||
@@ -356,7 +357,7 @@ static void scan_plugins(void) | |||
356 | /* filter out to long filenames */ | 357 | /* filter out to long filenames */ |
357 | if (strlen(entry->d_name) > MAX_PLUGIN_LENGTH + 5) | 358 | if (strlen(entry->d_name) > MAX_PLUGIN_LENGTH + 5) |
358 | { | 359 | { |
359 | splash(HZ,true,str(LANG_FILETYPES_PLUGIN_NAME_LONG)); | 360 | gui_syncsplash(HZ,true,str(LANG_FILETYPES_PLUGIN_NAME_LONG)); |
360 | continue; | 361 | continue; |
361 | } | 362 | } |
362 | 363 | ||
@@ -537,13 +538,13 @@ bool read_config(const char* file) | |||
537 | { | 538 | { |
538 | if (cnt_exttypes >= MAX_EXTTYPES) | 539 | if (cnt_exttypes >= MAX_EXTTYPES) |
539 | { | 540 | { |
540 | splash(HZ,true,str(LANG_FILETYPES_EXTENSION_FULL)); | 541 | gui_syncsplash(HZ,true,str(LANG_FILETYPES_EXTENSION_FULL)); |
541 | break; | 542 | break; |
542 | } | 543 | } |
543 | 544 | ||
544 | if (cnt_filetypes >= MAX_FILETYPES) | 545 | if (cnt_filetypes >= MAX_FILETYPES) |
545 | { | 546 | { |
546 | splash(HZ,true,str(LANG_FILETYPES_FULL)); | 547 | gui_syncsplash(HZ,true,str(LANG_FILETYPES_FULL)); |
547 | break; | 548 | break; |
548 | } | 549 | } |
549 | 550 | ||
@@ -612,7 +613,7 @@ bool read_config(const char* file) | |||
612 | { | 613 | { |
613 | if (strlen(str[plugin]) > MAX_PLUGIN_LENGTH) | 614 | if (strlen(str[plugin]) > MAX_PLUGIN_LENGTH) |
614 | { | 615 | { |
615 | splash(HZ, true, str(LANG_FILETYPES_PLUGIN_NAME_LONG)); | 616 | gui_syncsplash(HZ, true, str(LANG_FILETYPES_PLUGIN_NAME_LONG)); |
616 | str[plugin] = NULL; | 617 | str[plugin] = NULL; |
617 | continue; | 618 | continue; |
618 | } | 619 | } |
@@ -712,7 +713,7 @@ static char* string2icon(const char* str) | |||
712 | (unsigned long) string_buffer - | 713 | (unsigned long) string_buffer - |
713 | (unsigned long) next_free_string) < ICON_LENGTH) | 714 | (unsigned long) next_free_string) < ICON_LENGTH) |
714 | { | 715 | { |
715 | splash(HZ,true,str(LANG_FILETYPES_STRING_BUFFER_EMPTY)); | 716 | gui_syncsplash(HZ,true,str(LANG_FILETYPES_STRING_BUFFER_EMPTY)); |
716 | return NULL; | 717 | return NULL; |
717 | } | 718 | } |
718 | 719 | ||
@@ -768,7 +769,7 @@ static char* get_string(const char* str) | |||
768 | } | 769 | } |
769 | else | 770 | else |
770 | { | 771 | { |
771 | splash(HZ,true,str(LANG_FILETYPES_STRING_BUFFER_EMPTY)); | 772 | gui_syncsplash(HZ,true,str(LANG_FILETYPES_STRING_BUFFER_EMPTY)); |
772 | return NULL; | 773 | return NULL; |
773 | } | 774 | } |
774 | } | 775 | } |
diff --git a/apps/misc.c b/apps/misc.c index a91a1a250f..986a52ccb5 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include "atoi.h" | 43 | #include "atoi.h" |
44 | #include "version.h" | 44 | #include "version.h" |
45 | #include "font.h" | 45 | #include "font.h" |
46 | #include "splash.h" | ||
46 | #ifdef HAVE_MMC | 47 | #ifdef HAVE_MMC |
47 | #include "ata_mmc.h" | 48 | #include "ata_mmc.h" |
48 | #endif | 49 | #endif |
@@ -442,7 +443,7 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter) | |||
442 | #endif | 443 | #endif |
443 | { | 444 | { |
444 | lcd_clear_display(); | 445 | lcd_clear_display(); |
445 | splash(0, true, str(LANG_SHUTTINGDOWN)); | 446 | gui_syncsplash(0, true, str(LANG_SHUTTINGDOWN)); |
446 | if (callback != NULL) | 447 | if (callback != NULL) |
447 | callback(parameter); | 448 | callback(parameter); |
448 | 449 | ||
diff --git a/apps/onplay.c b/apps/onplay.c index c71a75ac6d..36ea95771a 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #include "bookmark.h" | 48 | #include "bookmark.h" |
49 | #include "wps.h" | 49 | #include "wps.h" |
50 | #include "action.h" | 50 | #include "action.h" |
51 | #include "splash.h" | ||
51 | #ifdef HAVE_LCD_BITMAP | 52 | #ifdef HAVE_LCD_BITMAP |
52 | #include "icons.h" | 53 | #include "icons.h" |
53 | #endif | 54 | #endif |
@@ -125,7 +126,7 @@ static bool list_viewers(void) | |||
125 | } | 126 | } |
126 | else | 127 | else |
127 | { | 128 | { |
128 | splash(HZ*2, true, "No viewers found"); | 129 | gui_syncsplash(HZ*2, true, "No viewers found"); |
129 | } | 130 | } |
130 | 131 | ||
131 | if (ret == PLUGIN_USB_CONNECTED) | 132 | if (ret == PLUGIN_USB_CONNECTED) |
@@ -495,7 +496,7 @@ bool create_dir(void) | |||
495 | 496 | ||
496 | rc = mkdir(dirname, 0); | 497 | rc = mkdir(dirname, 0); |
497 | if (rc < 0) { | 498 | if (rc < 0) { |
498 | splash(HZ, true, "%s %s", str(LANG_CREATE_DIR), str(LANG_FAILED)); | 499 | gui_syncsplash(HZ, true, "%s %s", str(LANG_CREATE_DIR), str(LANG_FAILED)); |
499 | } else { | 500 | } else { |
500 | onplay_result = ONPLAY_RELOAD_DIR; | 501 | onplay_result = ONPLAY_RELOAD_DIR; |
501 | } | 502 | } |
diff --git a/apps/playback.c b/apps/playback.c index 37a86d511c..7f28331b75 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -65,6 +65,7 @@ | |||
65 | #include "radio.h" | 65 | #include "radio.h" |
66 | #include "power.h" | 66 | #include "power.h" |
67 | #endif | 67 | #endif |
68 | #include "splash.h" | ||
68 | 69 | ||
69 | static volatile bool audio_codec_loaded; | 70 | static volatile bool audio_codec_loaded; |
70 | static volatile bool voice_codec_loaded; | 71 | static volatile bool voice_codec_loaded; |
@@ -918,7 +919,7 @@ bool loadcodec(const char *trackname, bool start_play) | |||
918 | default: | 919 | default: |
919 | logf("Codec: Unsupported"); | 920 | logf("Codec: Unsupported"); |
920 | snprintf(msgbuf, sizeof(msgbuf)-1, "No codec for: %s", trackname); | 921 | snprintf(msgbuf, sizeof(msgbuf)-1, "No codec for: %s", trackname); |
921 | splash(HZ*2, true, msgbuf); | 922 | gui_syncsplash(HZ*2, true, msgbuf); |
922 | codec_path = NULL; | 923 | codec_path = NULL; |
923 | } | 924 | } |
924 | 925 | ||
@@ -952,7 +953,7 @@ bool loadcodec(const char *trackname, bool start_play) | |||
952 | if (fd < 0) { | 953 | if (fd < 0) { |
953 | logf("Codec doesn't exist!"); | 954 | logf("Codec doesn't exist!"); |
954 | snprintf(msgbuf, sizeof(msgbuf)-1, "Couldn't load codec: %s", codec_path); | 955 | snprintf(msgbuf, sizeof(msgbuf)-1, "Couldn't load codec: %s", codec_path); |
955 | splash(HZ*2, true, msgbuf); | 956 | gui_syncsplash(HZ*2, true, msgbuf); |
956 | return false; | 957 | return false; |
957 | } | 958 | } |
958 | 959 | ||
@@ -1872,7 +1873,7 @@ void codec_thread(void) | |||
1872 | if (status != CODEC_OK) { | 1873 | if (status != CODEC_OK) { |
1873 | logf("Codec failure"); | 1874 | logf("Codec failure"); |
1874 | audio_stop_playback(); | 1875 | audio_stop_playback(); |
1875 | splash(HZ*2, true, "Codec failure"); | 1876 | gui_syncsplash(HZ*2, true, "Codec failure"); |
1876 | } else { | 1877 | } else { |
1877 | logf("Codec finished"); | 1878 | logf("Codec finished"); |
1878 | } | 1879 | } |
@@ -2266,7 +2267,7 @@ void audio_set_crossfade(int enable) | |||
2266 | 2267 | ||
2267 | /* Re-initialize audio system. */ | 2268 | /* Re-initialize audio system. */ |
2268 | if (was_playing) | 2269 | if (was_playing) |
2269 | splash(0, true, str(LANG_RESTARTING_PLAYBACK)); | 2270 | gui_syncsplash(0, true, str(LANG_RESTARTING_PLAYBACK)); |
2270 | pcmbuf_init(size); | 2271 | pcmbuf_init(size); |
2271 | pcmbuf_crossfade_enable(enable); | 2272 | pcmbuf_crossfade_enable(enable); |
2272 | reset_buffer(); | 2273 | reset_buffer(); |
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index 36acb9b897..3f0e27d9e9 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c | |||
@@ -673,15 +673,30 @@ bool playlist_viewer_ex(char* filename) | |||
673 | switch (button) | 673 | switch (button) |
674 | { | 674 | { |
675 | case TREE_EXIT: | 675 | case TREE_EXIT: |
676 | #ifdef TREE_RC_EXIT | ||
677 | case TREE_RC_EXIT: | ||
678 | #endif | ||
676 | #ifdef TREE_OFF | 679 | #ifdef TREE_OFF |
677 | case TREE_OFF: | 680 | case TREE_OFF: |
678 | #endif | 681 | #endif |
679 | exit = true; | 682 | exit = true; |
680 | break; | 683 | break; |
681 | 684 | ||
685 | #ifdef TREE_ENTER | ||
686 | case TREE_ENTER: | ||
687 | case TREE_ENTER | BUTTON_REPEAT: | ||
688 | #endif | ||
689 | #ifdef TREE_RC_RUN | ||
690 | case TREE_RC_RUN: | ||
691 | #endif | ||
682 | case TREE_RUN: | 692 | case TREE_RUN: |
683 | #ifdef TREE_RUN_PRE | 693 | #ifdef TREE_RUN_PRE |
684 | if (lastbutton != TREE_RUN_PRE) | 694 | if (((button == TREE_RUN) |
695 | #ifdef TREE_RC_RUN_PRE | ||
696 | || (button == TREE_RC_RUN)) | ||
697 | && ((lastbutton != TREE_RC_RUN_PRE) | ||
698 | #endif | ||
699 | && (lastbutton != TREE_RUN_PRE))) | ||
685 | break; | 700 | break; |
686 | #endif | 701 | #endif |
687 | struct playlist_entry * current_track=playlist_buffer_get_track(&viewer.buffer, viewer.selected_track); | 702 | struct playlist_entry * current_track=playlist_buffer_get_track(&viewer.buffer, viewer.selected_track); |
@@ -723,6 +738,9 @@ bool playlist_viewer_ex(char* filename) | |||
723 | #ifdef TREE_CONTEXT2 | 738 | #ifdef TREE_CONTEXT2 |
724 | case TREE_CONTEXT2: | 739 | case TREE_CONTEXT2: |
725 | #endif | 740 | #endif |
741 | #ifdef TREE_RC_CONTEXT | ||
742 | case TREE_RC_CONTEXT: | ||
743 | #endif | ||
726 | { | 744 | { |
727 | /* ON+PLAY menu */ | 745 | /* ON+PLAY menu */ |
728 | int ret; | 746 | int ret; |
@@ -747,6 +765,9 @@ bool playlist_viewer_ex(char* filename) | |||
747 | } | 765 | } |
748 | 766 | ||
749 | case TREE_MENU: | 767 | case TREE_MENU: |
768 | #ifdef TREE_RC_MENU | ||
769 | case TREE_RC_MENU: | ||
770 | #endif | ||
750 | if (viewer_menu()) | 771 | if (viewer_menu()) |
751 | { | 772 | { |
752 | ret = true; | 773 | ret = true; |
diff --git a/apps/plugin.c b/apps/plugin.c index b1560c7182..a30b089e55 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #include "timer.h" | 48 | #include "timer.h" |
49 | #include "sound.h" | 49 | #include "sound.h" |
50 | #include "database.h" | 50 | #include "database.h" |
51 | #include "splash.h" | ||
51 | #if (CONFIG_CODEC == SWCODEC) | 52 | #if (CONFIG_CODEC == SWCODEC) |
52 | #include "pcm_playback.h" | 53 | #include "pcm_playback.h" |
53 | #endif | 54 | #endif |
@@ -138,7 +139,7 @@ static const struct plugin_api rockbox_api = { | |||
138 | backlight_on, | 139 | backlight_on, |
139 | backlight_off, | 140 | backlight_off, |
140 | backlight_set_timeout, | 141 | backlight_set_timeout, |
141 | splash, | 142 | gui_syncsplash, |
142 | #ifdef HAVE_REMOTE_LCD | 143 | #ifdef HAVE_REMOTE_LCD |
143 | /* remote lcd */ | 144 | /* remote lcd */ |
144 | lcd_remote_set_contrast, | 145 | lcd_remote_set_contrast, |
@@ -400,7 +401,7 @@ int plugin_load(const char* plugin, void* parameter) | |||
400 | fd = open(plugin, O_RDONLY); | 401 | fd = open(plugin, O_RDONLY); |
401 | if (fd < 0) { | 402 | if (fd < 0) { |
402 | snprintf(buf, sizeof buf, str(LANG_PLUGIN_CANT_OPEN), plugin); | 403 | snprintf(buf, sizeof buf, str(LANG_PLUGIN_CANT_OPEN), plugin); |
403 | splash(HZ*2, true, buf); | 404 | gui_syncsplash(HZ*2, true, buf); |
404 | return fd; | 405 | return fd; |
405 | } | 406 | } |
406 | 407 | ||
@@ -413,12 +414,12 @@ int plugin_load(const char* plugin, void* parameter) | |||
413 | if (plugin_size < 0) { | 414 | if (plugin_size < 0) { |
414 | /* read error */ | 415 | /* read error */ |
415 | snprintf(buf, sizeof buf, str(LANG_READ_FAILED), plugin); | 416 | snprintf(buf, sizeof buf, str(LANG_READ_FAILED), plugin); |
416 | splash(HZ*2, true, buf); | 417 | gui_syncsplash(HZ*2, true, buf); |
417 | return -1; | 418 | return -1; |
418 | } | 419 | } |
419 | if (plugin_size == 0) { | 420 | if (plugin_size == 0) { |
420 | /* loaded a 0-byte plugin, implying it's not for this model */ | 421 | /* loaded a 0-byte plugin, implying it's not for this model */ |
421 | splash(HZ*2, true, str(LANG_PLUGIN_WRONG_MODEL)); | 422 | gui_syncsplash(HZ*2, true, str(LANG_PLUGIN_WRONG_MODEL)); |
422 | return -1; | 423 | return -1; |
423 | } | 424 | } |
424 | #endif | 425 | #endif |
@@ -450,15 +451,15 @@ int plugin_load(const char* plugin, void* parameter) | |||
450 | return PLUGIN_USB_CONNECTED; | 451 | return PLUGIN_USB_CONNECTED; |
451 | 452 | ||
452 | case PLUGIN_WRONG_API_VERSION: | 453 | case PLUGIN_WRONG_API_VERSION: |
453 | splash(HZ*2, true, str(LANG_PLUGIN_WRONG_VERSION)); | 454 | gui_syncsplash(HZ*2, true, str(LANG_PLUGIN_WRONG_VERSION)); |
454 | break; | 455 | break; |
455 | 456 | ||
456 | case PLUGIN_WRONG_MODEL: | 457 | case PLUGIN_WRONG_MODEL: |
457 | splash(HZ*2, true, str(LANG_PLUGIN_WRONG_MODEL)); | 458 | gui_syncsplash(HZ*2, true, str(LANG_PLUGIN_WRONG_MODEL)); |
458 | break; | 459 | break; |
459 | 460 | ||
460 | default: | 461 | default: |
461 | splash(HZ*2, true, str(LANG_PLUGIN_ERROR)); | 462 | gui_syncsplash(HZ*2, true, str(LANG_PLUGIN_ERROR)); |
462 | break; | 463 | break; |
463 | } | 464 | } |
464 | 465 | ||
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c index fa0f091156..1c54602e73 100644 --- a/apps/recorder/radio.c +++ b/apps/recorder/radio.c | |||
@@ -814,7 +814,7 @@ bool radio_screen(void) | |||
814 | #ifndef SIMULATOR | 814 | #ifndef SIMULATOR |
815 | if(audio_status() & AUDIO_STATUS_ERROR) | 815 | if(audio_status() & AUDIO_STATUS_ERROR) |
816 | { | 816 | { |
817 | splash(0, true, str(LANG_DISK_FULL)); | 817 | gui_syncsplash(0, true, str(LANG_DISK_FULL)); |
818 | gui_syncstatusbar_draw(&statusbars,true); | 818 | gui_syncstatusbar_draw(&statusbars,true); |
819 | FOR_NB_SCREENS(i) | 819 | FOR_NB_SCREENS(i) |
820 | gui_textarea_update(&screens[i]); | 820 | gui_textarea_update(&screens[i]); |
@@ -878,7 +878,7 @@ void radio_save_presets(void) | |||
878 | } | 878 | } |
879 | else | 879 | else |
880 | { | 880 | { |
881 | splash(HZ*2, true, str(LANG_FM_PRESET_SAVE_FAILED)); | 881 | gui_syncsplash(HZ*2, true, str(LANG_FM_PRESET_SAVE_FAILED)); |
882 | } | 882 | } |
883 | } | 883 | } |
884 | 884 | ||
@@ -959,7 +959,7 @@ bool radio_add_preset(void) | |||
959 | } | 959 | } |
960 | else | 960 | else |
961 | { | 961 | { |
962 | splash(HZ*2, true, str(LANG_FM_NO_FREE_PRESETS)); | 962 | gui_syncsplash(HZ*2, true, str(LANG_FM_NO_FREE_PRESETS)); |
963 | } | 963 | } |
964 | return true; | 964 | return true; |
965 | } | 965 | } |
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index 62b5dff489..eda56a5bf9 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c | |||
@@ -59,7 +59,7 @@ | |||
59 | #include "atoi.h" | 59 | #include "atoi.h" |
60 | #include "sound.h" | 60 | #include "sound.h" |
61 | #include "ata.h" | 61 | #include "ata.h" |
62 | 62 | #include "splash.h" | |
63 | #ifdef HAVE_RECORDING | 63 | #ifdef HAVE_RECORDING |
64 | 64 | ||
65 | 65 | ||
@@ -228,7 +228,7 @@ int rec_create_directory(void) | |||
228 | rc = mkdir(rec_base_directory, 0); | 228 | rc = mkdir(rec_base_directory, 0); |
229 | if(rc < 0 && errno != EEXIST) | 229 | if(rc < 0 && errno != EEXIST) |
230 | { | 230 | { |
231 | splash(HZ * 2, true, | 231 | gui_syncsplash(HZ * 2, true, |
232 | "Can't create the %s directory. Error code %d.", | 232 | "Can't create the %s directory. Error code %d.", |
233 | rec_base_directory, rc); | 233 | rec_base_directory, rc); |
234 | return -1; | 234 | return -1; |
@@ -859,7 +859,7 @@ bool recording_screen(void) | |||
859 | #endif | 859 | #endif |
860 | if (audio_stat & AUDIO_STATUS_ERROR) | 860 | if (audio_stat & AUDIO_STATUS_ERROR) |
861 | { | 861 | { |
862 | splash(0, true, str(LANG_DISK_FULL)); | 862 | gui_syncsplash(0, true, str(LANG_DISK_FULL)); |
863 | status_draw(true); | 863 | status_draw(true); |
864 | lcd_update(); | 864 | lcd_update(); |
865 | audio_error_clear(); | 865 | audio_error_clear(); |
diff --git a/apps/screens.c b/apps/screens.c index f3e00dfc0a..978d2a12f8 100644 --- a/apps/screens.c +++ b/apps/screens.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include "sound.h" | 47 | #include "sound.h" |
48 | #include "abrepeat.h" | 48 | #include "abrepeat.h" |
49 | #include "wps-display.h" | 49 | #include "wps-display.h" |
50 | #include "splash.h" | ||
50 | #if defined(HAVE_LCD_BITMAP) | 51 | #if defined(HAVE_LCD_BITMAP) |
51 | #include "widgets.h" | 52 | #include "widgets.h" |
52 | #endif | 53 | #endif |
@@ -155,7 +156,7 @@ int mmc_remove_request(void) | |||
155 | struct event ev; | 156 | struct event ev; |
156 | 157 | ||
157 | lcd_clear_display(); | 158 | lcd_clear_display(); |
158 | splash(1, true, str(LANG_REMOVE_MMC)); | 159 | gui_syncsplash(1, true, str(LANG_REMOVE_MMC)); |
159 | if (global_settings.talk_menu) | 160 | if (global_settings.talk_menu) |
160 | talk_id(LANG_REMOVE_MMC, false); | 161 | talk_id(LANG_REMOVE_MMC, false); |
161 | 162 | ||
@@ -771,175 +772,10 @@ bool quick_screen(int context, int button) | |||
771 | } | 772 | } |
772 | #endif | 773 | #endif |
773 | 774 | ||
774 | #ifdef HAVE_LCD_BITMAP | ||
775 | #define SPACE 3 /* pixels between words */ | ||
776 | #define MAXLETTERS 128 /* 16*8 */ | ||
777 | #define MAXLINES 10 | ||
778 | #else | ||
779 | #define SPACE 1 /* one letter space */ | ||
780 | #undef LCD_WIDTH | ||
781 | #define LCD_WIDTH 11 | ||
782 | #undef LCD_HEIGHT | ||
783 | #define LCD_HEIGHT 2 | ||
784 | #define MAXLETTERS 22 /* 11 * 2 */ | ||
785 | #define MAXLINES 2 | ||
786 | #endif | ||
787 | |||
788 | void splash(int ticks, /* how long the splash is displayed */ | ||
789 | bool center, /* FALSE means left-justified, TRUE means | ||
790 | horizontal and vertical center */ | ||
791 | const char *fmt, /* what to say *printf style */ | ||
792 | ...) | ||
793 | { | ||
794 | char *next; | ||
795 | char *store=NULL; | ||
796 | int x=0; | ||
797 | int y=0; | ||
798 | int w, h; | ||
799 | unsigned char splash_buf[MAXLETTERS]; | ||
800 | va_list ap; | ||
801 | unsigned char widths[MAXLINES]; | ||
802 | int line=0; | ||
803 | bool first=true; | ||
804 | #ifdef HAVE_LCD_BITMAP | ||
805 | int maxw=0; | ||
806 | #endif | ||
807 | |||
808 | #ifdef HAVE_LCD_CHARCELLS | ||
809 | lcd_double_height (false); | ||
810 | #endif | ||
811 | va_start( ap, fmt ); | ||
812 | vsnprintf( splash_buf, sizeof(splash_buf), fmt, ap ); | ||
813 | |||
814 | if(center) { | ||
815 | |||
816 | /* first a pass to measure sizes */ | ||
817 | next = strtok_r(splash_buf, " ", &store); | ||
818 | while (next) { | ||
819 | #ifdef HAVE_LCD_BITMAP | ||
820 | lcd_getstringsize(next, &w, &h); | ||
821 | #else | ||
822 | w = strlen(next); | ||
823 | h = 1; /* store height in characters */ | ||
824 | #endif | ||
825 | if(!first) { | ||
826 | if(x+w> LCD_WIDTH) { | ||
827 | /* Too wide, wrap */ | ||
828 | y+=h; | ||
829 | line++; | ||
830 | if((y > (LCD_HEIGHT-h)) || (line > MAXLINES)) | ||
831 | /* STOP */ | ||
832 | break; | ||
833 | x=0; | ||
834 | first=true; | ||
835 | } | ||
836 | } | ||
837 | else | ||
838 | first = false; | ||
839 | |||
840 | /* think of it as if the text was written here at position x,y | ||
841 | being w pixels/chars wide and h high */ | ||
842 | |||
843 | x += w+SPACE; | ||
844 | widths[line]=x-SPACE; /* don't count the trailing space */ | ||
845 | #ifdef HAVE_LCD_BITMAP | ||
846 | /* store the widest line */ | ||
847 | if(widths[line]>maxw) | ||
848 | maxw = widths[line]; | ||
849 | #endif | ||
850 | next = strtok_r(NULL, " ", &store); | ||
851 | } | ||
852 | #ifdef HAVE_LCD_BITMAP | ||
853 | /* Start displaying the message at position y. The reason for the | ||
854 | added h here is that it isn't added until the end of lines in the | ||
855 | loop above and we always break the loop in the middle of a line. */ | ||
856 | y = (LCD_HEIGHT - (y+h) )/2; | ||
857 | #else | ||
858 | y = 0; /* vertical center on 2 lines would be silly */ | ||
859 | #endif | ||
860 | first=true; | ||
861 | |||
862 | /* Now recreate the string again since the strtok_r() above has ruined | ||
863 | the one we already have! Here's room for improvements! */ | ||
864 | vsnprintf( splash_buf, sizeof(splash_buf), fmt, ap ); | ||
865 | } | ||
866 | va_end( ap ); | ||
867 | |||
868 | if(center) | ||
869 | { | ||
870 | x = (LCD_WIDTH-widths[0])/2; | ||
871 | if(x < 0) | ||
872 | x = 0; | ||
873 | } | ||
874 | |||
875 | #ifdef HAVE_LCD_BITMAP | ||
876 | /* If we center the display, then just clear the box we need and put | ||
877 | a nice little frame and put the text in there! */ | ||
878 | if(center && (y > 2)) { | ||
879 | int xx = (LCD_WIDTH-maxw)/2 - 2; | ||
880 | /* The new graphics routines handle clipping, so no need to check */ | ||
881 | #if LCD_DEPTH > 1 | ||
882 | lcd_set_background(LCD_LIGHTGRAY); | ||
883 | #endif | ||
884 | lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | ||
885 | lcd_fillrect(xx, y-2, maxw+4, LCD_HEIGHT-y*2+4); | ||
886 | lcd_set_drawmode(DRMODE_SOLID); | ||
887 | lcd_drawrect(xx, y-2, maxw+4, LCD_HEIGHT-y*2+4); | ||
888 | } | ||
889 | else | ||
890 | #endif | ||
891 | lcd_clear_display(); | ||
892 | line=0; | ||
893 | next = strtok_r(splash_buf, " ", &store); | ||
894 | while (next) { | ||
895 | #ifdef HAVE_LCD_BITMAP | ||
896 | lcd_getstringsize(next, &w, &h); | ||
897 | #else | ||
898 | w = strlen(next); | ||
899 | h = 1; | ||
900 | #endif | ||
901 | if(!first) { | ||
902 | if(x+w> LCD_WIDTH) { | ||
903 | /* too wide */ | ||
904 | y+=h; | ||
905 | line++; /* goto next line */ | ||
906 | first=true; | ||
907 | if(y > (LCD_HEIGHT-h)) | ||
908 | /* STOP */ | ||
909 | break; | ||
910 | if(center) { | ||
911 | x = (LCD_WIDTH-widths[line])/2; | ||
912 | if(x < 0) | ||
913 | x = 0; | ||
914 | } | ||
915 | else | ||
916 | x=0; | ||
917 | } | ||
918 | } | ||
919 | else | ||
920 | first=false; | ||
921 | #ifdef HAVE_LCD_BITMAP | ||
922 | lcd_putsxy(x, y, next); | ||
923 | #else | ||
924 | lcd_puts(x, y, next); | ||
925 | #endif | ||
926 | x += w+SPACE; /* pixels space! */ | ||
927 | next = strtok_r(NULL, " ", &store); | ||
928 | } | ||
929 | #if LCD_DEPTH > 1 | ||
930 | lcd_set_background(LCD_WHITE); | ||
931 | #endif | ||
932 | lcd_update(); | ||
933 | |||
934 | if(ticks) | ||
935 | /* unbreakable! */ | ||
936 | sleep(ticks); | ||
937 | } | ||
938 | |||
939 | #if defined(HAVE_CHARGING) || defined(SIMULATOR) | 775 | #if defined(HAVE_CHARGING) || defined(SIMULATOR) |
940 | void charging_splash(void) | 776 | void charging_splash(void) |
941 | { | 777 | { |
942 | splash(2*HZ, true, str(LANG_BATTERY_CHARGE)); | 778 | gui_syncsplash(2*HZ, true, str(LANG_BATTERY_CHARGE)); |
943 | button_clear_queue(); | 779 | button_clear_queue(); |
944 | } | 780 | } |
945 | #endif | 781 | #endif |
@@ -1254,7 +1090,7 @@ bool shutdown_screen(void) | |||
1254 | 1090 | ||
1255 | lcd_stop_scroll(); | 1091 | lcd_stop_scroll(); |
1256 | 1092 | ||
1257 | splash(0, true, str(LANG_CONFIRM_SHUTDOWN)); | 1093 | gui_syncsplash(0, true, str(LANG_CONFIRM_SHUTDOWN)); |
1258 | 1094 | ||
1259 | while(!done) | 1095 | while(!done) |
1260 | { | 1096 | { |
diff --git a/apps/screens.h b/apps/screens.h index 7a1b3f32bb..60a1537e99 100644 --- a/apps/screens.h +++ b/apps/screens.h | |||
@@ -43,12 +43,6 @@ bool quick_screen(const int, const int); | |||
43 | /* Long press already detected so not needed here */ | 43 | /* Long press already detected so not needed here */ |
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | void splash(int ticks, /* how long */ | ||
47 | bool center, /* FALSE means left-justified, TRUE means | ||
48 | horizontal and vertical center */ | ||
49 | const char *fmt, /* what to say *printf style */ | ||
50 | ...); | ||
51 | |||
52 | #ifdef HAVE_RTC | 46 | #ifdef HAVE_RTC |
53 | bool set_time_screen(const char* string, struct tm *tm); | 47 | bool set_time_screen(const char* string, struct tm *tm); |
54 | #endif | 48 | #endif |
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 9b6ee931fd..4aea853f82 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -51,6 +51,7 @@ | |||
51 | #include "database.h" | 51 | #include "database.h" |
52 | #include "dir.h" | 52 | #include "dir.h" |
53 | #include "dircache.h" | 53 | #include "dircache.h" |
54 | #include "splash.h" | ||
54 | 55 | ||
55 | #ifdef HAVE_LCD_BITMAP | 56 | #ifdef HAVE_LCD_BITMAP |
56 | #include "peakmeter.h" | 57 | #include "peakmeter.h" |
@@ -1337,7 +1338,7 @@ static bool dircache(void) | |||
1337 | NULL); | 1338 | NULL); |
1338 | 1339 | ||
1339 | if (!dircache_is_enabled() && global_settings.dircache) | 1340 | if (!dircache_is_enabled() && global_settings.dircache) |
1340 | splash(HZ*2, true, str(LANG_DIRCACHE_REBOOT)); | 1341 | gui_syncsplash(HZ*2, true, str(LANG_DIRCACHE_REBOOT)); |
1341 | 1342 | ||
1342 | if (!result) | 1343 | if (!result) |
1343 | dircache_disable(); | 1344 | dircache_disable(); |
diff --git a/apps/sound_menu.c b/apps/sound_menu.c index 833dea53b9..f2d92d6df6 100644 --- a/apps/sound_menu.c +++ b/apps/sound_menu.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include "peakmeter.h" | 42 | #include "peakmeter.h" |
43 | #include "mas.h" | 43 | #include "mas.h" |
44 | #endif | 44 | #endif |
45 | #include "splash.h" | ||
45 | 46 | ||
46 | int selected_setting; /* Used by the callback */ | 47 | int selected_setting; /* Used by the callback */ |
47 | void dec_sound_formatter(char *buffer, int buffer_size, int val, const char * unit) | 48 | void dec_sound_formatter(char *buffer, int buffer_size, int val, const char * unit) |
@@ -610,7 +611,7 @@ bool rectrigger(void) | |||
610 | 611 | ||
611 | switch (button) { | 612 | switch (button) { |
612 | case TRIG_CANCEL: | 613 | case TRIG_CANCEL: |
613 | splash(50, true, str(LANG_RESET_DONE_CANCEL)); | 614 | gui_syncsplash(50, true, str(LANG_RESET_DONE_CANCEL)); |
614 | global_settings.rec_start_thres = old_start_thres; | 615 | global_settings.rec_start_thres = old_start_thres; |
615 | global_settings.rec_start_duration = old_start_duration; | 616 | global_settings.rec_start_duration = old_start_duration; |
616 | global_settings.rec_prerecord_time = old_prerecord_time; | 617 | global_settings.rec_prerecord_time = old_prerecord_time; |
diff --git a/apps/wps-display.c b/apps/wps-display.c index 4647ce9b60..58a953e4c0 100644 --- a/apps/wps-display.c +++ b/apps/wps-display.c | |||
@@ -47,7 +47,7 @@ | |||
47 | #include "button.h" | 47 | #include "button.h" |
48 | #include "abrepeat.h" | 48 | #include "abrepeat.h" |
49 | #include "screens.h" | 49 | #include "screens.h" |
50 | 50 | #include "splash.h" | |
51 | #ifdef HAVE_LCD_BITMAP | 51 | #ifdef HAVE_LCD_BITMAP |
52 | #include <ctype.h> | 52 | #include <ctype.h> |
53 | #include "icons.h" | 53 | #include "icons.h" |
@@ -1622,10 +1622,10 @@ bool wps_display(struct mp3entry* id3, | |||
1622 | { | 1622 | { |
1623 | global_settings.resume_index = -1; | 1623 | global_settings.resume_index = -1; |
1624 | #ifdef HAVE_LCD_CHARCELLS | 1624 | #ifdef HAVE_LCD_CHARCELLS |
1625 | splash(HZ, true, str(LANG_END_PLAYLIST_PLAYER)); | 1625 | gui_syncsplash(HZ, true, str(LANG_END_PLAYLIST_PLAYER)); |
1626 | #else | 1626 | #else |
1627 | status_draw(true); | 1627 | status_draw(true); |
1628 | splash(HZ, true, str(LANG_END_PLAYLIST_RECORDER)); | 1628 | gui_syncsplash(HZ, true, str(LANG_END_PLAYLIST_RECORDER)); |
1629 | #endif | 1629 | #endif |
1630 | return true; | 1630 | return true; |
1631 | } | 1631 | } |
diff --git a/apps/wps.c b/apps/wps.c index 31fcd2cb6d..95048bb8d0 100644 --- a/apps/wps.c +++ b/apps/wps.c | |||
@@ -80,7 +80,7 @@ static bool setvol(void) | |||
80 | wps_refresh(id3, nid3, 0, WPS_REFRESH_NON_STATIC); | 80 | wps_refresh(id3, nid3, 0, WPS_REFRESH_NON_STATIC); |
81 | settings_save(); | 81 | settings_save(); |
82 | #ifdef HAVE_LCD_CHARCELLS | 82 | #ifdef HAVE_LCD_CHARCELLS |
83 | splash(0, false, "Vol: %d %% ", | 83 | gui_syncsplash(0, false, "Vol: %d %% ", |
84 | sound_val2phys(SOUND_VOLUME, global_settings.volume)); | 84 | sound_val2phys(SOUND_VOLUME, global_settings.volume)); |
85 | return true; | 85 | return true; |
86 | #endif | 86 | #endif |
@@ -315,7 +315,7 @@ static void display_keylock_text(bool locked) | |||
315 | else | 315 | else |
316 | s = str(LANG_KEYLOCK_OFF_RECORDER); | 316 | s = str(LANG_KEYLOCK_OFF_RECORDER); |
317 | #endif | 317 | #endif |
318 | splash(HZ, true, s); | 318 | gui_syncsplash(HZ, true, s); |
319 | } | 319 | } |
320 | 320 | ||
321 | static void waitfor_nokey(void) | 321 | static void waitfor_nokey(void) |