FS#9281 Rename of splash functions.

* Remove gui_splash()
* Rename gui_syncsplash() to splashf() and remove its voice 
capabilities.
* Rename the internal splash() to splash_internal() and introduce an 
externally visible splash() that handles simple splashing  without 
printf functionality e.g. splash(HZ, ID2P(LANG_FOO)); or splash(HZ, 
"foo"); if a LANG_* id is passed it will be voiced.
* Adjust all places that called gui_syncsplash() to use the correct 
variant from above.
* Export both new functions to plugins and adjust places calling 
rb->splash() to use the correct variant so that we now have naming 
consistency between the core and plugins.
* Fix one latent bug that would cause my sim to crash with the above 
changes and correct P2STR and P2ID macros, thanks to pondlife.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18282 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Nils Wallménius 2008-08-15 08:27:39 +00:00
parent 9464fdde2d
commit 01729e7a18
65 changed files with 276 additions and 305 deletions

View file

@ -172,7 +172,7 @@ static int get_action_worker(int context, int timeout,
{ {
last_button = BUTTON_NONE; last_button = BUTTON_NONE;
keys_locked = false; keys_locked = false;
gui_syncsplash(HZ/2, str(LANG_KEYLOCK_OFF)); splash(HZ/2, str(LANG_KEYLOCK_OFF));
return ACTION_REDRAW; return ACTION_REDRAW;
} }
else else
@ -181,7 +181,7 @@ static int get_action_worker(int context, int timeout,
#endif #endif
{ {
if ((button & BUTTON_REL)) if ((button & BUTTON_REL))
gui_syncsplash(HZ/2, str(LANG_KEYLOCK_ON)); splash(HZ/2, str(LANG_KEYLOCK_ON));
return ACTION_REDRAW; return ACTION_REDRAW;
} }
} }
@ -220,7 +220,7 @@ static int get_action_worker(int context, int timeout,
{ {
unlock_combo = button; unlock_combo = button;
keys_locked = true; keys_locked = true;
gui_syncsplash(HZ/2, str(LANG_KEYLOCK_ON)); splash(HZ/2, str(LANG_KEYLOCK_ON));
button_clear_queue(); button_clear_queue();
return ACTION_REDRAW; return ACTION_REDRAW;

View file

@ -129,11 +129,11 @@ bool alarm_screen(void)
talk_value(togo % 60, UNIT_MIN, true); talk_value(togo % 60, UNIT_MIN, true);
talk_force_enqueue_next(); talk_force_enqueue_next();
} }
gui_syncsplash(HZ*2, str(LANG_ALARM_MOD_TIME_TO_GO), splashf(HZ*2, str(LANG_ALARM_MOD_TIME_TO_GO),
togo / 60, togo % 60); togo / 60, togo % 60);
done = true; done = true;
} else { } else {
gui_syncsplash(HZ, ID2P(LANG_ALARM_MOD_ERROR)); splash(HZ, ID2P(LANG_ALARM_MOD_ERROR));
update = true; update = true;
} }
break; break;
@ -188,7 +188,7 @@ bool alarm_screen(void)
case ACTION_STD_CANCEL: case ACTION_STD_CANCEL:
rtc_enable_alarm(false); rtc_enable_alarm(false);
gui_syncsplash(HZ*2, ID2P(LANG_ALARM_MOD_DISABLE)); splash(HZ*2, ID2P(LANG_ALARM_MOD_DISABLE));
done = true; done = true;
break; break;

View file

@ -237,8 +237,8 @@ static bool write_bookmark(bool create_bookmark_file, const char *bookmark)
} }
} }
gui_syncsplash(HZ, success ? ID2P(LANG_BOOKMARK_CREATE_SUCCESS) splash(HZ, success ? ID2P(LANG_BOOKMARK_CREATE_SUCCESS)
: ID2P(LANG_BOOKMARK_CREATE_FAILURE)); : ID2P(LANG_BOOKMARK_CREATE_FAILURE));
return true; return true;
} }
@ -400,7 +400,7 @@ bool bookmark_autoload(const char* file)
if (!play_bookmark(bookmark)) if (!play_bookmark(bookmark))
{ {
/* Selected bookmark not found. */ /* Selected bookmark not found. */
gui_syncsplash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME)); splash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME));
} }
/* Act as if autoload was done even if it failed, since the /* Act as if autoload was done even if it failed, since the
@ -445,7 +445,7 @@ bool bookmark_load(const char* file, bool autoload)
/* Selected bookmark not found. */ /* Selected bookmark not found. */
if (!autoload) if (!autoload)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME)); splash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME));
} }
return false; return false;
@ -694,7 +694,7 @@ static char* select_bookmark(const char* bookmark_file_name, bool show_dont_resu
if (bookmarks->total_count < 1) if (bookmarks->total_count < 1)
{ {
/* No more bookmarks, delete file and exit */ /* No more bookmarks, delete file and exit */
gui_syncsplash(HZ, ID2P(LANG_BOOKMARK_LOAD_EMPTY)); splash(HZ, ID2P(LANG_BOOKMARK_LOAD_EMPTY));
remove(bookmark_file_name); remove(bookmark_file_name);
return NULL; return NULL;
} }

View file

@ -248,7 +248,7 @@ int codec_load_file(const char *plugin, struct codec_api *api)
fd = open(path, O_RDONLY); fd = open(path, O_RDONLY);
if (fd < 0) { if (fd < 0) {
logf("Codec load error:%d", fd); logf("Codec load error:%d", fd);
gui_syncsplash(HZ*2, "Couldn't load codec: %s", path); splashf(HZ*2, "Couldn't load codec: %s", path);
return fd; return fd;
} }

View file

@ -2136,7 +2136,7 @@ static bool dbg_save_roms(void)
restore_irq(old_irq_level); restore_irq(old_irq_level);
if (err) if (err)
gui_syncsplash(HZ*3, "Eeprom read failure (%d)",err); splashf(HZ*3, "Eeprom read failure (%d)", err);
else else
{ {
write(fd, buf, sizeof buf); write(fd, buf, sizeof buf);
@ -2233,7 +2233,7 @@ extern bool do_screendump_instead_of_usb;
static bool dbg_screendump(void) static bool dbg_screendump(void)
{ {
do_screendump_instead_of_usb = !do_screendump_instead_of_usb; do_screendump_instead_of_usb = !do_screendump_instead_of_usb;
gui_syncsplash(HZ, "Screendump %s", splashf(HZ, "Screendump %s",
do_screendump_instead_of_usb?"enabled":"disabled"); do_screendump_instead_of_usb?"enabled":"disabled");
return false; return false;
} }
@ -2277,21 +2277,21 @@ static bool dbg_write_eeprom(void)
err = eeprom_24cxx_write(0, buf, sizeof buf); err = eeprom_24cxx_write(0, buf, sizeof buf);
if (err) if (err)
gui_syncsplash(HZ*3, "Eeprom write failure (%d)",err); splashf(HZ*3, "Eeprom write failure (%d)", err);
else else
gui_syncsplash(HZ*3, "Eeprom written successfully"); splash(HZ*3, "Eeprom written successfully");
restore_irq(old_irq_level); restore_irq(old_irq_level);
} }
else else
{ {
gui_syncsplash(HZ*3, "File read error (%d)",rc); splashf(HZ*3, "File read error (%d)",rc);
} }
close(fd); close(fd);
} }
else else
{ {
gui_syncsplash(HZ*3, "Failed to open 'internal_eeprom.bin'"); splash(HZ*3, "Failed to open 'internal_eeprom.bin'");
} }
return false; return false;
@ -2396,7 +2396,7 @@ static bool logf_usb_serial(void)
{ {
bool serial_enabled = !usb_core_driver_enabled(USB_DRIVER_SERIAL); bool serial_enabled = !usb_core_driver_enabled(USB_DRIVER_SERIAL);
usb_core_enable_driver(USB_DRIVER_SERIAL,serial_enabled); usb_core_enable_driver(USB_DRIVER_SERIAL,serial_enabled);
gui_syncsplash(HZ, "USB logf %s", splashf(HZ, "USB logf %s",
serial_enabled?"enabled":"disabled"); serial_enabled?"enabled":"disabled");
return false; return false;
} }
@ -2405,7 +2405,7 @@ static bool logf_usb_serial(void)
#if defined(HAVE_USBSTACK) && defined(USB_STORAGE) #if defined(HAVE_USBSTACK) && defined(USB_STORAGE)
static bool usb_reconnect(void) static bool usb_reconnect(void)
{ {
gui_syncsplash(HZ, "Reconnect mass storage"); splash(HZ, "Reconnect mass storage");
usb_storage_reconnect(); usb_storage_reconnect();
return false; return false;
} }

View file

@ -403,7 +403,7 @@ bool enc_config_menu(struct encoder_config *cfg)
} }
else else
{ {
gui_syncsplash(HZ, str(LANG_NO_SETTINGS)); splash(HZ, str(LANG_NO_SETTINGS));
return false; return false;
} }
} /* enc_config_menu */ } /* enc_config_menu */
@ -461,7 +461,7 @@ bool enc_global_config_menu(void)
} }
else else
{ {
gui_syncsplash(HZ, str(LANG_NO_SETTINGS)); splash(HZ, str(LANG_NO_SETTINGS));
return false; return false;
} }
} /* enc_global_config_menu */ } /* enc_global_config_menu */

View file

@ -92,7 +92,7 @@ bool ft_play_playlist(char* pathname, char* dirname, char* filename)
{ {
if (global_settings.party_mode) if (global_settings.party_mode)
{ {
gui_syncsplash(HZ, ID2P(LANG_PARTY_MODE)); splash(HZ, ID2P(LANG_PARTY_MODE));
return false; return false;
} }
@ -101,7 +101,7 @@ bool ft_play_playlist(char* pathname, char* dirname, char* filename)
return false; return false;
} }
gui_syncsplash(0, ID2P(LANG_WAIT)); splash(0, ID2P(LANG_WAIT));
/* about to create a new current playlist... /* about to create a new current playlist...
allow user to cancel the operation */ allow user to cancel the operation */
@ -397,7 +397,7 @@ int ft_enter(struct tree_context* c)
if (bookmark_autoload(c->currdir)) if (bookmark_autoload(c->currdir))
break; break;
gui_syncsplash(0, ID2P(LANG_WAIT)); splash(0, ID2P(LANG_WAIT));
/* about to create a new current playlist... /* about to create a new current playlist...
allow user to cancel the operation */ allow user to cancel the operation */
@ -408,7 +408,7 @@ int ft_enter(struct tree_context* c)
{ {
playlist_insert_track(NULL, buf, playlist_insert_track(NULL, buf,
PLAYLIST_INSERT_LAST, true, true); PLAYLIST_INSERT_LAST, true, true);
gui_syncsplash(HZ, ID2P(LANG_QUEUE_LAST)); splash(HZ, ID2P(LANG_QUEUE_LAST));
} }
else if (playlist_create(c->currdir, NULL) != -1) else if (playlist_create(c->currdir, NULL) != -1)
{ {
@ -432,8 +432,7 @@ int ft_enter(struct tree_context* c)
#if CONFIG_TUNER #if CONFIG_TUNER
/* fmr preset file */ /* fmr preset file */
case FILE_ATTR_FMR: case FILE_ATTR_FMR:
splash(0, ID2P(LANG_WAIT));
gui_syncsplash(0, ID2P(LANG_WAIT));
/* Preset inside the default folder. */ /* Preset inside the default folder. */
if(!strncasecmp(FMPRESET_PATH, buf, strlen(FMPRESET_PATH))) if(!strncasecmp(FMPRESET_PATH, buf, strlen(FMPRESET_PATH)))
@ -460,7 +459,7 @@ int ft_enter(struct tree_context* c)
/* wps config file */ /* wps config file */
case FILE_ATTR_WPS: case FILE_ATTR_WPS:
gui_syncsplash(0, ID2P(LANG_WAIT)); splash(0, ID2P(LANG_WAIT));
#if LCD_DEPTH > 1 #if LCD_DEPTH > 1
unload_wps_backdrop(); unload_wps_backdrop();
#endif #endif
@ -472,7 +471,7 @@ int ft_enter(struct tree_context* c)
#if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1) #if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1)
/* remote-wps config file */ /* remote-wps config file */
case FILE_ATTR_RWPS: case FILE_ATTR_RWPS:
gui_syncsplash(0, ID2P(LANG_WAIT)); splash(0, ID2P(LANG_WAIT));
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
unload_remote_wps_backdrop(); unload_remote_wps_backdrop();
#endif #endif
@ -483,39 +482,39 @@ int ft_enter(struct tree_context* c)
#endif #endif
case FILE_ATTR_CFG: case FILE_ATTR_CFG:
gui_syncsplash(0, ID2P(LANG_WAIT)); splash(0, ID2P(LANG_WAIT));
if (!settings_load_config(buf,true)) if (!settings_load_config(buf,true))
break; break;
gui_syncsplash(HZ, ID2P(LANG_SETTINGS_LOADED)); splash(HZ, ID2P(LANG_SETTINGS_LOADED));
break; break;
case FILE_ATTR_BMARK: case FILE_ATTR_BMARK:
gui_syncsplash(0, ID2P(LANG_WAIT)); splash(0, ID2P(LANG_WAIT));
bookmark_load(buf, false); bookmark_load(buf, false);
reload_dir = true; reload_dir = true;
break; break;
case FILE_ATTR_LNG: case FILE_ATTR_LNG:
gui_syncsplash(0, ID2P(LANG_WAIT)); splash(0, ID2P(LANG_WAIT));
if(!lang_load(buf)) { if(!lang_load(buf)) {
set_file(buf, (char *)global_settings.lang_file, set_file(buf, (char *)global_settings.lang_file,
MAX_FILENAME); MAX_FILENAME);
talk_init(); /* use voice of same language */ talk_init(); /* use voice of same language */
gui_syncsplash(HZ, ID2P(LANG_LANGUAGE_LOADED)); splash(HZ, ID2P(LANG_LANGUAGE_LOADED));
} }
break; break;
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
case FILE_ATTR_FONT: case FILE_ATTR_FONT:
gui_syncsplash(0, ID2P(LANG_WAIT)); splash(0, ID2P(LANG_WAIT));
font_load(buf); font_load(buf);
set_file(buf, (char *)global_settings.font_file, MAX_FILENAME); set_file(buf, (char *)global_settings.font_file, MAX_FILENAME);
break; break;
case FILE_ATTR_KBD: case FILE_ATTR_KBD:
gui_syncsplash(0, ID2P(LANG_WAIT)); splash(0, ID2P(LANG_WAIT));
if (!load_kbd(buf)) if (!load_kbd(buf))
gui_syncsplash(HZ, ID2P(LANG_KEYBOARD_LOADED)); splash(HZ, ID2P(LANG_KEYBOARD_LOADED));
set_file(buf, (char *)global_settings.kbd_file, MAX_FILENAME); set_file(buf, (char *)global_settings.kbd_file, MAX_FILENAME);
break; break;
#endif #endif
@ -523,7 +522,7 @@ int ft_enter(struct tree_context* c)
#ifndef SIMULATOR #ifndef SIMULATOR
/* firmware file */ /* firmware file */
case FILE_ATTR_MOD: case FILE_ATTR_MOD:
gui_syncsplash(0, ID2P(LANG_WAIT)); splash(0, ID2P(LANG_WAIT));
rolo_load(buf); rolo_load(buf);
break; break;
#endif #endif
@ -531,7 +530,7 @@ int ft_enter(struct tree_context* c)
/* plugin file */ /* plugin file */
case FILE_ATTR_ROCK: case FILE_ATTR_ROCK:
if (global_settings.party_mode) { if (global_settings.party_mode) {
gui_syncsplash(HZ, ID2P(LANG_PARTY_MODE)); splash(HZ, ID2P(LANG_PARTY_MODE));
break; break;
} }
@ -555,7 +554,7 @@ int ft_enter(struct tree_context* c)
const char* plugin; const char* plugin;
if (global_settings.party_mode) { if (global_settings.party_mode) {
gui_syncsplash(HZ, ID2P(LANG_PARTY_MODE)); splash(HZ, ID2P(LANG_PARTY_MODE));
break; break;
} }

View file

@ -106,7 +106,7 @@ static const struct filetype inbuilt_filetypes[] = {
{ "cue", FILE_ATTR_CUE, Icon_Bookmark, VOICE_EXT_CUESHEET }, { "cue", FILE_ATTR_CUE, Icon_Bookmark, VOICE_EXT_CUESHEET },
#ifdef BOOTFILE_EXT #ifdef BOOTFILE_EXT
{ BOOTFILE_EXT, FILE_ATTR_MOD, Icon_Firmware, VOICE_EXT_AJZ }, { BOOTFILE_EXT, FILE_ATTR_MOD, Icon_Firmware, VOICE_EXT_AJZ },
#endif /* #ifndef SIMULATOR */ #endif
}; };
void tree_get_filetypes(const struct filetype** types, int* count) void tree_get_filetypes(const struct filetype** types, int* count)
@ -300,7 +300,7 @@ static void read_config(char* config_file)
{ {
if (filetype_count >= MAX_FILETYPES) if (filetype_count >= MAX_FILETYPES)
{ {
gui_syncsplash(HZ, ID2P(LANG_FILETYPES_FULL)); splash(HZ, ID2P(LANG_FILETYPES_FULL));
break; break;
} }
rm_whitespaces(line); rm_whitespaces(line);
@ -485,7 +485,7 @@ int filetype_list_viewers(const char* current_file)
if (count == 0) if (count == 0)
{ {
/* FIX: translation! */ /* FIX: translation! */
gui_syncsplash(HZ*2, (unsigned char *)"No viewers found"); splash(HZ*2, "No viewers found");
return PLUGIN_OK; return PLUGIN_OK;
} }
#endif #endif

View file

@ -461,7 +461,7 @@ bool set_color(struct screen *display, char *title, unsigned *color,
if (banned_color != (unsigned)-1 && if (banned_color != (unsigned)-1 &&
banned_color == rgb.color) banned_color == rgb.color)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_COLOR_UNACCEPTABLE)); splash(HZ*2, ID2P(LANG_COLOR_UNACCEPTABLE));
break; break;
} }
*color = rgb.color; *color = rgb.color;

View file

@ -152,7 +152,7 @@ bool update_onvol_change(struct gui_wps * gwps)
gui_wps_refresh(gwps, 0, WPS_REFRESH_NON_STATIC); gui_wps_refresh(gwps, 0, WPS_REFRESH_NON_STATIC);
#ifdef HAVE_LCD_CHARCELLS #ifdef HAVE_LCD_CHARCELLS
gui_splash(gwps->display, 0, "Vol: %3d dB", splashf(0, "Vol: %3d dB",
sound_val2phys(SOUND_VOLUME, global_settings.volume)); sound_val2phys(SOUND_VOLUME, global_settings.volume));
return true; return true;
#endif #endif
@ -329,7 +329,7 @@ bool gui_wps_display(void)
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
gui_syncstatusbar_draw(&statusbars, true); gui_syncstatusbar_draw(&statusbars, true);
#endif #endif
gui_syncsplash(HZ, ID2P(LANG_END_PLAYLIST)); splash(HZ, ID2P(LANG_END_PLAYLIST));
return true; return true;
} }
else else
@ -485,16 +485,11 @@ bool update(struct gui_wps *gwps)
void display_keylock_text(bool locked) void display_keylock_text(bool locked)
{ {
char* s;
int i; int i;
FOR_NB_SCREENS(i) FOR_NB_SCREENS(i)
gui_wps[i].display->stop_scroll(); gui_wps[i].display->stop_scroll();
if(locked) splash(HZ, locked ? ID2P(LANG_KEYLOCK_ON) : ID2P(LANG_KEYLOCK_OFF));
s = str(LANG_KEYLOCK_ON);
else
s = str(LANG_KEYLOCK_OFF);
gui_syncsplash(HZ, s);
} }
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP

View file

@ -530,7 +530,7 @@ bool option_screen(const struct settings_list *setting,
*variable = oldvalue; *variable = oldvalue;
if (var_type == F_T_BOOL && !use_temp_var) if (var_type == F_T_BOOL && !use_temp_var)
*(bool*)setting->setting = (oldvalue==1); *(bool*)setting->setting = (oldvalue==1);
gui_syncsplash(HZ/2, ID2P(LANG_CANCEL)); splash(HZ/2, ID2P(LANG_CANCEL));
} }
done = true; done = true;
} }

View file

@ -109,7 +109,7 @@ static void pitch_screen_draw(struct screen *display, int pitch, int pitch_mode)
w+1, (display->lcdheight-h)/2, 7, 8); w+1, (display->lcdheight-h)/2, 7, 8);
/* "Pitch" */ /* "Pitch" */
snprintf((char *)buf, sizeof(buf), str(LANG_PITCH)); snprintf((char *)buf, sizeof(buf), "%s", str(LANG_PITCH));
display->getstringsize(buf,&w,&h); display->getstringsize(buf,&w,&h);
display->putsxy((display->lcdwidth-w)/2, (display->lcdheight/2)-h, buf); display->putsxy((display->lcdwidth-w)/2, (display->lcdheight/2)-h, buf);
/* "XX.X%" */ /* "XX.X%" */

View file

@ -45,7 +45,7 @@
#endif #endif
static void splash(struct screen * screen, const char *fmt, va_list ap) static void splash_internal(struct screen * screen, const char *fmt, va_list ap)
{ {
char splash_buf[MAXBUFFER]; char splash_buf[MAXBUFFER];
short widths[MAXLINES]; short widths[MAXLINES];
@ -187,41 +187,35 @@ static void splash(struct screen * screen, const char *fmt, va_list ap)
screen->update(); screen->update();
} }
void gui_splash(struct screen * screen, int ticks, void splashf(int ticks, const char *fmt, ...)
const char *fmt, ...)
{ {
va_list ap; va_list ap;
va_start( ap, fmt ); int i;
splash(screen, fmt, ap);
va_end( ap ); /* If fmt is a lang ID then get the corresponding string (which
still might contain % place holders). */
fmt = P2STR((unsigned char *)fmt);
FOR_NB_SCREENS(i)
{
va_start(ap, fmt);
screens[i].set_viewport(NULL);
splash_internal(&(screens[i]), fmt, ap);
va_end(ap);
}
if(ticks) if(ticks)
sleep(ticks); sleep(ticks);
} }
void gui_syncsplash(int ticks, const char *fmt, ...) void splash(int ticks, const char *str)
{ {
va_list ap;
int i;
#if !defined(SIMULATOR) || CONFIG_CODEC == SWCODEC #if !defined(SIMULATOR) || CONFIG_CODEC == SWCODEC
long id; long id;
/* fmt may be a so called virtual pointer. See settings.h. */ /* fmt may be a so called virtual pointer. See settings.h. */
if((id = P2ID((unsigned char *)fmt)) >= 0) if((id = P2ID((const unsigned char*)str)) >= 0)
/* If fmt specifies a voicefont ID, and voice menus are /* If fmt specifies a voicefont ID, and voice menus are
enabled, then speak it. */ enabled, then speak it. */
cond_talk_ids_fq(id); cond_talk_ids_fq(id);
#endif #endif
/* If fmt is a lang ID then get the corresponding string (which splashf(ticks, "%s", P2STR((const unsigned char*)str));
still might contain % place holders). */
fmt = P2STR((unsigned char *)fmt);
va_start( ap, fmt );
FOR_NB_SCREENS(i)
{
screens[i].set_viewport(NULL);
splash(&(screens[i]), fmt, ap);
}
va_end( ap );
if(ticks)
sleep(ticks);
} }

View file

@ -24,21 +24,18 @@
#include <_ansi.h> #include <_ansi.h>
#include "screen_access.h" #include "screen_access.h"
/*
* Puts a splash message centered on the given screen for a given period
* - screen : the screen to put the splash on
* - ticks : how long the splash is displayed (in rb ticks)
* - fmt : what to say *printf style
*/
extern void gui_splash(struct screen * screen, int ticks,
const char *fmt, ...) ATTRIBUTE_PRINTF(3, 4);
/* /*
* Puts a splash message centered on all the screens for a given period * Puts a splash message centered on all the screens for a given period
* - ticks : how long the splash is displayed (in rb ticks) * - ticks : how long the splash is displayed (in rb ticks)
* - fmt : what to say *printf style * - fmt : what to say *printf style
*/ */
extern void gui_syncsplash(int ticks, const char *fmt, ...) extern void splashf(int ticks, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
ATTRIBUTE_PRINTF(2, 3);
/*
* Puts a splash message centered on all the screens for a given period
* - ticks : how long the splash is displayed (in rb ticks)
* - str : what to say, if this is a LANG_* string (from ID2P)
* it will be voiced
*/
extern void splash(int ticks, const char *str);
#endif /* _GUI_ICON_H_ */ #endif /* _GUI_ICON_H_ */

View file

@ -162,7 +162,7 @@ static int init_dircache(bool preinit)
{ {
/* This will be in default language, settings are not /* This will be in default language, settings are not
applied yet. Not really any easy way to fix that. */ applied yet. Not really any easy way to fix that. */
gui_syncsplash(0, str(LANG_SCANNING_DISK)); splash(0, str(LANG_SCANNING_DISK));
clear = true; clear = true;
} }
@ -180,7 +180,7 @@ static int init_dircache(bool preinit)
{ {
if (global_status.dircache_size <= 0) if (global_status.dircache_size <= 0)
{ {
gui_syncsplash(0, str(LANG_SCANNING_DISK)); splash(0, str(LANG_SCANNING_DISK));
clear = true; clear = true;
} }
result = dircache_build(global_status.dircache_size); result = dircache_build(global_status.dircache_size);
@ -191,7 +191,7 @@ static int init_dircache(bool preinit)
/* Initialization of dircache failed. Manual action is /* Initialization of dircache failed. Manual action is
* necessary to enable dircache again. * necessary to enable dircache again.
*/ */
gui_syncsplash(0, "Dircache failed, disabled. Result: %d", result); splashf(0, "Dircache failed, disabled. Result: %d", result);
global_settings.dircache = false; global_settings.dircache = false;
} }
@ -244,7 +244,7 @@ static void init_tagcache(void)
} }
#endif #endif
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
gui_syncsplash(0, "%s [%d/%d]", splashf(0, "%s [%d/%d]",
str(LANG_TAGCACHE_INIT), ret, str(LANG_TAGCACHE_INIT), ret,
tagcache_get_max_commit_step()); tagcache_get_max_commit_step());
#else #else
@ -504,7 +504,7 @@ static void init(void)
if (button_hold()) if (button_hold())
#endif #endif
{ {
gui_syncsplash(HZ*2, str(LANG_RESET_DONE_CLEAR)); splash(HZ*2, str(LANG_RESET_DONE_CLEAR));
settings_reset(); settings_reset();
} }
else else

View file

@ -406,7 +406,7 @@ static int info_action_callback(int action, struct gui_synclist *lists)
#ifndef SIMULATOR #ifndef SIMULATOR
struct info_data *info = (struct info_data *)lists->data; struct info_data *info = (struct info_data *)lists->data;
info->new_data = true; info->new_data = true;
gui_syncsplash(0, ID2P(LANG_SCANNING_DISK)); splash(0, ID2P(LANG_SCANNING_DISK));
fat_recalc_free(IF_MV(0)); fat_recalc_free(IF_MV(0));
#ifdef HAVE_MULTIVOLUME #ifdef HAVE_MULTIVOLUME
if (fat_ismounted(1)) if (fat_ismounted(1))

View file

@ -1,4 +1,3 @@
/*************************************************************************** /***************************************************************************
* __________ __ ___. * __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
@ -143,7 +142,7 @@ static int audioscrobbler_callback(int action,const struct menu_item_ex *this_it
{ {
case ACTION_EXIT_MENUITEM: /* on exit */ case ACTION_EXIT_MENUITEM: /* on exit */
if (!scrobbler_is_enabled() && global_settings.audioscrobbler) if (!scrobbler_is_enabled() && global_settings.audioscrobbler)
gui_syncsplash(HZ*2, "%s", ID2P(LANG_PLEASE_REBOOT)); splash(HZ*2, ID2P(LANG_PLEASE_REBOOT));
if(scrobbler_is_enabled() && !global_settings.audioscrobbler) if(scrobbler_is_enabled() && !global_settings.audioscrobbler)
scrobbler_shutdown(); scrobbler_shutdown();
@ -161,7 +160,7 @@ static int cuesheet_callback(int action,const struct menu_item_ex *this_item)
{ {
case ACTION_EXIT_MENUITEM: /* on exit */ case ACTION_EXIT_MENUITEM: /* on exit */
if (!cuesheet_is_enabled() && global_settings.cuesheet) if (!cuesheet_is_enabled() && global_settings.cuesheet)
gui_syncsplash(HZ*2, "%s", ID2P(LANG_PLEASE_REBOOT)); splash(HZ*2, ID2P(LANG_PLEASE_REBOOT));
break; break;
} }
return action; return action;

View file

@ -325,7 +325,7 @@ MENUITEM_SETTING(rec_prerecord_time, &global_settings.rec_prerecord_time, NULL);
static int clear_rec_directory(void) static int clear_rec_directory(void)
{ {
strcpy(global_settings.rec_directory, REC_BASE_DIR); strcpy(global_settings.rec_directory, REC_BASE_DIR);
gui_syncsplash(HZ, ID2P(LANG_RESET_DONE_CLEAR)); splash(HZ, ID2P(LANG_RESET_DONE_CLEAR));
return false; return false;
} }
MENUITEM_FUNCTION(clear_rec_directory_item, 0, ID2P(LANG_CLEAR_REC_DIR), MENUITEM_FUNCTION(clear_rec_directory_item, 0, ID2P(LANG_CLEAR_REC_DIR),
@ -531,7 +531,7 @@ int rectrigger(void)
switch (action) switch (action)
{ {
case ACTION_STD_CANCEL: case ACTION_STD_CANCEL:
gui_syncsplash(HZ/2, ID2P(LANG_CANCEL)); splash(HZ/2, ID2P(LANG_CANCEL));
global_settings.rec_start_thres_db = old_start_thres_db; global_settings.rec_start_thres_db = old_start_thres_db;
global_settings.rec_start_thres_linear = old_start_thres_linear; global_settings.rec_start_thres_linear = old_start_thres_linear;
global_settings.rec_start_duration = old_start_duration; global_settings.rec_start_duration = old_start_duration;

View file

@ -57,13 +57,13 @@
static void tagcache_rebuild_with_splash(void) static void tagcache_rebuild_with_splash(void)
{ {
tagcache_rebuild(); tagcache_rebuild();
gui_syncsplash(HZ*2, ID2P(LANG_TAGCACHE_FORCE_UPDATE_SPLASH)); splash(HZ*2, ID2P(LANG_TAGCACHE_FORCE_UPDATE_SPLASH));
} }
static void tagcache_update_with_splash(void) static void tagcache_update_with_splash(void)
{ {
tagcache_update(); tagcache_update();
gui_syncsplash(HZ*2, ID2P(LANG_TAGCACHE_FORCE_UPDATE_SPLASH)); splash(HZ*2, ID2P(LANG_TAGCACHE_FORCE_UPDATE_SPLASH));
} }
#ifdef HAVE_TC_RAMCACHE #ifdef HAVE_TC_RAMCACHE
@ -187,7 +187,7 @@ static int dircache_callback(int action,const struct menu_item_ex *this_item)
{ {
case true: case true:
if (!dircache_is_enabled()) if (!dircache_is_enabled())
gui_syncsplash(HZ*2, ID2P(LANG_PLEASE_REBOOT)); splash(HZ*2, ID2P(LANG_PLEASE_REBOOT));
break; break;
case false: case false:
if (dircache_is_enabled()) if (dircache_is_enabled())

View file

@ -675,26 +675,24 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
if (!tagcache_prepare_shutdown()) if (!tagcache_prepare_shutdown())
{ {
cancel_shutdown(); cancel_shutdown();
gui_syncsplash(HZ, ID2P(LANG_TAGCACHE_BUSY)); splash(HZ, ID2P(LANG_TAGCACHE_BUSY));
return false; return false;
} }
#endif #endif
if (battery_level() > 10) if (battery_level() > 10)
gui_syncsplash(0, str(LANG_SHUTTINGDOWN)); splash(0, str(LANG_SHUTTINGDOWN));
else else
{ {
msg_id = LANG_WARNING_BATTERY_LOW; msg_id = LANG_WARNING_BATTERY_LOW;
gui_syncsplash(0, "%s %s", splashf(0, "%s %s", str(LANG_WARNING_BATTERY_LOW),
str(LANG_WARNING_BATTERY_LOW), str(LANG_SHUTTINGDOWN));
str(LANG_SHUTTINGDOWN));
} }
} }
else else
{ {
msg_id = LANG_WARNING_BATTERY_EMPTY; msg_id = LANG_WARNING_BATTERY_EMPTY;
gui_syncsplash(0, "%s %s", splashf(0, "%s %s", str(LANG_WARNING_BATTERY_EMPTY),
str(LANG_WARNING_BATTERY_EMPTY), str(LANG_SHUTTINGDOWN));
str(LANG_SHUTTINGDOWN));
} }
if (global_settings.fade_on_stop if (global_settings.fade_on_stop

View file

@ -166,7 +166,7 @@ static bool add_to_playlist(int position, bool queue)
}; };
const struct text_message message={lines, 2}; const struct text_message message={lines, 2};
gui_syncsplash(0, ID2P(LANG_WAIT)); splash(0, ID2P(LANG_WAIT));
if (new_playlist) if (new_playlist)
playlist_create(NULL, NULL); playlist_create(NULL, NULL);
@ -476,7 +476,7 @@ static int remove_dir(char* dirname, int len)
break; break;
dirname[dirlen] ='\0'; dirname[dirlen] ='\0';
gui_syncsplash(0, dirname); splash(0, dirname);
/* append name to current directory */ /* append name to current directory */
snprintf(dirname+dirlen, len-dirlen, "/%s", entry->d_name); snprintf(dirname+dirlen, len-dirlen, "/%s", entry->d_name);
@ -499,7 +499,7 @@ static int remove_dir(char* dirname, int len)
} }
if(ACTION_STD_CANCEL == get_action(CONTEXT_STD,TIMEOUT_NOBLOCK)) if(ACTION_STD_CANCEL == get_action(CONTEXT_STD,TIMEOUT_NOBLOCK))
{ {
gui_syncsplash(HZ, ID2P(LANG_CANCEL)); splash(HZ, ID2P(LANG_CANCEL));
result = -1; result = -1;
break; break;
} }
@ -538,7 +538,7 @@ static bool delete_handler(bool is_dir)
if(gui_syncyesno_run(&message, &yes_message, NULL)!=YESNO_YES) if(gui_syncyesno_run(&message, &yes_message, NULL)!=YESNO_YES)
return false; return false;
gui_syncsplash(0, str(LANG_DELETING)); splash(0, str(LANG_DELETING));
int res; int res;
if (is_dir) if (is_dir)
@ -574,13 +574,13 @@ static bool set_backdrop(void)
{ {
/* load the image */ /* load the image */
if(load_main_backdrop(selected_file)) { if(load_main_backdrop(selected_file)) {
gui_syncsplash(HZ, str(LANG_BACKDROP_LOADED)); splash(HZ, str(LANG_BACKDROP_LOADED));
set_file(selected_file, (char *)global_settings.backdrop_file, set_file(selected_file, (char *)global_settings.backdrop_file,
MAX_FILENAME); MAX_FILENAME);
show_main_backdrop(); show_main_backdrop();
return true; return true;
} else { } else {
gui_syncsplash(HZ, str(LANG_BACKDROP_FAILED)); splash(HZ, str(LANG_BACKDROP_FAILED));
return false; return false;
} }
} }
@ -630,8 +630,8 @@ static bool create_dir(void)
rc = mkdir(dirname); rc = mkdir(dirname);
if (rc < 0) { if (rc < 0) {
cond_talk_ids_fq(LANG_CREATE_DIR, LANG_FAILED); cond_talk_ids_fq(LANG_CREATE_DIR, LANG_FAILED);
gui_syncsplash(HZ, (unsigned char *)"%s %s", splashf(HZ, (unsigned char *)"%s %s", str(LANG_CREATE_DIR),
str(LANG_CREATE_DIR), str(LANG_FAILED)); str(LANG_FAILED));
} else { } else {
onplay_result = ONPLAY_RELOAD_DIR; onplay_result = ONPLAY_RELOAD_DIR;
} }
@ -886,11 +886,11 @@ static bool clipboard_paste(void)
} }
if (clipboard_is_copy) { if (clipboard_is_copy) {
gui_syncsplash(0, ID2P(LANG_COPYING)); splash(0, ID2P(LANG_COPYING));
} }
else else
{ {
gui_syncsplash(0, ID2P(LANG_MOVING)); splash(0, ID2P(LANG_MOVING));
} }
/* Now figure out what we're doing */ /* Now figure out what we're doing */
@ -930,8 +930,8 @@ static bool clipboard_paste(void)
onplay_result = ONPLAY_RELOAD_DIR; onplay_result = ONPLAY_RELOAD_DIR;
} else { } else {
cond_talk_ids_fq(LANG_PASTE, LANG_FAILED); cond_talk_ids_fq(LANG_PASTE, LANG_FAILED);
gui_syncsplash(HZ, (unsigned char *)"%s %s", splashf(HZ, (unsigned char *)"%s %s", str(LANG_PASTE),
str(LANG_PASTE), str(LANG_FAILED)); str(LANG_FAILED));
} }
return true; return true;
@ -949,7 +949,7 @@ static int set_rating_inline(void)
tagcache_update_numeric(id3->tagcache_idx-1, tag_rating, id3->rating); tagcache_update_numeric(id3->tagcache_idx-1, tag_rating, id3->rating);
} }
else else
gui_syncsplash(HZ*2, ID2P(LANG_ID3_NO_INFO)); splash(HZ*2, ID2P(LANG_ID3_NO_INFO));
return 0; return 0;
} }
static int ratingitem_callback(int action,const struct menu_item_ex *this_item) static int ratingitem_callback(int action,const struct menu_item_ex *this_item)

View file

@ -822,7 +822,7 @@ void audio_set_crossfade(int enable)
{ {
/* Store the track resume position */ /* Store the track resume position */
offset = curtrack_id3.offset; offset = curtrack_id3.offset;
gui_syncsplash(0, str(LANG_RESTARTING_PLAYBACK)); splash(0, str(LANG_RESTARTING_PLAYBACK));
} }
/* Blast it - audio buffer will have to be setup again next time /* Blast it - audio buffer will have to be setup again next time
@ -1334,7 +1334,7 @@ static void codec_thread(void)
if (!ci.new_track) if (!ci.new_track)
{ {
logf("Codec failure"); logf("Codec failure");
gui_syncsplash(HZ*2, "Codec failure"); splash(HZ*2, "Codec failure");
} }
if (!codec_load_next_track()) if (!codec_load_next_track())
@ -1395,7 +1395,7 @@ static void codec_thread(void)
break; break;
logf("Encoder failure"); logf("Encoder failure");
gui_syncsplash(HZ*2, "Encoder failure"); splash(HZ*2, "Encoder failure");
if (ci.enc_codec_loaded < 0) if (ci.enc_codec_loaded < 0)
break; break;
@ -1717,7 +1717,6 @@ static bool audio_load_track(size_t offset, bool start_play)
buffering_handle_finished_callback callback. */ buffering_handle_finished_callback callback. */
static void audio_finish_load_track(void) static void audio_finish_load_track(void)
{ {
char msgbuf[80];
size_t file_offset = 0; size_t file_offset = 0;
size_t offset = 0; size_t offset = 0;
bool start_play = start_play_g; bool start_play = start_play_g;
@ -1791,9 +1790,8 @@ static void audio_finish_load_track(void)
/* This is an error condition, either no codec was found, or reading /* This is an error condition, either no codec was found, or reading
* the codec file failed part way through, either way, skip the track */ * the codec file failed part way through, either way, skip the track */
snprintf(msgbuf, sizeof(msgbuf)-1, "No codec for: %s", track_id3->path); /* FIXME: We should not use splashf from audio thread! */
/* We should not use gui_syncplash from audio thread! */ splashf(HZ*2, "No codec for: %s", track_id3->path);
gui_syncsplash(HZ*2, msgbuf);
/* Skip invalid entry from playlist. */ /* Skip invalid entry from playlist. */
playlist_skip_entry(NULL, last_peek_offset); playlist_skip_entry(NULL, last_peek_offset);
return; return;

View file

@ -347,7 +347,7 @@ static void create_control(struct playlist_info* playlist)
if (check_rockboxdir()) if (check_rockboxdir())
{ {
cond_talk_ids_fq(LANG_PLAYLIST_CONTROL_ACCESS_ERROR); cond_talk_ids_fq(LANG_PLAYLIST_CONTROL_ACCESS_ERROR);
gui_syncsplash(HZ*2, (unsigned char *)"%s (%d)", splashf(HZ*2, (unsigned char *)"%s (%d)",
str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR), str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR),
playlist->control_fd); playlist->control_fd);
} }
@ -536,7 +536,7 @@ static int add_indices_to_playlist(struct playlist_info* playlist,
if((i = lseek(playlist->fd, 0, SEEK_CUR)) > 0) if((i = lseek(playlist->fd, 0, SEEK_CUR)) > 0)
playlist->utf8 = true; /* Override any earlier indication. */ playlist->utf8 = true; /* Override any earlier indication. */
gui_syncsplash(0, ID2P(LANG_WAIT)); splash(0, ID2P(LANG_WAIT));
if (!buffer) if (!buffer)
{ {
@ -1426,9 +1426,9 @@ static int get_filename(struct playlist_info* playlist, int index, int seek,
if (max < 0) if (max < 0)
{ {
if (control_file) if (control_file)
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); splash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
else else
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_ACCESS_ERROR)); splash(HZ*2, ID2P(LANG_PLAYLIST_ACCESS_ERROR));
return max; return max;
} }
@ -1523,7 +1523,7 @@ static int get_next_dir(char *dir, bool is_forward, bool recursion)
if (ft_load(tc, (dir[0]=='\0')?"/":dir) < 0) if (ft_load(tc, (dir[0]=='\0')?"/":dir) < 0)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR)); splash(HZ*2, ID2P(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR));
exit = true; exit = true;
result = -1; result = -1;
break; break;
@ -1604,7 +1604,7 @@ static int check_subdir_for_music(char *dir, char *subdir, bool recurse)
if (ft_load(tc, dir) < 0) if (ft_load(tc, dir) < 0)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR)); splash(HZ*2, ID2P(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR));
return -2; return -2;
} }
@ -1657,8 +1657,7 @@ static int check_subdir_for_music(char *dir, char *subdir, bool recurse)
/* we now need to reload our current directory */ /* we now need to reload our current directory */
if(ft_load(tc, dir) < 0) if(ft_load(tc, dir) < 0)
gui_syncsplash(HZ*2, splash(HZ*2, ID2P(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR));
ID2P(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR));
} }
return result; return result;
} }
@ -1747,7 +1746,7 @@ static void display_playlist_count(int count, const unsigned char *fmt,
} }
fmt = P2STR(fmt); fmt = P2STR(fmt);
gui_syncsplash(0, fmt, count, str(LANG_OFF_ABORT)); splashf(0, fmt, count, str(LANG_OFF_ABORT));
} }
/* /*
@ -1755,7 +1754,7 @@ static void display_playlist_count(int count, const unsigned char *fmt,
*/ */
static void display_buffer_full(void) static void display_buffer_full(void)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_BUFFER_FULL)); splash(HZ*2, ID2P(LANG_PLAYLIST_BUFFER_FULL));
} }
/* /*
@ -1834,7 +1833,7 @@ static int flush_cached_control(struct playlist_info* playlist)
else else
{ {
result = -1; result = -1;
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_UPDATE_ERROR)); splash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_UPDATE_ERROR));
} }
return result; return result;
@ -2021,11 +2020,11 @@ int playlist_resume(void)
empty_playlist(playlist, true); empty_playlist(playlist, true);
gui_syncsplash(0, ID2P(LANG_WAIT)); splash(0, ID2P(LANG_WAIT));
playlist->control_fd = open(playlist->control_filename, O_RDWR); playlist->control_fd = open(playlist->control_filename, O_RDWR);
if (playlist->control_fd < 0) if (playlist->control_fd < 0)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); splash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
return -1; return -1;
} }
playlist->control_created = true; playlist->control_created = true;
@ -2033,7 +2032,7 @@ int playlist_resume(void)
control_file_size = filesize(playlist->control_fd); control_file_size = filesize(playlist->control_fd);
if (control_file_size <= 0) if (control_file_size <= 0)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); splash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
return -1; return -1;
} }
@ -2042,7 +2041,7 @@ int playlist_resume(void)
PLAYLIST_COMMAND_SIZE<buflen?PLAYLIST_COMMAND_SIZE:buflen); PLAYLIST_COMMAND_SIZE<buflen?PLAYLIST_COMMAND_SIZE:buflen);
if(nread <= 0) if(nread <= 0)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); splash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
return -1; return -1;
} }
@ -2069,9 +2068,9 @@ int playlist_resume(void)
/* So a splash while we are loading. */ /* So a splash while we are loading. */
if (current_tick - last_tick > HZ/4) if (current_tick - last_tick > HZ/4)
{ {
gui_syncsplash(0, str(LANG_LOADING_PERCENT), splashf(0, str(LANG_LOADING_PERCENT),
(total_read+count)*100/control_file_size, (total_read+count)*100/control_file_size,
str(LANG_OFF_ABORT)); str(LANG_OFF_ABORT));
if (action_userabort(TIMEOUT_NOBLOCK)) if (action_userabort(TIMEOUT_NOBLOCK))
{ {
useraborted = true; useraborted = true;
@ -2337,13 +2336,13 @@ int playlist_resume(void)
if (result < 0) if (result < 0)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_INVALID)); splash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_INVALID));
return result; return result;
} }
if (useraborted) if (useraborted)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_CANCEL)); splash(HZ*2, ID2P(LANG_CANCEL));
return -1; return -1;
} }
if (!newline || (exit_loop && count<nread)) if (!newline || (exit_loop && count<nread))
@ -2351,7 +2350,7 @@ int playlist_resume(void)
if ((total_read + count) >= control_file_size) if ((total_read + count) >= control_file_size)
{ {
/* no newline at end of control file */ /* no newline at end of control file */
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_INVALID)); splash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_INVALID));
return -1; return -1;
} }
@ -2861,7 +2860,7 @@ int playlist_insert_track(struct playlist_info* playlist, const char *filename,
if (check_control(playlist) < 0) if (check_control(playlist) < 0)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); splash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
return -1; return -1;
} }
@ -2892,7 +2891,7 @@ int playlist_insert_directory(struct playlist_info* playlist,
if (check_control(playlist) < 0) if (check_control(playlist) < 0)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); splash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
return -1; return -1;
} }
@ -2959,14 +2958,14 @@ int playlist_insert_playlist(struct playlist_info* playlist, const char *filenam
if (check_control(playlist) < 0) if (check_control(playlist) < 0)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); splash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
return -1; return -1;
} }
fd = open_utf8(filename, O_RDONLY); fd = open_utf8(filename, O_RDONLY);
if (fd < 0) if (fd < 0)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_ACCESS_ERROR)); splash(HZ*2, ID2P(LANG_PLAYLIST_ACCESS_ERROR));
return -1; return -1;
} }
@ -3087,7 +3086,7 @@ int playlist_delete(struct playlist_info* playlist, int index)
if (check_control(playlist) < 0) if (check_control(playlist) < 0)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); splash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
return -1; return -1;
} }
@ -3122,7 +3121,7 @@ int playlist_move(struct playlist_info* playlist, int index, int new_index)
if (check_control(playlist) < 0) if (check_control(playlist) < 0)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); splash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
return -1; return -1;
} }
@ -3385,7 +3384,7 @@ int playlist_save(struct playlist_info* playlist, char *filename)
if (playlist->buffer_size < (int)(playlist->amount * sizeof(int))) if (playlist->buffer_size < (int)(playlist->amount * sizeof(int)))
{ {
/* not enough buffer space to store updated indices */ /* not enough buffer space to store updated indices */
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_ACCESS_ERROR)); splash(HZ*2, ID2P(LANG_PLAYLIST_ACCESS_ERROR));
return -1; return -1;
} }
@ -3409,7 +3408,7 @@ int playlist_save(struct playlist_info* playlist, char *filename)
} }
if (fd < 0) if (fd < 0)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_ACCESS_ERROR)); splash(HZ*2, ID2P(LANG_PLAYLIST_ACCESS_ERROR));
return -1; return -1;
} }
@ -3450,7 +3449,7 @@ int playlist_save(struct playlist_info* playlist, char *filename)
if (fdprintf(fd, "%s\n", tmp_buf) < 0) if (fdprintf(fd, "%s\n", tmp_buf) < 0)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_ACCESS_ERROR)); splash(HZ*2, ID2P(LANG_PLAYLIST_ACCESS_ERROR));
result = -1; result = -1;
break; break;
} }
@ -3538,7 +3537,7 @@ int playlist_directory_tracksearch(const char* dirname, bool recurse,
if (ft_load(tc, dirname) < 0) if (ft_load(tc, dirname) < 0)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR)); splash(HZ*2, ID2P(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR));
*(tc->dirfilter) = old_dirfilter; *(tc->dirfilter) = old_dirfilter;
return -1; return -1;
} }

View file

@ -96,8 +96,7 @@ static int initialize_catalog(void)
if (!playlist_dir_exists) if (!playlist_dir_exists)
{ {
if (mkdir(playlist_dir) < 0) { if (mkdir(playlist_dir) < 0) {
gui_syncsplash(HZ*2, ID2P(LANG_CATALOG_NO_DIRECTORY), splashf(HZ*2, ID2P(LANG_CATALOG_NO_DIRECTORY), playlist_dir);
playlist_dir);
return -1; return -1;
} }
else { else {
@ -130,8 +129,7 @@ static int create_playlist_list(char** playlists, int num_items,
if (ft_load(tc, playlist_dir) < 0) if (ft_load(tc, playlist_dir) < 0)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_CATALOG_NO_DIRECTORY), splashf(HZ*2, ID2P(LANG_CATALOG_NO_DIRECTORY), playlist_dir);
playlist_dir);
goto exit; goto exit;
} }
@ -234,7 +232,7 @@ static int display_playlists(char* playlist, bool view)
if (num_playlists <= 0) if (num_playlists <= 0)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_CATALOG_NO_PLAYLISTS)); splash(HZ*2, ID2P(LANG_CATALOG_NO_PLAYLISTS));
return -1; return -1;
} }
@ -327,8 +325,7 @@ static void display_insert_count(int count)
talk_id(LANG_PLAYLIST_INSERT_COUNT, true); talk_id(LANG_PLAYLIST_INSERT_COUNT, true);
} }
gui_syncsplash(0, str(LANG_PLAYLIST_INSERT_COUNT), count, splashf(0, str(LANG_PLAYLIST_INSERT_COUNT), count, str(LANG_OFF_ABORT));
str(LANG_OFF_ABORT));
} }
/* Add specified track into playlist. Callback from directory insert */ /* Add specified track into playlist. Callback from directory insert */

View file

@ -293,7 +293,7 @@ static bool playlist_viewer_init(struct playlist_viewer * viewer,
if (!have_list) if (!have_list)
{ {
/* Nothing to view, exit */ /* Nothing to view, exit */
gui_syncsplash(HZ, str(LANG_CATALOG_NO_PLAYLISTS)); splash(HZ, str(LANG_CATALOG_NO_PLAYLISTS));
return false; return false;
} }
@ -680,8 +680,8 @@ bool playlist_viewer_ex(const char* filename)
ret_val = playlist_move(viewer.playlist, viewer.move_track, ret_val = playlist_move(viewer.playlist, viewer.move_track,
current_track->index); current_track->index);
if (ret_val < 0) if (ret_val < 0)
gui_syncsplash(HZ, (unsigned char *)"%s %s", splashf(HZ, (unsigned char *)"%s %s", str(LANG_MOVE),
str(LANG_MOVE), str(LANG_FAILED)); str(LANG_FAILED));
update_playlist(true); update_playlist(true);
viewer.move_track = -1; viewer.move_track = -1;
} }
@ -795,7 +795,7 @@ bool search_playlist(void)
playlist_count = playlist_amount_ex(viewer.playlist); playlist_count = playlist_amount_ex(viewer.playlist);
for (i=0;(i<playlist_count)&&(found_indicies_count<MAX_PLAYLIST_ENTRIES);i++) for (i=0;(i<playlist_count)&&(found_indicies_count<MAX_PLAYLIST_ENTRIES);i++)
{ {
gui_syncsplash(0, str(LANG_PLAYLIST_SEARCH_MSG),found_indicies_count, splashf(0, str(LANG_PLAYLIST_SEARCH_MSG), found_indicies_count,
str(LANG_OFF_ABORT)); str(LANG_OFF_ABORT));
if (action_userabort(TIMEOUT_NOBLOCK)) if (action_userabort(TIMEOUT_NOBLOCK))
{ {

View file

@ -157,7 +157,8 @@ static const struct plugin_api rockbox_api = {
backlight_set_timeout_plugged, backlight_set_timeout_plugged,
#endif #endif
is_backlight_on, is_backlight_on,
gui_syncsplash, splash,
splashf,
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
/* remote lcd */ /* remote lcd */
@ -639,32 +640,32 @@ int plugin_load(const char* plugin, const void* parameter)
plugin_loaded = false; plugin_loaded = false;
} }
gui_syncsplash(0, ID2P(LANG_WAIT)); splash(0, ID2P(LANG_WAIT));
strcpy(current_plugin, plugin); strcpy(current_plugin, plugin);
#ifdef SIMULATOR #ifdef SIMULATOR
hdr = sim_plugin_load((char *)plugin, &pd); hdr = sim_plugin_load((char *)plugin, &pd);
if (pd == NULL) { if (pd == NULL) {
gui_syncsplash(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin); splashf(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin);
return -1; return -1;
} }
if (hdr == NULL if (hdr == NULL
|| hdr->magic != PLUGIN_MAGIC || hdr->magic != PLUGIN_MAGIC
|| hdr->target_id != TARGET_ID) { || hdr->target_id != TARGET_ID) {
sim_plugin_close(pd); sim_plugin_close(pd);
gui_syncsplash(HZ*2, str(LANG_PLUGIN_WRONG_MODEL)); splash(HZ*2, str(LANG_PLUGIN_WRONG_MODEL));
return -1; return -1;
} }
if (hdr->api_version > PLUGIN_API_VERSION if (hdr->api_version > PLUGIN_API_VERSION
|| hdr->api_version < PLUGIN_MIN_API_VERSION) { || hdr->api_version < PLUGIN_MIN_API_VERSION) {
sim_plugin_close(pd); sim_plugin_close(pd);
gui_syncsplash(HZ*2, str(LANG_PLUGIN_WRONG_VERSION)); splash(HZ*2, str(LANG_PLUGIN_WRONG_VERSION));
return -1; return -1;
} }
#else #else
fd = open(plugin, O_RDONLY); fd = open(plugin, O_RDONLY);
if (fd < 0) { if (fd < 0) {
gui_syncsplash(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin); splashf(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin);
return fd; return fd;
} }
#if NUM_CORES > 1 #if NUM_CORES > 1
@ -678,7 +679,7 @@ int plugin_load(const char* plugin, const void* parameter)
close(fd); close(fd);
if (readsize < 0) { if (readsize < 0) {
gui_syncsplash(HZ*2, str(LANG_READ_FAILED), plugin); splashf(HZ*2, str(LANG_READ_FAILED), plugin);
return -1; return -1;
} }
hdr = (struct plugin_header *)pluginbuf; hdr = (struct plugin_header *)pluginbuf;
@ -688,12 +689,12 @@ int plugin_load(const char* plugin, const void* parameter)
|| hdr->target_id != TARGET_ID || hdr->target_id != TARGET_ID
|| hdr->load_addr != pluginbuf || hdr->load_addr != pluginbuf
|| hdr->end_addr > pluginbuf + PLUGIN_BUFFER_SIZE) { || hdr->end_addr > pluginbuf + PLUGIN_BUFFER_SIZE) {
gui_syncsplash(HZ*2, str(LANG_PLUGIN_WRONG_MODEL)); splash(HZ*2, str(LANG_PLUGIN_WRONG_MODEL));
return -1; return -1;
} }
if (hdr->api_version > PLUGIN_API_VERSION if (hdr->api_version > PLUGIN_API_VERSION
|| hdr->api_version < PLUGIN_MIN_API_VERSION) { || hdr->api_version < PLUGIN_MIN_API_VERSION) {
gui_syncsplash(HZ*2, str(LANG_PLUGIN_WRONG_VERSION)); splash(HZ*2, str(LANG_PLUGIN_WRONG_VERSION));
return -1; return -1;
} }
plugin_size = hdr->end_addr - pluginbuf; plugin_size = hdr->end_addr - pluginbuf;
@ -768,7 +769,7 @@ int plugin_load(const char* plugin, const void* parameter)
return PLUGIN_USB_CONNECTED; return PLUGIN_USB_CONNECTED;
default: default:
gui_syncsplash(HZ*2, str(LANG_PLUGIN_ERROR)); splash(HZ*2, str(LANG_PLUGIN_ERROR));
break; break;
} }
return PLUGIN_OK; return PLUGIN_OK;

View file

@ -130,12 +130,12 @@ void* plugin_get_buffer(size_t *buffer_size);
#define PLUGIN_MAGIC 0x526F634B /* RocK */ #define PLUGIN_MAGIC 0x526F634B /* RocK */
/* increase this every time the api struct changes */ /* increase this every time the api struct changes */
#define PLUGIN_API_VERSION 121 #define PLUGIN_API_VERSION 122
/* update this to latest version if a change to the api struct breaks /* update this to latest version if a change to the api struct breaks
backwards compatibility (and please take the opportunity to sort in any backwards compatibility (and please take the opportunity to sort in any
new function which are "waiting" at the end of the function table) */ new function which are "waiting" at the end of the function table) */
#define PLUGIN_MIN_API_VERSION 121 #define PLUGIN_MIN_API_VERSION 122
/* plugin return codes */ /* plugin return codes */
enum plugin_status { enum plugin_status {
@ -256,7 +256,8 @@ struct plugin_api {
void (*backlight_set_timeout_plugged)(int index); void (*backlight_set_timeout_plugged)(int index);
#endif #endif
bool (*is_backlight_on)(bool ignore_always_off); bool (*is_backlight_on)(bool ignore_always_off);
void (*splash)(int ticks, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3); void (*splash)(int ticks, const char *str);
void (*splashf)(int ticks, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
/* remote lcd */ /* remote lcd */

View file

@ -2319,7 +2319,7 @@ static int bubbles_handlebuttons(struct game_context* bb, bool animblock,
case BUBBLES_START: /* pause the game */ case BUBBLES_START: /* pause the game */
start = *rb->current_tick; start = *rb->current_tick;
rb->splash(1, "Paused"); rb->splash(0, "Paused");
while(pluginlib_getaction(rb,TIMEOUT_BLOCK,plugin_contexts,2) while(pluginlib_getaction(rb,TIMEOUT_BLOCK,plugin_contexts,2)
!= (BUBBLES_START)); != (BUBBLES_START));
bb->startedshot += *rb->current_tick-start; bb->startedshot += *rb->current_tick-start;

View file

@ -159,13 +159,13 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
FOR_NB_SCREENS(i) FOR_NB_SCREENS(i)
rb->screens[i]->clear_display(); rb->screens[i]->clear_display();
if(rc < 0) { if(rc < 0) {
rb->splash(HZ, "Can't write file: %d", rc); rb->splashf(HZ, "Can't write file: %d", rc);
} else { } else {
rb->splash(HZ, "Done"); rb->splash(HZ, "Done");
} }
} else { } else {
if(rc < 0) { if(rc < 0) {
rb->splash(HZ, "Can't read file: %d", rc); rb->splashf(HZ, "Can't read file: %d", rc);
} else { } else {
rb->splash(HZ, "The file is too big"); rb->splash(HZ, "The file is too big");
} }

View file

@ -1261,7 +1261,7 @@ static void jewels_nextlevel(struct game_context* bj) {
while(bj->score >= LEVEL_PTS) { while(bj->score >= LEVEL_PTS) {
bj->score -= LEVEL_PTS; bj->score -= LEVEL_PTS;
bj->level++; bj->level++;
rb->splash(HZ*2, "Level %d", bj->level); rb->splashf(HZ*2, "Level %d", bj->level);
jewels_drawboard(bj); jewels_drawboard(bj);
} }
@ -1283,7 +1283,7 @@ static void jewels_nextlevel(struct game_context* bj) {
rb->splash(HZ*2, "You win!"); rb->splash(HZ*2, "You win!");
bj->level = 1; bj->level = 1;
} else { } else {
rb->splash(HZ*2, "Level %d", bj->level); rb->splashf(HZ*2, "Level %d", bj->level);
} }
break; break;
} }

View file

@ -3026,7 +3026,7 @@ struct t_disp* get_image(struct jpeg* p_jpg, int ds)
#endif #endif
if (status) if (status)
{ {
rb->splash(HZ, "decode error %d", status); rb->splashf(HZ, "decode error %d", status);
file_pt[curfile] = '\0'; file_pt[curfile] = '\0';
return NULL; return NULL;
} }
@ -3212,7 +3212,7 @@ int load_and_show(char* filename)
if (status < 0 || (status & (DQT | SOF0)) != (DQT | SOF0)) if (status < 0 || (status & (DQT | SOF0)) != (DQT | SOF0))
{ /* bad format or minimum components not contained */ { /* bad format or minimum components not contained */
rb->splash(HZ, "unsupported %d", status); rb->splashf(HZ, "unsupported %d", status);
file_pt[curfile] = '\0'; file_pt[curfile] = '\0';
return change_filename(direction); return change_filename(direction);
} }

View file

@ -312,9 +312,9 @@ static void splash_pw(int selected_item)
entry = entry->next; entry = entry->next;
} }
if (entry->name != '\0') if (entry->name != '\0')
rb->splash(0, "%s %s", entry->name, entry->password); rb->splashf(0, "%s %s", entry->name, entry->password);
else else
rb->splash(0, "%s", entry->password); rb->splashf(0, "%s", entry->password);
rb->get_action(CONTEXT_STD, TIMEOUT_BLOCK); rb->get_action(CONTEXT_STD, TIMEOUT_BLOCK);
} }

View file

@ -57,7 +57,7 @@ enum plugin_status run_overlay(const struct plugin_api* rb, const void* paramete
fd = rb->open(filename, O_RDONLY); fd = rb->open(filename, O_RDONLY);
if (fd < 0) if (fd < 0)
{ {
rb->splash(2*HZ, "Can't open %s", filename); rb->splashf(2*HZ, "Can't open %s", filename);
return PLUGIN_ERROR; return PLUGIN_ERROR;
} }
readsize = rb->read(fd, &header, sizeof(header)); readsize = rb->read(fd, &header, sizeof(header));
@ -67,17 +67,17 @@ enum plugin_status run_overlay(const struct plugin_api* rb, const void* paramete
if (readsize != sizeof(header)) if (readsize != sizeof(header))
{ {
rb->splash(2*HZ, "Reading %s overlay failed.", name); rb->splashf(2*HZ, "Reading %s overlay failed.", name);
return PLUGIN_ERROR; return PLUGIN_ERROR;
} }
if (header.magic != PLUGIN_MAGIC || header.target_id != TARGET_ID) if (header.magic != PLUGIN_MAGIC || header.target_id != TARGET_ID)
{ {
rb->splash(2*HZ, "%s overlay: Incompatible model.", name); rb->splashf(2*HZ, "%s overlay: Incompatible model.", name);
return PLUGIN_ERROR; return PLUGIN_ERROR;
} }
if (header.api_version != PLUGIN_API_VERSION) if (header.api_version != PLUGIN_API_VERSION)
{ {
rb->splash(2*HZ, "%s overlay: Incompatible version.", name); rb->splashf(2*HZ, "%s overlay: Incompatible version.", name);
return PLUGIN_ERROR; return PLUGIN_ERROR;
} }
@ -85,14 +85,14 @@ enum plugin_status run_overlay(const struct plugin_api* rb, const void* paramete
if (header.load_addr < audiobuf || if (header.load_addr < audiobuf ||
header.end_addr > audiobuf + audiobuf_size) header.end_addr > audiobuf + audiobuf_size)
{ {
rb->splash(2*HZ, "%s overlay doesn't fit into memory.", name); rb->splashf(2*HZ, "%s overlay doesn't fit into memory.", name);
return PLUGIN_ERROR; return PLUGIN_ERROR;
} }
fd = rb->open(filename, O_RDONLY); fd = rb->open(filename, O_RDONLY);
if (fd < 0) if (fd < 0)
{ {
rb->splash(2*HZ, "Can't open %s", filename); rb->splashf(2*HZ, "Can't open %s", filename);
return PLUGIN_ERROR; return PLUGIN_ERROR;
} }
readsize = rb->read(fd, header.load_addr, header.end_addr - header.load_addr); readsize = rb->read(fd, header.load_addr, header.end_addr - header.load_addr);
@ -100,7 +100,7 @@ enum plugin_status run_overlay(const struct plugin_api* rb, const void* paramete
if (readsize < 0) if (readsize < 0)
{ {
rb->splash(2*HZ, "Reading %s overlay failed.", name); rb->splashf(2*HZ, "Reading %s overlay failed.", name);
return PLUGIN_ERROR; return PLUGIN_ERROR;
} }
/* Zero out bss area */ /* Zero out bss area */

View file

@ -715,7 +715,7 @@ static void play_level(short level, short lives, bool new_level)
*/ */
rb->lcd_remote_clear_display(); rb->lcd_remote_clear_display();
#endif #endif
rb->splash(MAZEZAM_DELAY_LIVES, MAZEZAM_TEXT_LIVES, rb->splashf(MAZEZAM_DELAY_LIVES, MAZEZAM_TEXT_LIVES,
level+1, lives); level+1, lives);
/* ensure keys pressed during the splash screen are ignored */ /* ensure keys pressed during the splash screen are ignored */

View file

@ -58,7 +58,7 @@ static void hash_file( int out, const char *path )
{ {
char string[MD5_STRING_LENGTH+1]; char string[MD5_STRING_LENGTH+1];
done++; done++;
rb->splash( 0, "%d / %d : %s", done, count, path ); rb->splashf( 0, "%d / %d : %s", done, count, path );
if( hash( string, path ) ) if( hash( string, path ) )
rb->write( out, "error", 5 ); rb->write( out, "error", 5 );
else else
@ -140,7 +140,7 @@ static void hash_check( int out, const char *path )
{ {
const char *filename = rb->strchr( line, ' ' ); const char *filename = rb->strchr( line, ' ' );
done++; done++;
rb->splash( 0, "%d / %d : %s", done, count, filename ); rb->splashf( 0, "%d / %d : %s", done, count, filename );
if( !filename || len < MD5_STRING_LENGTH + 2 ) if( !filename || len < MD5_STRING_LENGTH + 2 )
{ {
const char error[] = "Malformed input line ... skipping"; const char error[] = "Malformed input line ... skipping";

View file

@ -749,12 +749,12 @@ enum minesweeper_status minesweeper( void )
break; break;
flags_used = count_flags(); flags_used = count_flags();
if (flags_used == 1) { if (flags_used == 1) {
rb->splash( HZ*2, "You marked 1 field. There are %d mines.", rb->splashf( HZ*2, "You marked 1 field. There are %d mines.",
mine_num ); mine_num );
} }
else else
{ {
rb->splash( HZ*2, "You marked %d fields. There are %d mines.", rb->splashf( HZ*2, "You marked %d fields. There are %d mines.",
flags_used, mine_num ); flags_used, mine_num );
} }
break; break;

View file

@ -151,7 +151,7 @@ static inline void disk_buf_buffer(void)
wm : AVERAGE(disk_buf.low_wm, wm, 16); wm : AVERAGE(disk_buf.low_wm, wm, 16);
#if 0 #if 0
rb->splash(0, "*%10ld %10ld", disk_buf.low_wm, rb->splashf(0, "*%10ld %10ld", disk_buf.low_wm,
disk_buf.win_right - sw.right); disk_buf.win_right - sw.right);
#endif #endif

View file

@ -1674,7 +1674,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
errstring = "Error opening file: %d"; errstring = "Error opening file: %d";
} }
rb->splash(HZ*2, errstring, err); rb->splashf(HZ*2, errstring, err);
} }
} }

View file

@ -421,7 +421,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
SETTINGS_VERSION); SETTINGS_VERSION);
} }
} else { } else {
rb->splash(HZ*2, "No ROMs in %s/pacman/", ROCKBOX_DIR); rb->splashf(HZ*2, "No ROMs in %s/pacman/", ROCKBOX_DIR);
} }
#ifdef HAVE_ADJUSTABLE_CPU_FREQ #ifdef HAVE_ADJUSTABLE_CPU_FREQ

View file

@ -36,7 +36,7 @@ PLUGIN_HEADER
#define PPM_OVERALLMAXVAL 65535 #define PPM_OVERALLMAXVAL 65535
#define PPM_MAXSIZE (300*1024)/sizeof(fb_data) #define PPM_MAXSIZE (300*1024)/sizeof(fb_data)
#define ppm_error(...) rb->splash(HZ*2, __VA_ARGS__ ) #define ppm_error(...) rb->splashf(HZ*2, __VA_ARGS__ )
static fb_data buffer[PPM_MAXSIZE]; static fb_data buffer[PPM_MAXSIZE];
static fb_data lcd_buf[LCD_WIDTH * LCD_HEIGHT]; static fb_data lcd_buf[LCD_WIDTH * LCD_HEIGHT];

View file

@ -292,7 +292,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
if(!found) if(!found)
{ {
/* weird: we couldn't find the entry. This Should Never Happen (TM) */ /* weird: we couldn't find the entry. This Should Never Happen (TM) */
rb->splash(0, "File/Dir not found: %s", file); rb->splashf(0, "File/Dir not found: %s", file);
rb->action_userabort(TIMEOUT_BLOCK); rb->action_userabort(TIMEOUT_BLOCK);
return PLUGIN_OK; return PLUGIN_OK;
} }

View file

@ -219,7 +219,7 @@ void generate(void)
rb->write(fd,&dirs_count,sizeof(int)); rb->write(fd,&dirs_count,sizeof(int));
if (fd < 0) if (fd < 0)
{ {
rb->splash(HZ, "Couldnt open %s", RFA_FILE); rb->splashf(HZ, "Couldnt open %s", RFA_FILE);
return; return;
} }
#ifndef HAVE_LCD_CHARCELLS #ifndef HAVE_LCD_CHARCELLS
@ -295,7 +295,7 @@ int edit_list(void)
/* load the dat file if not already done */ /* load the dat file if not already done */
if ((list == NULL || list->count == 0) && (i = load_list()) != 0) if ((list == NULL || list->count == 0) && (i = load_list()) != 0)
{ {
rb->splash(HZ*2, "Could not load %s, rv = %d", RFA_FILE, i); rb->splashf(HZ*2, "Could not load %s, rv = %d", RFA_FILE, i);
return -1; return -1;
} }
@ -387,13 +387,13 @@ int export_list_to_file_text(void)
/* load the dat file if not already done */ /* load the dat file if not already done */
if ((list == NULL || list->count == 0) && (i = load_list()) != 0) if ((list == NULL || list->count == 0) && (i = load_list()) != 0)
{ {
rb->splash(HZ*2, "Could not load %s, rv = %d", RFA_FILE, i); rb->splashf(HZ*2, "Could not load %s, rv = %d", RFA_FILE, i);
return 0; return 0;
} }
if (list->count <= 0) if (list->count <= 0)
{ {
rb->splash(HZ*2, "no dirs in list file: %s", RFA_FILE); rb->splashf(HZ*2, "no dirs in list file: %s", RFA_FILE);
return 0; return 0;
} }
@ -401,7 +401,7 @@ int export_list_to_file_text(void)
int myfd = rb->creat(RFA_FILE_TEXT); int myfd = rb->creat(RFA_FILE_TEXT);
if (myfd < 0) if (myfd < 0)
{ {
rb->splash(HZ*4, "failed to open: fd = %d, file = %s", rb->splashf(HZ*4, "failed to open: fd = %d, file = %s",
myfd, RFA_FILE_TEXT); myfd, RFA_FILE_TEXT);
return -1; return -1;
} }
@ -434,7 +434,7 @@ int import_list_from_file_text(void)
int myfd = rb->open(RFA_FILE_TEXT, O_RDONLY); int myfd = rb->open(RFA_FILE_TEXT, O_RDONLY);
if (myfd < 0) if (myfd < 0)
{ {
rb->splash(HZ*2, "failed to open: %s", RFA_FILE_TEXT); rb->splashf(HZ*2, "failed to open: %s", RFA_FILE_TEXT);
return -1; return -1;
} }

View file

@ -2520,12 +2520,12 @@ static void goto_menu(void)
{ {
if( load_bitmap( filename ) <= 0 ) if( load_bitmap( filename ) <= 0 )
{ {
rb->splash( 1*HZ, "Error while loading %s", rb->splashf( 1*HZ, "Error while loading %s",
filename ); filename );
} }
else else
{ {
rb->splash( 1*HZ, "Image loaded (%s)", filename ); rb->splashf( 1*HZ, "Image loaded (%s)", filename );
restore_screen(); restore_screen();
inv_cursor(true); inv_cursor(true);
return; return;
@ -2542,7 +2542,7 @@ static void goto_menu(void)
rb->strcasecmp(&filename[rb->strlen(filename)-4], ".bmp")) rb->strcasecmp(&filename[rb->strlen(filename)-4], ".bmp"))
rb->strcat(filename, ".bmp"); rb->strcat(filename, ".bmp");
save_bitmap( filename ); save_bitmap( filename );
rb->splash( 1*HZ, "File saved (%s)", filename ); rb->splashf( 1*HZ, "File saved (%s)", filename );
} }
break; break;
@ -3011,7 +3011,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
} }
else else
{ {
rb->splash( 1*HZ, "Image loaded (%s)", (char *)parameter ); rb->splashf( 1*HZ, "Image loaded (%s)", (char *)parameter );
restore_screen(); restore_screen();
rb->strcpy( filename, parameter ); rb->strcpy( filename, parameter );
} }

View file

@ -85,7 +85,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* void_p
if (!found) { if (!found) {
/* Something's gone properly pear shaped - /* Something's gone properly pear shaped -
* we couldn't even find the entry */ * we couldn't even find the entry */
rb->splash(HZ*2, "File/Dir not found: %s", parameter); rb->splashf(HZ*2, "File/Dir not found: %s", parameter);
return PLUGIN_ERROR; return PLUGIN_ERROR;
} }

View file

@ -90,7 +90,7 @@ bool load_sc_file(sc_file_t *file, char *filename, bool must_exist,
if (fd < 0){ if (fd < 0){
/* For some reason we couldn't create the file, /* For some reason we couldn't create the file,
* so return an error message and exit */ * so return an error message and exit */
rb->splash(HZ*2, "Couldn't create the shortcuts file %s", rb->splashf(HZ*2, "Couldn't create the shortcuts file %s",
filename); filename);
goto end_of_proc; goto end_of_proc;
} }
@ -98,7 +98,7 @@ bool load_sc_file(sc_file_t *file, char *filename, bool must_exist,
ret_val = true; ret_val = true;
goto end_of_proc; goto end_of_proc;
} else { } else {
rb->splash(HZ, "Couldn't open %s", filename); rb->splashf(HZ, "Couldn't open %s", filename);
goto end_of_proc; goto end_of_proc;
} }
} }
@ -108,7 +108,7 @@ bool load_sc_file(sc_file_t *file, char *filename, bool must_exist,
continue; continue;
} }
if (file->entry_cnt >= file->max_entries) { if (file->entry_cnt >= file->max_entries) {
rb->splash(HZ*2, "Too many entries in the file, max allowed: %d", rb->splashf(HZ*2, "Too many entries in the file, max allowed: %d",
file->max_entries); file->max_entries);
goto end_of_proc; goto end_of_proc;
} }
@ -320,7 +320,7 @@ bool dump_sc_file(sc_file_t *file, char *filename)
* thing. */ * thing. */
fd = rb->open(filename, O_WRONLY|O_TRUNC); fd = rb->open(filename, O_WRONLY|O_TRUNC);
if (fd < 0) { if (fd < 0) {
rb->splash(HZ*2, "Could not open shortcuts file %s for writing", rb->splashf(HZ*2, "Could not open shortcuts file %s for writing",
filename); filename);
return false; return false;
} }

View file

@ -149,7 +149,7 @@ bool list_sc(bool is_editable)
case SCLA_SELECT: case SCLA_SELECT:
return goto_entry(sc_file.entries[selected_item].path); return goto_entry(sc_file.entries[selected_item].path);
case SCLA_DELETE: case SCLA_DELETE:
rb->splash(HZ, "Deleting %s", sc_file.entries[selected_item].disp); rb->splashf(HZ, "Deleting %s", sc_file.entries[selected_item].disp);
remove_entry(&sc_file, selected_item); remove_entry(&sc_file, selected_item);
dump_sc_file(&sc_file, link_filename); dump_sc_file(&sc_file, link_filename);
return (sc_file.entry_cnt == 0); return (sc_file.entry_cnt == 0);
@ -175,7 +175,7 @@ bool goto_entry(char *file_or_dir)
} }
if (!exists) { if (!exists) {
rb->splash(HZ*2, "%s %s no longer exists on disk", what, file_or_dir); rb->splashf(HZ*2, "%s %s no longer exists on disk", what, file_or_dir);
return false; return false;
} }
/* Set the browsers dirfilter to the global setting /* Set the browsers dirfilter to the global setting

View file

@ -618,7 +618,7 @@ static bool read_levels(bool initialize)
buffered_boards.start = 0; buffered_boards.start = 0;
if ((fd = rb->open(buffered_boards.filename, O_RDONLY)) < 0) { if ((fd = rb->open(buffered_boards.filename, O_RDONLY)) < 0) {
rb->splash(HZ*2, "Unable to open %s", buffered_boards.filename); rb->splashf(HZ*2, "Unable to open %s", buffered_boards.filename);
return false; return false;
} }
@ -930,7 +930,7 @@ static bool save(char *filename, bool solution)
if (filename[0] == '\0' || if (filename[0] == '\0' ||
(fd = rb->open(filename, O_WRONLY|O_CREAT|O_TRUNC)) < 0) { (fd = rb->open(filename, O_WRONLY|O_CREAT|O_TRUNC)) < 0) {
rb->splash(HZ*2, "Unable to open %s", filename); rb->splashf(HZ*2, "Unable to open %s", filename);
return false; return false;
} }
@ -965,7 +965,7 @@ static bool load(char *filename, bool silent)
if (filename[0] == '\0' || (fd = rb->open(filename, O_RDONLY)) < 0) { if (filename[0] == '\0' || (fd = rb->open(filename, O_RDONLY)) < 0) {
if (!silent) if (!silent)
rb->splash(HZ*2, "Unable to open %s", filename); rb->splashf(HZ*2, "Unable to open %s", filename);
return false; return false;
} }

View file

@ -207,7 +207,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
rc = write_file(); rc = write_file();
if(rc < 0) { if(rc < 0) {
rb->lcd_clear_display(); rb->lcd_clear_display();
rb->splash(HZ, "Can't write file: %d", rc); rb->splashf(HZ, "Can't write file: %d", rc);
} else { } else {
rb->lcd_clear_display(); rb->lcd_clear_display();
rb->splash(HZ, "Done"); rb->splash(HZ, "Done");
@ -215,7 +215,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
} else { } else {
if(rc < 0) { if(rc < 0) {
rb->lcd_clear_display(); rb->lcd_clear_display();
rb->splash(HZ, "Can't read file: %d", rc); rb->splashf(HZ, "Can't read file: %d", rc);
} else { } else {
rb->lcd_clear_display(); rb->lcd_clear_display();
rb->splash(HZ, "The file is too big"); rb->splash(HZ, "The file is too big");

View file

@ -690,7 +690,7 @@ static int save(
if (close_stat != 0) if (close_stat != 0)
{ {
rb->splash(0, "failed closing file1: error %d", close_stat); rb->splashf(0, "failed closing file1: error %d", close_stat);
rb->button_get(true); rb->button_get(true);
rb->button_get(true); rb->button_get(true);
} else { } else {
@ -702,7 +702,7 @@ static int save(
} }
else else
{ {
rb->splash(0, "Can't write File1: error %d", file1); rb->splashf(0, "Can't write File1: error %d", file1);
rb->button_get(true); rb->button_get(true);
rb->button_get(true); rb->button_get(true);
retval = -1; retval = -1;
@ -713,7 +713,7 @@ static int save(
{ {
if (rb->lseek(src_file, end, SEEK_SET) < (off_t)end) if (rb->lseek(src_file, end, SEEK_SET) < (off_t)end)
{ {
rb->splash(0, "Src file to short: error %d", src_file); rb->splashf(0, "Src file to short: error %d", src_file);
rb->button_get(true); rb->button_get(true);
rb->button_get(true); rb->button_get(true);
} }
@ -731,7 +731,7 @@ static int save(
if (close_stat != 0) if (close_stat != 0)
{ {
rb->splash(0, "failed: closing file2: error %d", rb->splashf(0, "failed: closing file2: error %d",
close_stat); close_stat);
rb->button_get(true); rb->button_get(true);
rb->button_get(true); rb->button_get(true);
@ -744,7 +744,7 @@ static int save(
} }
else else
{ {
rb->splash(0, "Can't write File2: error %d", file2); rb->splashf(0, "Can't write File2: error %d", file2);
rb->button_get(true); rb->button_get(true);
rb->button_get(true); rb->button_get(true);
retval = -2; retval = -2;
@ -754,7 +754,7 @@ static int save(
close_stat = rb->close(src_file); close_stat = rb->close(src_file);
if (close_stat != 0) if (close_stat != 0)
{ {
rb->splash(0, "failed: closing src: error %d", close_stat); rb->splashf(0, "failed: closing src: error %d", close_stat);
rb->button_get(true); rb->button_get(true);
rb->button_get(true); rb->button_get(true);
} }

View file

@ -350,7 +350,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
fd = rb->open(filename,O_RDONLY); fd = rb->open(filename,O_RDONLY);
if (fd<0) if (fd<0)
{ {
rb->splash(HZ*2,"Couldnt open file: %s",(char*)parameter); rb->splashf(HZ*2,"Couldnt open file: %s",(char*)parameter);
return PLUGIN_ERROR; return PLUGIN_ERROR;
} }
#ifdef HAVE_LCD_COLOR #ifdef HAVE_LCD_COLOR
@ -363,7 +363,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
{ {
if (!do_action(ACTION_INSERT,temp_line,line_count)) if (!do_action(ACTION_INSERT,temp_line,line_count))
{ {
rb->splash(HZ*2,"Error reading file: %s",(char*)parameter); rb->splashf(HZ*2,"Error reading file: %s",(char*)parameter);
rb->close(fd); rb->close(fd);
return PLUGIN_ERROR; return PLUGIN_ERROR;
} }

View file

@ -119,7 +119,7 @@ static int insert_data_in_file(const char *fname, int fpos, char *buf, int num_b
static void fileerror(int rc) static void fileerror(int rc)
{ {
rb->splash(HZ*2, "File error: %d", rc); rb->splashf(HZ*2, "File error: %d", rc);
} }
static const unsigned char empty_id3_header[] = static const unsigned char empty_id3_header[] =

View file

@ -3500,7 +3500,7 @@ int play_file(char* filename)
format = letoh16(*(uint16_t *)(aud_buf + 20)); format = letoh16(*(uint16_t *)(aud_buf + 20));
if (format != 1) if (format != 1)
{ {
rb->splash(2*HZ, "Unsupported format: %d", format); rb->splashf(2*HZ, "Unsupported format: %d", format);
rb->close(fd); rb->close(fd);
return PLAY_ERROR; return PLAY_ERROR;
} }
@ -3508,7 +3508,7 @@ int play_file(char* filename)
channels = letoh16(*(uint16_t *)(aud_buf + 22)); channels = letoh16(*(uint16_t *)(aud_buf + 22));
if (channels > 2) if (channels > 2)
{ {
rb->splash(2*HZ, "Too many channels: %d", channels); rb->splashf(2*HZ, "Too many channels: %d", channels);
rb->close(fd); rb->close(fd);
return PLAY_ERROR; return PLAY_ERROR;
} }
@ -3516,7 +3516,7 @@ int play_file(char* filename)
samplebits = letoh16(*(uint16_t *)(aud_buf + 34)); samplebits = letoh16(*(uint16_t *)(aud_buf + 34));
if (samplebits != 16) if (samplebits != 16)
{ {
rb->splash(2*HZ, "Unsupported sample depth: %dbit", samplebits); rb->splashf(2*HZ, "Unsupported sample depth: %dbit", samplebits);
rb->close(fd); rb->close(fd);
return PLAY_ERROR; return PLAY_ERROR;
} }
@ -3534,7 +3534,7 @@ int play_file(char* filename)
case 44100: rate = 9; break; case 44100: rate = 9; break;
case 48000: rate = 10; break; case 48000: rate = 10; break;
default: default:
rb->splash(2*HZ, "Unsupported samplerate: %dHz", samplerate); rb->splashf(2*HZ, "Unsupported samplerate: %dHz", samplerate);
rb->close(fd); rb->close(fd);
return PLAY_ERROR; return PLAY_ERROR;
} }

View file

@ -3772,7 +3772,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
rc = rb->mkdir(recbasedir); rc = rb->mkdir(recbasedir);
if (rc < 0) if (rc < 0)
{ {
rb->splash(HZ*2, "Can't create directory %s. Error %d.", rb->splashf(HZ*2, "Can't create directory %s. Error %d.",
recbasedir, rc); recbasedir, rc);
return PLUGIN_ERROR; return PLUGIN_ERROR;
} }

View file

@ -203,7 +203,7 @@ static int readwavpeaks(const char *filename)
} }
if(((bytes_read/4)*4) != bytes_read) if(((bytes_read/4)*4) != bytes_read)
{ {
rb->splash(HZ*2, "bytes_read/*4 err: %ld",(long int)bytes_read); rb->splashf(HZ*2, "bytes_read/*4 err: %ld",(long int)bytes_read);
rb->close (file); rb->close (file);
return -1; return -1;
} }
@ -438,12 +438,12 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void *parame
/* zoom out */ /* zoom out */
if(zoomlevel > 1) if(zoomlevel > 1)
zoomlevel /= 2; zoomlevel /= 2;
rb->splash(HZ/2, "ZOOM: %dx",(int)zoomlevel); rb->splashf(HZ/2, "ZOOM: %dx",(int)zoomlevel);
break; break;
case ACTION_KBD_DOWN: case ACTION_KBD_DOWN:
if(zoomlevel < (mempeakcount / LCD_WIDTH / 2)) if(zoomlevel < (mempeakcount / LCD_WIDTH / 2))
zoomlevel *= 2; zoomlevel *= 2;
rb->splash(HZ/2, "ZOOM: %dx",(int)zoomlevel); rb->splashf(HZ/2, "ZOOM: %dx",(int)zoomlevel);
break; break;
case ACTION_KBD_LEFT: case ACTION_KBD_LEFT:
center -= 10 * (mempeakcount / LCD_WIDTH) / zoomlevel; center -= 10 * (mempeakcount / LCD_WIDTH) / zoomlevel;

View file

@ -845,7 +845,7 @@ static inline void move_board (void)
player.j = newj; player.j = newj;
} }
if (percentage_cache >= difficulty) { /* finished level */ if (percentage_cache >= difficulty) { /* finished level */
rb->splash (HZ * 2, "Level %d finished", player.level+1); rb->splashf (HZ * 2, "Level %d finished", player.level+1);
player.score += percentage_cache; player.score += percentage_cache;
if (player.level < MAX_LEVEL) if (player.level < MAX_LEVEL)
player.level++; player.level++;

View file

@ -651,7 +651,7 @@ void load_snapshot_file_type(char *name, int type)
snsh = rb->open(filenamebuf, O_RDONLY); snsh = rb->open(filenamebuf, O_RDONLY);
if(snsh < 0) { if(snsh < 0) {
#ifndef USE_GRAY #ifndef USE_GRAY
rb->splash(HZ, "Could not open snapshot file `%s'",filenamebuf); rb->splashf(HZ, "Could not open snapshot file `%s'",filenamebuf);
#endif #endif
return; return;
} }

View file

@ -532,7 +532,7 @@ static void init_load(const void *parameter)
check_params(parameter); check_params(parameter);
if(spcf_init_snapshot != NULL) { if(spcf_init_snapshot != NULL) {
#ifndef USE_GREY #ifndef USE_GREY
rb->splash(HZ, "Loading snapshot '%s'", spcf_init_snapshot); rb->splashf(HZ, "Loading snapshot '%s'", spcf_init_snapshot);
#endif #endif
load_snapshot_file_type(spcf_init_snapshot, spcf_init_snapshot_type); load_snapshot_file_type(spcf_init_snapshot, spcf_init_snapshot_type);

View file

@ -742,7 +742,7 @@ int radio_screen(void)
case ACTION_FM_PRESET: case ACTION_FM_PRESET:
if(num_presets < 1) if(num_presets < 1)
{ {
gui_syncsplash(HZ, ID2P(LANG_FM_NO_PRESETS)); splash(HZ, ID2P(LANG_FM_NO_PRESETS));
update_screen = true; update_screen = true;
FOR_NB_SCREENS(i) FOR_NB_SCREENS(i)
{ {
@ -776,7 +776,7 @@ int radio_screen(void)
case ACTION_FM_FREEZE: case ACTION_FM_FREEZE:
if(!screen_freeze) if(!screen_freeze)
{ {
gui_syncsplash(HZ, str(LANG_FM_FREEZE)); splash(HZ, str(LANG_FM_FREEZE));
screen_freeze = true; screen_freeze = true;
} }
else else
@ -917,8 +917,8 @@ int radio_screen(void)
FOR_NB_SCREENS(i) FOR_NB_SCREENS(i)
screens[i].puts_scroll(0, top_of_screen + 1, buf); screens[i].puts_scroll(0, top_of_screen + 1, buf);
snprintf(buf, 128, stereo?str(LANG_CHANNEL_STEREO): snprintf(buf, 128, "%s", stereo?str(LANG_CHANNEL_STEREO):
str(LANG_CHANNEL_MONO)); str(LANG_CHANNEL_MONO));
FOR_NB_SCREENS(i) FOR_NB_SCREENS(i)
screens[i].puts_scroll(0, top_of_screen + 2, buf); screens[i].puts_scroll(0, top_of_screen + 2, buf);
@ -1001,7 +1001,7 @@ int radio_screen(void)
#if CONFIG_CODEC != SWCODEC #if CONFIG_CODEC != SWCODEC
if(audio_status() & AUDIO_STATUS_ERROR) if(audio_status() & AUDIO_STATUS_ERROR)
{ {
gui_syncsplash(0, str(LANG_DISK_FULL)); splash(0, str(LANG_DISK_FULL));
gui_syncstatusbar_draw(&statusbars,true); gui_syncstatusbar_draw(&statusbars,true);
FOR_NB_SCREENS(i) FOR_NB_SCREENS(i)
{ {
@ -1083,7 +1083,7 @@ static void radio_save_presets(void)
} }
else else
{ {
gui_syncsplash(HZ, ID2P(LANG_FM_PRESET_SAVE_FAILED)); splash(HZ, ID2P(LANG_FM_PRESET_SAVE_FAILED));
} }
} }
@ -1169,7 +1169,7 @@ static int radio_add_preset(void)
} }
else else
{ {
gui_syncsplash(HZ, ID2P(LANG_FM_NO_FREE_PRESETS)); splash(HZ, ID2P(LANG_FM_NO_FREE_PRESETS));
} }
return true; return true;
} }
@ -1257,7 +1257,7 @@ static int save_preset_list(void)
if((!p1) || (len > MAX_FILENAME) || (len == 0)) if((!p1) || (len > MAX_FILENAME) || (len == 0))
{ {
/* no slash, too long or too short */ /* no slash, too long or too short */
gui_syncsplash(HZ, ID2P(LANG_INVALID_FILENAME)); splash(HZ, ID2P(LANG_INVALID_FILENAME));
} }
else else
{ {
@ -1277,7 +1277,7 @@ static int save_preset_list(void)
} }
} }
else else
gui_syncsplash(HZ, ID2P(LANG_FM_NO_PRESETS)); splash(HZ, ID2P(LANG_FM_NO_PRESETS));
return true; return true;
} }
@ -1456,8 +1456,6 @@ static int scan_presets(void *viewports)
const struct fm_region_data * const fmr = const struct fm_region_data * const fmr =
&fm_region_data[global_settings.fm_region]; &fm_region_data[global_settings.fm_region];
char buf[MAX_FMPRESET_LEN + 1];
curr_freq = fmr->freq_min; curr_freq = fmr->freq_min;
num_presets = 0; num_presets = 0;
memset(presets, 0, sizeof(presets)); memset(presets, 0, sizeof(presets));
@ -1473,8 +1471,7 @@ static int scan_presets(void *viewports)
frac = freq % 100; frac = freq % 100;
freq /= 100; freq /= 100;
snprintf(buf, MAX_FMPRESET_LEN, str(LANG_FM_SCANNING), freq, frac); splashf(0, str(LANG_FM_SCANNING), freq, frac);
gui_syncsplash(0, buf);
if(tuner_set(RADIO_SCAN_FREQUENCY, curr_freq)) if(tuner_set(RADIO_SCAN_FREQUENCY, curr_freq))
{ {

View file

@ -606,9 +606,9 @@ int rec_create_directory(void)
{ {
while (action_userabort(HZ) == false) while (action_userabort(HZ) == false)
{ {
gui_syncsplash(0, "%s %s", splashf(0, "%s %s",
str(LANG_REC_DIR_NOT_WRITABLE), str(LANG_REC_DIR_NOT_WRITABLE),
str(LANG_OFF_ABORT)); str(LANG_OFF_ABORT));
} }
} }
else else
@ -1442,7 +1442,6 @@ bool recording_screen(bool no_source)
screens[1].puts(0, 0, str(LANG_REMOTE_LCD_OFF)); screens[1].puts(0, 0, str(LANG_REMOTE_LCD_OFF));
screens[1].puts(0, 1, str(LANG_REMOTE_LCD_ON)); screens[1].puts(0, 1, str(LANG_REMOTE_LCD_ON));
screens[1].update_viewport(); screens[1].update_viewport();
gui_splash(&screens[0], 0, str(LANG_REMOTE_LCD_OFF));
} }
else else
{ {
@ -1789,7 +1788,7 @@ bool recording_screen(bool no_source)
audio_stat = audio_status(); audio_stat = audio_status();
if (audio_stat & AUDIO_STATUS_ERROR) if (audio_stat & AUDIO_STATUS_ERROR)
{ {
gui_syncsplash(0, str(LANG_DISK_FULL)); splash(0, str(LANG_DISK_FULL));
gui_syncstatusbar_draw(&statusbars, true); gui_syncstatusbar_draw(&statusbars, true);
FOR_NB_SCREENS(i) FOR_NB_SCREENS(i)

View file

@ -127,14 +127,14 @@ static int browser(void* param)
/* Maybe just needs to reboot due to delayed commit */ /* Maybe just needs to reboot due to delayed commit */
if (stat->commit_delayed) if (stat->commit_delayed)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_PLEASE_REBOOT)); splash(HZ*2, ID2P(LANG_PLEASE_REBOOT));
break; break;
} }
/* Check if ready status is known */ /* Check if ready status is known */
if (!stat->readyvalid) if (!stat->readyvalid)
{ {
gui_syncsplash(0, str(LANG_TAGCACHE_BUSY)); splash(0, str(LANG_TAGCACHE_BUSY));
continue; continue;
} }
@ -178,14 +178,14 @@ static int browser(void* param)
} }
if (stat->commit_step > 0) if (stat->commit_step > 0)
{ {
gui_syncsplash(0, "%s [%d/%d]", splashf(0, "%s [%d/%d]",
str(LANG_TAGCACHE_INIT), stat->commit_step, str(LANG_TAGCACHE_INIT), stat->commit_step,
tagcache_get_max_commit_step()); tagcache_get_max_commit_step());
} }
else else
{ {
gui_syncsplash(0, str(LANG_BUILDING_DATABASE), splashf(0, str(LANG_BUILDING_DATABASE),
stat->processed_entries); stat->processed_entries);
} }
} }
} }
@ -254,7 +254,7 @@ static int wpsscrn(void* param)
} }
else else
{ {
gui_syncsplash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME)); splash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME));
} }
#if LCD_DEPTH > 1 #if LCD_DEPTH > 1
show_main_backdrop(); show_main_backdrop();

View file

@ -168,9 +168,7 @@ int mmc_remove_request(void)
int i; int i;
FOR_NB_SCREENS(i) FOR_NB_SCREENS(i)
screens[i].clear_display(); screens[i].clear_display();
gui_syncsplash(1, str(LANG_REMOVE_MMC)); splash(0, ID2P(LANG_REMOVE_MMC));
if (global_settings.talk_menu)
talk_id(LANG_REMOVE_MMC, false);
while (1) while (1)
{ {
@ -389,7 +387,7 @@ int charging_screen(void)
#if CONFIG_CHARGING #if CONFIG_CHARGING
void charging_splash(void) void charging_splash(void)
{ {
gui_syncsplash(2*HZ, (unsigned char *)str(LANG_BATTERY_CHARGE)); splash(2*HZ, str(LANG_BATTERY_CHARGE));
button_clear_queue(); button_clear_queue();
} }
#endif #endif
@ -669,7 +667,7 @@ bool shutdown_screen(void)
lcd_stop_scroll(); lcd_stop_scroll();
gui_syncsplash(0, str(LANG_CONFIRM_SHUTDOWN)); splash(0, str(LANG_CONFIRM_SHUTDOWN));
while(!done && TIME_BEFORE(current_tick,time_entered+HZ*2)) while(!done && TIME_BEFORE(current_tick,time_entered+HZ*2))
{ {

View file

@ -634,15 +634,15 @@ bool settings_save_config(int options)
break; break;
} }
else { else {
gui_syncsplash(HZ, ID2P(LANG_CANCEL)); splash(HZ, ID2P(LANG_CANCEL));
return false; return false;
} }
} }
if (settings_write_config(filename, options)) if (settings_write_config(filename, options))
gui_syncsplash(HZ, ID2P(LANG_SETTINGS_SAVED)); splash(HZ, ID2P(LANG_SETTINGS_SAVED));
else else
gui_syncsplash(HZ, ID2P(LANG_FAILED)); splash(HZ, ID2P(LANG_FAILED));
return true; return true;
} }

View file

@ -187,10 +187,10 @@ extern unsigned char vp_dummy[VIRT_SIZE];
#define ID2P(id) (VIRT_PTR + id) #define ID2P(id) (VIRT_PTR + id)
/* resolve a pointer which could be a virtualized ID or a literal */ /* resolve a pointer which could be a virtualized ID or a literal */
#define P2STR(p) (char *)((p>=VIRT_PTR && p<=VIRT_PTR+VIRT_SIZE) ? str(p-VIRT_PTR) : p) #define P2STR(p) (char *)((p>=VIRT_PTR && p<VIRT_PTR+VIRT_SIZE) ? str(p-VIRT_PTR) : p)
/* get the string ID from a virtual pointer, -1 if not virtual */ /* get the string ID from a virtual pointer, -1 if not virtual */
#define P2ID(p) ((p>=VIRT_PTR && p<=VIRT_PTR+VIRT_SIZE) ? p-VIRT_PTR : -1) #define P2ID(p) ((p>=VIRT_PTR && p<VIRT_PTR+VIRT_SIZE) ? p-VIRT_PTR : -1)
/* !defined(HAVE_LCD_COLOR) implies HAVE_LCD_CONTRAST with default 40. /* !defined(HAVE_LCD_COLOR) implies HAVE_LCD_CONTRAST with default 40.
Explicitly define HAVE_LCD_CONTRAST in config file for newer ports for Explicitly define HAVE_LCD_CONTRAST in config file for newer ports for

View file

@ -711,10 +711,10 @@ static void tagtree_track_finish_event(struct mp3entry *id3)
bool tagtree_export(void) bool tagtree_export(void)
{ {
gui_syncsplash(0, str(LANG_CREATING)); splash(0, str(LANG_CREATING));
if (!tagcache_create_changelog(&tcs)) if (!tagcache_create_changelog(&tcs))
{ {
gui_syncsplash(HZ*2, ID2P(LANG_FAILED)); splash(HZ*2, ID2P(LANG_FAILED));
} }
return false; return false;
@ -722,10 +722,10 @@ bool tagtree_export(void)
bool tagtree_import(void) bool tagtree_import(void)
{ {
gui_syncsplash(0, ID2P(LANG_WAIT)); splash(0, ID2P(LANG_WAIT));
if (!tagcache_import_changelog()) if (!tagcache_import_changelog())
{ {
gui_syncsplash(HZ*2, ID2P(LANG_FAILED)); splash(HZ*2, ID2P(LANG_FAILED));
} }
return false; return false;
@ -942,8 +942,7 @@ static bool show_search_progress(bool init, int count)
/* Update progress every 1/10 of a second */ /* Update progress every 1/10 of a second */
if (current_tick - last_tick > HZ/10) if (current_tick - last_tick > HZ/10)
{ {
gui_syncsplash(0, str(LANG_PLAYLIST_SEARCH_MSG), count, splashf(0, str(LANG_PLAYLIST_SEARCH_MSG), count, str(LANG_OFF_ABORT));
str(LANG_OFF_ABORT));
if (action_userabort(TIMEOUT_NOBLOCK)) if (action_userabort(TIMEOUT_NOBLOCK))
return false; return false;
last_tick = current_tick; last_tick = current_tick;
@ -1266,7 +1265,7 @@ static int retrieve_entries(struct tree_context *c, struct tagcache_search *tcs,
if (!sort && (sort_inverse || sort_limit)) if (!sort && (sort_inverse || sort_limit))
{ {
gui_syncsplash(HZ*4, ID2P(LANG_SHOWDIR_BUFFER_FULL), total_count); splashf(HZ*4, ID2P(LANG_SHOWDIR_BUFFER_FULL), total_count);
logf("Too small dir buffer"); logf("Too small dir buffer");
return 0; return 0;
} }
@ -1369,7 +1368,7 @@ int tagtree_load(struct tree_context* c)
{ {
c->dirlevel = 0; c->dirlevel = 0;
count = load_root(c); count = load_root(c);
gui_syncsplash(HZ, str(LANG_TAGCACHE_BUSY)); splash(HZ, str(LANG_TAGCACHE_BUSY));
} }
/* The _total_ numer of entries available. */ /* The _total_ numer of entries available. */
@ -1566,7 +1565,7 @@ static bool insert_all_playlist(struct tree_context *c, int position, bool queue
cpu_boost(true); cpu_boost(true);
if (!tagcache_search(&tcs, tag_filename)) if (!tagcache_search(&tcs, tag_filename))
{ {
gui_syncsplash(HZ, ID2P(LANG_TAGCACHE_BUSY)); splash(HZ, ID2P(LANG_TAGCACHE_BUSY));
cpu_boost(false); cpu_boost(false);
return false; return false;
} }
@ -1674,12 +1673,12 @@ bool tagtree_insert_selection_playlist(int position, bool queue)
} }
if (tc->filesindir <= 0) if (tc->filesindir <= 0)
gui_syncsplash(HZ, ID2P(LANG_END_PLAYLIST)); splash(HZ, ID2P(LANG_END_PLAYLIST));
else else
{ {
logf("insert_all_playlist"); logf("insert_all_playlist");
if (!insert_all_playlist(tc, position, queue)) if (!insert_all_playlist(tc, position, queue))
gui_syncsplash(HZ*2, ID2P(LANG_FAILED)); splash(HZ*2, ID2P(LANG_FAILED));
} }
/* Finally return the dirlevel to its original value. */ /* Finally return the dirlevel to its original value. */

View file

@ -276,10 +276,10 @@ bool check_rockboxdir(void)
int i; int i;
FOR_NB_SCREENS(i) FOR_NB_SCREENS(i)
screens[i].clear_display(); screens[i].clear_display();
gui_syncsplash(HZ*2, "No .rockbox directory"); splash(HZ*2, "No .rockbox directory");
FOR_NB_SCREENS(i) FOR_NB_SCREENS(i)
screens[i].clear_display(); screens[i].clear_display();
gui_syncsplash(HZ*2, "Installation incomplete"); splash(HZ*2, "Installation incomplete");
return false; return false;
} }
return true; return true;
@ -394,7 +394,7 @@ static int update_dir(void)
#endif #endif
(tc.dirfull || tc.filesindir == global_settings.max_files_in_dir) ) (tc.dirfull || tc.filesindir == global_settings.max_files_in_dir) )
{ {
gui_syncsplash(HZ, ID2P(LANG_SHOWDIR_BUFFER_FULL)); splash(HZ, ID2P(LANG_SHOWDIR_BUFFER_FULL));
} }
} }
#ifdef HAVE_TAGCACHE #ifdef HAVE_TAGCACHE
@ -635,7 +635,7 @@ static int dirbrowse()
if (*tc.dirfilter > NUM_FILTER_MODES && numentries==0) if (*tc.dirfilter > NUM_FILTER_MODES && numentries==0)
{ {
gui_syncsplash(HZ*2, ID2P(LANG_NO_FILES)); splash(HZ*2, ID2P(LANG_NO_FILES));
return GO_TO_PREVIOUS; /* No files found for rockbox_browser() */ return GO_TO_PREVIOUS; /* No files found for rockbox_browser() */
} }
@ -889,7 +889,7 @@ bool create_playlist(void)
snprintf(filename, sizeof filename, "%s.m3u8", snprintf(filename, sizeof filename, "%s.m3u8",
tc.currdir[1] ? tc.currdir : "/root"); tc.currdir[1] ? tc.currdir : "/root");
gui_syncsplash(0, "%s %s", str(LANG_CREATING), filename); splashf(0, "%s %s", str(LANG_CREATING), filename);
trigger_cpu_boost(); trigger_cpu_boost();
catalog_add_to_a_playlist(tc.currdir, ATTR_DIRECTORY, true, filename); catalog_add_to_a_playlist(tc.currdir, ATTR_DIRECTORY, true, filename);
@ -1134,7 +1134,7 @@ void tree_restore(void)
if (global_settings.dircache) if (global_settings.dircache)
{ {
/* Print "Scanning disk..." to the display. */ /* Print "Scanning disk..." to the display. */
gui_syncsplash(0, str(LANG_SCANNING_DISK)); splash(0, str(LANG_SCANNING_DISK));
dircache_build(global_status.dircache_size); dircache_build(global_status.dircache_size);
} }