mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
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:
parent
9464fdde2d
commit
01729e7a18
65 changed files with 276 additions and 305 deletions
|
@ -172,7 +172,7 @@ static int get_action_worker(int context, int timeout,
|
|||
{
|
||||
last_button = BUTTON_NONE;
|
||||
keys_locked = false;
|
||||
gui_syncsplash(HZ/2, str(LANG_KEYLOCK_OFF));
|
||||
splash(HZ/2, str(LANG_KEYLOCK_OFF));
|
||||
return ACTION_REDRAW;
|
||||
}
|
||||
else
|
||||
|
@ -181,7 +181,7 @@ static int get_action_worker(int context, int timeout,
|
|||
#endif
|
||||
{
|
||||
if ((button & BUTTON_REL))
|
||||
gui_syncsplash(HZ/2, str(LANG_KEYLOCK_ON));
|
||||
splash(HZ/2, str(LANG_KEYLOCK_ON));
|
||||
return ACTION_REDRAW;
|
||||
}
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ static int get_action_worker(int context, int timeout,
|
|||
{
|
||||
unlock_combo = button;
|
||||
keys_locked = true;
|
||||
gui_syncsplash(HZ/2, str(LANG_KEYLOCK_ON));
|
||||
splash(HZ/2, str(LANG_KEYLOCK_ON));
|
||||
|
||||
button_clear_queue();
|
||||
return ACTION_REDRAW;
|
||||
|
|
|
@ -129,11 +129,11 @@ bool alarm_screen(void)
|
|||
talk_value(togo % 60, UNIT_MIN, true);
|
||||
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);
|
||||
done = true;
|
||||
} else {
|
||||
gui_syncsplash(HZ, ID2P(LANG_ALARM_MOD_ERROR));
|
||||
splash(HZ, ID2P(LANG_ALARM_MOD_ERROR));
|
||||
update = true;
|
||||
}
|
||||
break;
|
||||
|
@ -188,7 +188,7 @@ bool alarm_screen(void)
|
|||
|
||||
case ACTION_STD_CANCEL:
|
||||
rtc_enable_alarm(false);
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_ALARM_MOD_DISABLE));
|
||||
splash(HZ*2, ID2P(LANG_ALARM_MOD_DISABLE));
|
||||
done = true;
|
||||
break;
|
||||
|
||||
|
|
|
@ -237,7 +237,7 @@ 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));
|
||||
|
||||
return true;
|
||||
|
@ -400,7 +400,7 @@ bool bookmark_autoload(const char* file)
|
|||
if (!play_bookmark(bookmark))
|
||||
{
|
||||
/* 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
|
||||
|
@ -445,7 +445,7 @@ bool bookmark_load(const char* file, bool autoload)
|
|||
/* Selected bookmark not found. */
|
||||
if (!autoload)
|
||||
{
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME));
|
||||
splash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME));
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -694,7 +694,7 @@ static char* select_bookmark(const char* bookmark_file_name, bool show_dont_resu
|
|||
if (bookmarks->total_count < 1)
|
||||
{
|
||||
/* 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);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -248,7 +248,7 @@ int codec_load_file(const char *plugin, struct codec_api *api)
|
|||
fd = open(path, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -2136,7 +2136,7 @@ static bool dbg_save_roms(void)
|
|||
restore_irq(old_irq_level);
|
||||
|
||||
if (err)
|
||||
gui_syncsplash(HZ*3, "Eeprom read failure (%d)",err);
|
||||
splashf(HZ*3, "Eeprom read failure (%d)", err);
|
||||
else
|
||||
{
|
||||
write(fd, buf, sizeof buf);
|
||||
|
@ -2233,7 +2233,7 @@ extern bool do_screendump_instead_of_usb;
|
|||
static bool dbg_screendump(void)
|
||||
{
|
||||
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");
|
||||
return false;
|
||||
}
|
||||
|
@ -2277,21 +2277,21 @@ static bool dbg_write_eeprom(void)
|
|||
|
||||
err = eeprom_24cxx_write(0, buf, sizeof buf);
|
||||
if (err)
|
||||
gui_syncsplash(HZ*3, "Eeprom write failure (%d)",err);
|
||||
splashf(HZ*3, "Eeprom write failure (%d)", err);
|
||||
else
|
||||
gui_syncsplash(HZ*3, "Eeprom written successfully");
|
||||
splash(HZ*3, "Eeprom written successfully");
|
||||
|
||||
restore_irq(old_irq_level);
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_syncsplash(HZ*3, "File read error (%d)",rc);
|
||||
splashf(HZ*3, "File read error (%d)",rc);
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_syncsplash(HZ*3, "Failed to open 'internal_eeprom.bin'");
|
||||
splash(HZ*3, "Failed to open 'internal_eeprom.bin'");
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -2396,7 +2396,7 @@ static bool logf_usb_serial(void)
|
|||
{
|
||||
bool serial_enabled = !usb_core_driver_enabled(USB_DRIVER_SERIAL);
|
||||
usb_core_enable_driver(USB_DRIVER_SERIAL,serial_enabled);
|
||||
gui_syncsplash(HZ, "USB logf %s",
|
||||
splashf(HZ, "USB logf %s",
|
||||
serial_enabled?"enabled":"disabled");
|
||||
return false;
|
||||
}
|
||||
|
@ -2405,7 +2405,7 @@ static bool logf_usb_serial(void)
|
|||
#if defined(HAVE_USBSTACK) && defined(USB_STORAGE)
|
||||
static bool usb_reconnect(void)
|
||||
{
|
||||
gui_syncsplash(HZ, "Reconnect mass storage");
|
||||
splash(HZ, "Reconnect mass storage");
|
||||
usb_storage_reconnect();
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -403,7 +403,7 @@ bool enc_config_menu(struct encoder_config *cfg)
|
|||
}
|
||||
else
|
||||
{
|
||||
gui_syncsplash(HZ, str(LANG_NO_SETTINGS));
|
||||
splash(HZ, str(LANG_NO_SETTINGS));
|
||||
return false;
|
||||
}
|
||||
} /* enc_config_menu */
|
||||
|
@ -461,7 +461,7 @@ bool enc_global_config_menu(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
gui_syncsplash(HZ, str(LANG_NO_SETTINGS));
|
||||
splash(HZ, str(LANG_NO_SETTINGS));
|
||||
return false;
|
||||
}
|
||||
} /* enc_global_config_menu */
|
||||
|
|
|
@ -92,7 +92,7 @@ bool ft_play_playlist(char* pathname, char* dirname, char* filename)
|
|||
{
|
||||
if (global_settings.party_mode)
|
||||
{
|
||||
gui_syncsplash(HZ, ID2P(LANG_PARTY_MODE));
|
||||
splash(HZ, ID2P(LANG_PARTY_MODE));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ bool ft_play_playlist(char* pathname, char* dirname, char* filename)
|
|||
return false;
|
||||
}
|
||||
|
||||
gui_syncsplash(0, ID2P(LANG_WAIT));
|
||||
splash(0, ID2P(LANG_WAIT));
|
||||
|
||||
/* about to create a new current playlist...
|
||||
allow user to cancel the operation */
|
||||
|
@ -397,7 +397,7 @@ int ft_enter(struct tree_context* c)
|
|||
if (bookmark_autoload(c->currdir))
|
||||
break;
|
||||
|
||||
gui_syncsplash(0, ID2P(LANG_WAIT));
|
||||
splash(0, ID2P(LANG_WAIT));
|
||||
|
||||
/* about to create a new current playlist...
|
||||
allow user to cancel the operation */
|
||||
|
@ -408,7 +408,7 @@ int ft_enter(struct tree_context* c)
|
|||
{
|
||||
playlist_insert_track(NULL, buf,
|
||||
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)
|
||||
{
|
||||
|
@ -432,8 +432,7 @@ int ft_enter(struct tree_context* c)
|
|||
#if CONFIG_TUNER
|
||||
/* fmr preset file */
|
||||
case FILE_ATTR_FMR:
|
||||
|
||||
gui_syncsplash(0, ID2P(LANG_WAIT));
|
||||
splash(0, ID2P(LANG_WAIT));
|
||||
|
||||
/* Preset inside the default folder. */
|
||||
if(!strncasecmp(FMPRESET_PATH, buf, strlen(FMPRESET_PATH)))
|
||||
|
@ -460,7 +459,7 @@ int ft_enter(struct tree_context* c)
|
|||
|
||||
/* wps config file */
|
||||
case FILE_ATTR_WPS:
|
||||
gui_syncsplash(0, ID2P(LANG_WAIT));
|
||||
splash(0, ID2P(LANG_WAIT));
|
||||
#if LCD_DEPTH > 1
|
||||
unload_wps_backdrop();
|
||||
#endif
|
||||
|
@ -472,7 +471,7 @@ int ft_enter(struct tree_context* c)
|
|||
#if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1)
|
||||
/* remote-wps config file */
|
||||
case FILE_ATTR_RWPS:
|
||||
gui_syncsplash(0, ID2P(LANG_WAIT));
|
||||
splash(0, ID2P(LANG_WAIT));
|
||||
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
||||
unload_remote_wps_backdrop();
|
||||
#endif
|
||||
|
@ -483,39 +482,39 @@ int ft_enter(struct tree_context* c)
|
|||
#endif
|
||||
|
||||
case FILE_ATTR_CFG:
|
||||
gui_syncsplash(0, ID2P(LANG_WAIT));
|
||||
splash(0, ID2P(LANG_WAIT));
|
||||
if (!settings_load_config(buf,true))
|
||||
break;
|
||||
gui_syncsplash(HZ, ID2P(LANG_SETTINGS_LOADED));
|
||||
splash(HZ, ID2P(LANG_SETTINGS_LOADED));
|
||||
break;
|
||||
|
||||
case FILE_ATTR_BMARK:
|
||||
gui_syncsplash(0, ID2P(LANG_WAIT));
|
||||
splash(0, ID2P(LANG_WAIT));
|
||||
bookmark_load(buf, false);
|
||||
reload_dir = true;
|
||||
break;
|
||||
|
||||
case FILE_ATTR_LNG:
|
||||
gui_syncsplash(0, ID2P(LANG_WAIT));
|
||||
splash(0, ID2P(LANG_WAIT));
|
||||
if(!lang_load(buf)) {
|
||||
set_file(buf, (char *)global_settings.lang_file,
|
||||
MAX_FILENAME);
|
||||
talk_init(); /* use voice of same language */
|
||||
gui_syncsplash(HZ, ID2P(LANG_LANGUAGE_LOADED));
|
||||
splash(HZ, ID2P(LANG_LANGUAGE_LOADED));
|
||||
}
|
||||
break;
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
case FILE_ATTR_FONT:
|
||||
gui_syncsplash(0, ID2P(LANG_WAIT));
|
||||
splash(0, ID2P(LANG_WAIT));
|
||||
font_load(buf);
|
||||
set_file(buf, (char *)global_settings.font_file, MAX_FILENAME);
|
||||
break;
|
||||
|
||||
case FILE_ATTR_KBD:
|
||||
gui_syncsplash(0, ID2P(LANG_WAIT));
|
||||
splash(0, ID2P(LANG_WAIT));
|
||||
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);
|
||||
break;
|
||||
#endif
|
||||
|
@ -523,7 +522,7 @@ int ft_enter(struct tree_context* c)
|
|||
#ifndef SIMULATOR
|
||||
/* firmware file */
|
||||
case FILE_ATTR_MOD:
|
||||
gui_syncsplash(0, ID2P(LANG_WAIT));
|
||||
splash(0, ID2P(LANG_WAIT));
|
||||
rolo_load(buf);
|
||||
break;
|
||||
#endif
|
||||
|
@ -531,7 +530,7 @@ int ft_enter(struct tree_context* c)
|
|||
/* plugin file */
|
||||
case FILE_ATTR_ROCK:
|
||||
if (global_settings.party_mode) {
|
||||
gui_syncsplash(HZ, ID2P(LANG_PARTY_MODE));
|
||||
splash(HZ, ID2P(LANG_PARTY_MODE));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -555,7 +554,7 @@ int ft_enter(struct tree_context* c)
|
|||
const char* plugin;
|
||||
|
||||
if (global_settings.party_mode) {
|
||||
gui_syncsplash(HZ, ID2P(LANG_PARTY_MODE));
|
||||
splash(HZ, ID2P(LANG_PARTY_MODE));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ static const struct filetype inbuilt_filetypes[] = {
|
|||
{ "cue", FILE_ATTR_CUE, Icon_Bookmark, VOICE_EXT_CUESHEET },
|
||||
#ifdef BOOTFILE_EXT
|
||||
{ BOOTFILE_EXT, FILE_ATTR_MOD, Icon_Firmware, VOICE_EXT_AJZ },
|
||||
#endif /* #ifndef SIMULATOR */
|
||||
#endif
|
||||
};
|
||||
|
||||
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)
|
||||
{
|
||||
gui_syncsplash(HZ, ID2P(LANG_FILETYPES_FULL));
|
||||
splash(HZ, ID2P(LANG_FILETYPES_FULL));
|
||||
break;
|
||||
}
|
||||
rm_whitespaces(line);
|
||||
|
@ -485,7 +485,7 @@ int filetype_list_viewers(const char* current_file)
|
|||
if (count == 0)
|
||||
{
|
||||
/* FIX: translation! */
|
||||
gui_syncsplash(HZ*2, (unsigned char *)"No viewers found");
|
||||
splash(HZ*2, "No viewers found");
|
||||
return PLUGIN_OK;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -461,7 +461,7 @@ bool set_color(struct screen *display, char *title, unsigned *color,
|
|||
if (banned_color != (unsigned)-1 &&
|
||||
banned_color == rgb.color)
|
||||
{
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_COLOR_UNACCEPTABLE));
|
||||
splash(HZ*2, ID2P(LANG_COLOR_UNACCEPTABLE));
|
||||
break;
|
||||
}
|
||||
*color = rgb.color;
|
||||
|
|
|
@ -152,7 +152,7 @@ bool update_onvol_change(struct gui_wps * gwps)
|
|||
gui_wps_refresh(gwps, 0, WPS_REFRESH_NON_STATIC);
|
||||
|
||||
#ifdef HAVE_LCD_CHARCELLS
|
||||
gui_splash(gwps->display, 0, "Vol: %3d dB",
|
||||
splashf(0, "Vol: %3d dB",
|
||||
sound_val2phys(SOUND_VOLUME, global_settings.volume));
|
||||
return true;
|
||||
#endif
|
||||
|
@ -329,7 +329,7 @@ bool gui_wps_display(void)
|
|||
#ifdef HAVE_LCD_BITMAP
|
||||
gui_syncstatusbar_draw(&statusbars, true);
|
||||
#endif
|
||||
gui_syncsplash(HZ, ID2P(LANG_END_PLAYLIST));
|
||||
splash(HZ, ID2P(LANG_END_PLAYLIST));
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
@ -485,16 +485,11 @@ bool update(struct gui_wps *gwps)
|
|||
|
||||
void display_keylock_text(bool locked)
|
||||
{
|
||||
char* s;
|
||||
int i;
|
||||
FOR_NB_SCREENS(i)
|
||||
gui_wps[i].display->stop_scroll();
|
||||
|
||||
if(locked)
|
||||
s = str(LANG_KEYLOCK_ON);
|
||||
else
|
||||
s = str(LANG_KEYLOCK_OFF);
|
||||
gui_syncsplash(HZ, s);
|
||||
splash(HZ, locked ? ID2P(LANG_KEYLOCK_ON) : ID2P(LANG_KEYLOCK_OFF));
|
||||
}
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
|
|
|
@ -530,7 +530,7 @@ bool option_screen(const struct settings_list *setting,
|
|||
*variable = oldvalue;
|
||||
if (var_type == F_T_BOOL && !use_temp_var)
|
||||
*(bool*)setting->setting = (oldvalue==1);
|
||||
gui_syncsplash(HZ/2, ID2P(LANG_CANCEL));
|
||||
splash(HZ/2, ID2P(LANG_CANCEL));
|
||||
}
|
||||
done = true;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
/* "Pitch" */
|
||||
snprintf((char *)buf, sizeof(buf), str(LANG_PITCH));
|
||||
snprintf((char *)buf, sizeof(buf), "%s", str(LANG_PITCH));
|
||||
display->getstringsize(buf,&w,&h);
|
||||
display->putsxy((display->lcdwidth-w)/2, (display->lcdheight/2)-h, buf);
|
||||
/* "XX.X%" */
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
#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];
|
||||
short widths[MAXLINES];
|
||||
|
@ -187,41 +187,35 @@ static void splash(struct screen * screen, const char *fmt, va_list ap)
|
|||
screen->update();
|
||||
}
|
||||
|
||||
void gui_splash(struct screen * screen, int ticks,
|
||||
const char *fmt, ...)
|
||||
void splashf(int ticks, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int i;
|
||||
|
||||
/* 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);
|
||||
splash(screen, fmt, ap);
|
||||
screens[i].set_viewport(NULL);
|
||||
splash_internal(&(screens[i]), fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
if(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
|
||||
long id;
|
||||
/* 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
|
||||
enabled, then speak it. */
|
||||
cond_talk_ids_fq(id);
|
||||
#endif
|
||||
/* If fmt is a lang ID then get the corresponding string (which
|
||||
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);
|
||||
splashf(ticks, "%s", P2STR((const unsigned char*)str));
|
||||
}
|
||||
|
|
|
@ -24,21 +24,18 @@
|
|||
#include <_ansi.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
|
||||
* - ticks : how long the splash is displayed (in rb ticks)
|
||||
* - fmt : what to say *printf style
|
||||
*/
|
||||
extern void gui_syncsplash(int ticks, const char *fmt, ...)
|
||||
ATTRIBUTE_PRINTF(2, 3);
|
||||
extern void splashf(int ticks, const char *fmt, ...) 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_ */
|
||||
|
|
10
apps/main.c
10
apps/main.c
|
@ -162,7 +162,7 @@ static int init_dircache(bool preinit)
|
|||
{
|
||||
/* This will be in default language, settings are not
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -180,7 +180,7 @@ static int init_dircache(bool preinit)
|
|||
{
|
||||
if (global_status.dircache_size <= 0)
|
||||
{
|
||||
gui_syncsplash(0, str(LANG_SCANNING_DISK));
|
||||
splash(0, str(LANG_SCANNING_DISK));
|
||||
clear = true;
|
||||
}
|
||||
result = dircache_build(global_status.dircache_size);
|
||||
|
@ -191,7 +191,7 @@ static int init_dircache(bool preinit)
|
|||
/* Initialization of dircache failed. Manual action is
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -244,7 +244,7 @@ static void init_tagcache(void)
|
|||
}
|
||||
#endif
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
gui_syncsplash(0, "%s [%d/%d]",
|
||||
splashf(0, "%s [%d/%d]",
|
||||
str(LANG_TAGCACHE_INIT), ret,
|
||||
tagcache_get_max_commit_step());
|
||||
#else
|
||||
|
@ -504,7 +504,7 @@ static void init(void)
|
|||
if (button_hold())
|
||||
#endif
|
||||
{
|
||||
gui_syncsplash(HZ*2, str(LANG_RESET_DONE_CLEAR));
|
||||
splash(HZ*2, str(LANG_RESET_DONE_CLEAR));
|
||||
settings_reset();
|
||||
}
|
||||
else
|
||||
|
|
|
@ -406,7 +406,7 @@ static int info_action_callback(int action, struct gui_synclist *lists)
|
|||
#ifndef SIMULATOR
|
||||
struct info_data *info = (struct info_data *)lists->data;
|
||||
info->new_data = true;
|
||||
gui_syncsplash(0, ID2P(LANG_SCANNING_DISK));
|
||||
splash(0, ID2P(LANG_SCANNING_DISK));
|
||||
fat_recalc_free(IF_MV(0));
|
||||
#ifdef HAVE_MULTIVOLUME
|
||||
if (fat_ismounted(1))
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
|
@ -143,7 +142,7 @@ static int audioscrobbler_callback(int action,const struct menu_item_ex *this_it
|
|||
{
|
||||
case ACTION_EXIT_MENUITEM: /* on exit */
|
||||
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)
|
||||
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 */
|
||||
if (!cuesheet_is_enabled() && global_settings.cuesheet)
|
||||
gui_syncsplash(HZ*2, "%s", ID2P(LANG_PLEASE_REBOOT));
|
||||
splash(HZ*2, ID2P(LANG_PLEASE_REBOOT));
|
||||
break;
|
||||
}
|
||||
return action;
|
||||
|
|
|
@ -325,7 +325,7 @@ MENUITEM_SETTING(rec_prerecord_time, &global_settings.rec_prerecord_time, NULL);
|
|||
static int clear_rec_directory(void)
|
||||
{
|
||||
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;
|
||||
}
|
||||
MENUITEM_FUNCTION(clear_rec_directory_item, 0, ID2P(LANG_CLEAR_REC_DIR),
|
||||
|
@ -531,7 +531,7 @@ int rectrigger(void)
|
|||
switch (action)
|
||||
{
|
||||
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_linear = old_start_thres_linear;
|
||||
global_settings.rec_start_duration = old_start_duration;
|
||||
|
|
|
@ -57,13 +57,13 @@
|
|||
static void tagcache_rebuild_with_splash(void)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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
|
||||
|
@ -187,7 +187,7 @@ static int dircache_callback(int action,const struct menu_item_ex *this_item)
|
|||
{
|
||||
case true:
|
||||
if (!dircache_is_enabled())
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_PLEASE_REBOOT));
|
||||
splash(HZ*2, ID2P(LANG_PLEASE_REBOOT));
|
||||
break;
|
||||
case false:
|
||||
if (dircache_is_enabled())
|
||||
|
|
10
apps/misc.c
10
apps/misc.c
|
@ -675,25 +675,23 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
|
|||
if (!tagcache_prepare_shutdown())
|
||||
{
|
||||
cancel_shutdown();
|
||||
gui_syncsplash(HZ, ID2P(LANG_TAGCACHE_BUSY));
|
||||
splash(HZ, ID2P(LANG_TAGCACHE_BUSY));
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
if (battery_level() > 10)
|
||||
gui_syncsplash(0, str(LANG_SHUTTINGDOWN));
|
||||
splash(0, str(LANG_SHUTTINGDOWN));
|
||||
else
|
||||
{
|
||||
msg_id = LANG_WARNING_BATTERY_LOW;
|
||||
gui_syncsplash(0, "%s %s",
|
||||
str(LANG_WARNING_BATTERY_LOW),
|
||||
splashf(0, "%s %s", str(LANG_WARNING_BATTERY_LOW),
|
||||
str(LANG_SHUTTINGDOWN));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
msg_id = LANG_WARNING_BATTERY_EMPTY;
|
||||
gui_syncsplash(0, "%s %s",
|
||||
str(LANG_WARNING_BATTERY_EMPTY),
|
||||
splashf(0, "%s %s", str(LANG_WARNING_BATTERY_EMPTY),
|
||||
str(LANG_SHUTTINGDOWN));
|
||||
}
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ static bool add_to_playlist(int position, bool queue)
|
|||
};
|
||||
const struct text_message message={lines, 2};
|
||||
|
||||
gui_syncsplash(0, ID2P(LANG_WAIT));
|
||||
splash(0, ID2P(LANG_WAIT));
|
||||
|
||||
if (new_playlist)
|
||||
playlist_create(NULL, NULL);
|
||||
|
@ -476,7 +476,7 @@ static int remove_dir(char* dirname, int len)
|
|||
break;
|
||||
|
||||
dirname[dirlen] ='\0';
|
||||
gui_syncsplash(0, dirname);
|
||||
splash(0, dirname);
|
||||
|
||||
/* append name to current directory */
|
||||
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))
|
||||
{
|
||||
gui_syncsplash(HZ, ID2P(LANG_CANCEL));
|
||||
splash(HZ, ID2P(LANG_CANCEL));
|
||||
result = -1;
|
||||
break;
|
||||
}
|
||||
|
@ -538,7 +538,7 @@ static bool delete_handler(bool is_dir)
|
|||
if(gui_syncyesno_run(&message, &yes_message, NULL)!=YESNO_YES)
|
||||
return false;
|
||||
|
||||
gui_syncsplash(0, str(LANG_DELETING));
|
||||
splash(0, str(LANG_DELETING));
|
||||
|
||||
int res;
|
||||
if (is_dir)
|
||||
|
@ -574,13 +574,13 @@ static bool set_backdrop(void)
|
|||
{
|
||||
/* load the image */
|
||||
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,
|
||||
MAX_FILENAME);
|
||||
show_main_backdrop();
|
||||
return true;
|
||||
} else {
|
||||
gui_syncsplash(HZ, str(LANG_BACKDROP_FAILED));
|
||||
splash(HZ, str(LANG_BACKDROP_FAILED));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -630,8 +630,8 @@ static bool create_dir(void)
|
|||
rc = mkdir(dirname);
|
||||
if (rc < 0) {
|
||||
cond_talk_ids_fq(LANG_CREATE_DIR, LANG_FAILED);
|
||||
gui_syncsplash(HZ, (unsigned char *)"%s %s",
|
||||
str(LANG_CREATE_DIR), str(LANG_FAILED));
|
||||
splashf(HZ, (unsigned char *)"%s %s", str(LANG_CREATE_DIR),
|
||||
str(LANG_FAILED));
|
||||
} else {
|
||||
onplay_result = ONPLAY_RELOAD_DIR;
|
||||
}
|
||||
|
@ -886,11 +886,11 @@ static bool clipboard_paste(void)
|
|||
}
|
||||
|
||||
if (clipboard_is_copy) {
|
||||
gui_syncsplash(0, ID2P(LANG_COPYING));
|
||||
splash(0, ID2P(LANG_COPYING));
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_syncsplash(0, ID2P(LANG_MOVING));
|
||||
splash(0, ID2P(LANG_MOVING));
|
||||
}
|
||||
|
||||
/* Now figure out what we're doing */
|
||||
|
@ -930,8 +930,8 @@ static bool clipboard_paste(void)
|
|||
onplay_result = ONPLAY_RELOAD_DIR;
|
||||
} else {
|
||||
cond_talk_ids_fq(LANG_PASTE, LANG_FAILED);
|
||||
gui_syncsplash(HZ, (unsigned char *)"%s %s",
|
||||
str(LANG_PASTE), str(LANG_FAILED));
|
||||
splashf(HZ, (unsigned char *)"%s %s", str(LANG_PASTE),
|
||||
str(LANG_FAILED));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -949,7 +949,7 @@ static int set_rating_inline(void)
|
|||
tagcache_update_numeric(id3->tagcache_idx-1, tag_rating, id3->rating);
|
||||
}
|
||||
else
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_ID3_NO_INFO));
|
||||
splash(HZ*2, ID2P(LANG_ID3_NO_INFO));
|
||||
return 0;
|
||||
}
|
||||
static int ratingitem_callback(int action,const struct menu_item_ex *this_item)
|
||||
|
|
|
@ -822,7 +822,7 @@ void audio_set_crossfade(int enable)
|
|||
{
|
||||
/* Store the track resume position */
|
||||
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
|
||||
|
@ -1334,7 +1334,7 @@ static void codec_thread(void)
|
|||
if (!ci.new_track)
|
||||
{
|
||||
logf("Codec failure");
|
||||
gui_syncsplash(HZ*2, "Codec failure");
|
||||
splash(HZ*2, "Codec failure");
|
||||
}
|
||||
|
||||
if (!codec_load_next_track())
|
||||
|
@ -1395,7 +1395,7 @@ static void codec_thread(void)
|
|||
break;
|
||||
|
||||
logf("Encoder failure");
|
||||
gui_syncsplash(HZ*2, "Encoder failure");
|
||||
splash(HZ*2, "Encoder failure");
|
||||
|
||||
if (ci.enc_codec_loaded < 0)
|
||||
break;
|
||||
|
@ -1717,7 +1717,6 @@ static bool audio_load_track(size_t offset, bool start_play)
|
|||
buffering_handle_finished_callback callback. */
|
||||
static void audio_finish_load_track(void)
|
||||
{
|
||||
char msgbuf[80];
|
||||
size_t file_offset = 0;
|
||||
size_t offset = 0;
|
||||
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
|
||||
* the codec file failed part way through, either way, skip the track */
|
||||
snprintf(msgbuf, sizeof(msgbuf)-1, "No codec for: %s", track_id3->path);
|
||||
/* We should not use gui_syncplash from audio thread! */
|
||||
gui_syncsplash(HZ*2, msgbuf);
|
||||
/* FIXME: We should not use splashf from audio thread! */
|
||||
splashf(HZ*2, "No codec for: %s", track_id3->path);
|
||||
/* Skip invalid entry from playlist. */
|
||||
playlist_skip_entry(NULL, last_peek_offset);
|
||||
return;
|
||||
|
|
|
@ -347,7 +347,7 @@ static void create_control(struct playlist_info* playlist)
|
|||
if (check_rockboxdir())
|
||||
{
|
||||
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),
|
||||
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)
|
||||
playlist->utf8 = true; /* Override any earlier indication. */
|
||||
|
||||
gui_syncsplash(0, ID2P(LANG_WAIT));
|
||||
splash(0, ID2P(LANG_WAIT));
|
||||
|
||||
if (!buffer)
|
||||
{
|
||||
|
@ -1426,9 +1426,9 @@ static int get_filename(struct playlist_info* playlist, int index, int seek,
|
|||
if (max < 0)
|
||||
{
|
||||
if (control_file)
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
|
||||
splash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
|
||||
else
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_ACCESS_ERROR));
|
||||
splash(HZ*2, ID2P(LANG_PLAYLIST_ACCESS_ERROR));
|
||||
|
||||
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)
|
||||
{
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR));
|
||||
splash(HZ*2, ID2P(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR));
|
||||
exit = true;
|
||||
result = -1;
|
||||
break;
|
||||
|
@ -1604,7 +1604,7 @@ static int check_subdir_for_music(char *dir, char *subdir, bool recurse)
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -1657,8 +1657,7 @@ static int check_subdir_for_music(char *dir, char *subdir, bool recurse)
|
|||
|
||||
/* we now need to reload our current directory */
|
||||
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 result;
|
||||
}
|
||||
|
@ -1747,7 +1746,7 @@ static void display_playlist_count(int count, const unsigned char *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)
|
||||
{
|
||||
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
|
||||
{
|
||||
result = -1;
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_UPDATE_ERROR));
|
||||
splash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_UPDATE_ERROR));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -2021,11 +2020,11 @@ int playlist_resume(void)
|
|||
|
||||
empty_playlist(playlist, true);
|
||||
|
||||
gui_syncsplash(0, ID2P(LANG_WAIT));
|
||||
splash(0, ID2P(LANG_WAIT));
|
||||
playlist->control_fd = open(playlist->control_filename, O_RDWR);
|
||||
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;
|
||||
}
|
||||
playlist->control_created = true;
|
||||
|
@ -2033,7 +2032,7 @@ int playlist_resume(void)
|
|||
control_file_size = filesize(playlist->control_fd);
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -2042,7 +2041,7 @@ int playlist_resume(void)
|
|||
PLAYLIST_COMMAND_SIZE<buflen?PLAYLIST_COMMAND_SIZE:buflen);
|
||||
if(nread <= 0)
|
||||
{
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
|
||||
splash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -2069,7 +2068,7 @@ int playlist_resume(void)
|
|||
/* So a splash while we are loading. */
|
||||
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,
|
||||
str(LANG_OFF_ABORT));
|
||||
if (action_userabort(TIMEOUT_NOBLOCK))
|
||||
|
@ -2337,13 +2336,13 @@ int playlist_resume(void)
|
|||
|
||||
if (result < 0)
|
||||
{
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_INVALID));
|
||||
splash(HZ*2, ID2P(LANG_PLAYLIST_CONTROL_INVALID));
|
||||
return result;
|
||||
}
|
||||
|
||||
if (useraborted)
|
||||
{
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_CANCEL));
|
||||
splash(HZ*2, ID2P(LANG_CANCEL));
|
||||
return -1;
|
||||
}
|
||||
if (!newline || (exit_loop && count<nread))
|
||||
|
@ -2351,7 +2350,7 @@ int playlist_resume(void)
|
|||
if ((total_read + count) >= control_file_size)
|
||||
{
|
||||
/* 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;
|
||||
}
|
||||
|
||||
|
@ -2861,7 +2860,7 @@ int playlist_insert_track(struct playlist_info* playlist, const char *filename,
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -2892,7 +2891,7 @@ int playlist_insert_directory(struct playlist_info* playlist,
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -2959,14 +2958,14 @@ int playlist_insert_playlist(struct playlist_info* playlist, const char *filenam
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
fd = open_utf8(filename, O_RDONLY);
|
||||
if (fd < 0)
|
||||
{
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_ACCESS_ERROR));
|
||||
splash(HZ*2, ID2P(LANG_PLAYLIST_ACCESS_ERROR));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -3087,7 +3086,7 @@ int playlist_delete(struct playlist_info* playlist, int index)
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -3122,7 +3121,7 @@ int playlist_move(struct playlist_info* playlist, int index, int new_index)
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -3385,7 +3384,7 @@ int playlist_save(struct playlist_info* playlist, char *filename)
|
|||
if (playlist->buffer_size < (int)(playlist->amount * sizeof(int)))
|
||||
{
|
||||
/* 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;
|
||||
}
|
||||
|
||||
|
@ -3409,7 +3408,7 @@ int playlist_save(struct playlist_info* playlist, char *filename)
|
|||
}
|
||||
if (fd < 0)
|
||||
{
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_PLAYLIST_ACCESS_ERROR));
|
||||
splash(HZ*2, ID2P(LANG_PLAYLIST_ACCESS_ERROR));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -3450,7 +3449,7 @@ int playlist_save(struct playlist_info* playlist, char *filename)
|
|||
|
||||
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;
|
||||
break;
|
||||
}
|
||||
|
@ -3538,7 +3537,7 @@ int playlist_directory_tracksearch(const char* dirname, bool recurse,
|
|||
|
||||
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;
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -96,8 +96,7 @@ static int initialize_catalog(void)
|
|||
if (!playlist_dir_exists)
|
||||
{
|
||||
if (mkdir(playlist_dir) < 0) {
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_CATALOG_NO_DIRECTORY),
|
||||
playlist_dir);
|
||||
splashf(HZ*2, ID2P(LANG_CATALOG_NO_DIRECTORY), playlist_dir);
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
|
@ -130,8 +129,7 @@ static int create_playlist_list(char** playlists, int num_items,
|
|||
|
||||
if (ft_load(tc, playlist_dir) < 0)
|
||||
{
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_CATALOG_NO_DIRECTORY),
|
||||
playlist_dir);
|
||||
splashf(HZ*2, ID2P(LANG_CATALOG_NO_DIRECTORY), playlist_dir);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
@ -234,7 +232,7 @@ static int display_playlists(char* playlist, bool view)
|
|||
|
||||
if (num_playlists <= 0)
|
||||
{
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_CATALOG_NO_PLAYLISTS));
|
||||
splash(HZ*2, ID2P(LANG_CATALOG_NO_PLAYLISTS));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -327,8 +325,7 @@ static void display_insert_count(int count)
|
|||
talk_id(LANG_PLAYLIST_INSERT_COUNT, true);
|
||||
}
|
||||
|
||||
gui_syncsplash(0, str(LANG_PLAYLIST_INSERT_COUNT), count,
|
||||
str(LANG_OFF_ABORT));
|
||||
splashf(0, str(LANG_PLAYLIST_INSERT_COUNT), count, str(LANG_OFF_ABORT));
|
||||
}
|
||||
|
||||
/* Add specified track into playlist. Callback from directory insert */
|
||||
|
|
|
@ -293,7 +293,7 @@ static bool playlist_viewer_init(struct playlist_viewer * viewer,
|
|||
if (!have_list)
|
||||
{
|
||||
/* Nothing to view, exit */
|
||||
gui_syncsplash(HZ, str(LANG_CATALOG_NO_PLAYLISTS));
|
||||
splash(HZ, str(LANG_CATALOG_NO_PLAYLISTS));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -680,8 +680,8 @@ bool playlist_viewer_ex(const char* filename)
|
|||
ret_val = playlist_move(viewer.playlist, viewer.move_track,
|
||||
current_track->index);
|
||||
if (ret_val < 0)
|
||||
gui_syncsplash(HZ, (unsigned char *)"%s %s",
|
||||
str(LANG_MOVE), str(LANG_FAILED));
|
||||
splashf(HZ, (unsigned char *)"%s %s", str(LANG_MOVE),
|
||||
str(LANG_FAILED));
|
||||
update_playlist(true);
|
||||
viewer.move_track = -1;
|
||||
}
|
||||
|
@ -795,7 +795,7 @@ bool search_playlist(void)
|
|||
playlist_count = playlist_amount_ex(viewer.playlist);
|
||||
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));
|
||||
if (action_userabort(TIMEOUT_NOBLOCK))
|
||||
{
|
||||
|
|
|
@ -157,7 +157,8 @@ static const struct plugin_api rockbox_api = {
|
|||
backlight_set_timeout_plugged,
|
||||
#endif
|
||||
is_backlight_on,
|
||||
gui_syncsplash,
|
||||
splash,
|
||||
splashf,
|
||||
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
/* remote lcd */
|
||||
|
@ -639,32 +640,32 @@ int plugin_load(const char* plugin, const void* parameter)
|
|||
plugin_loaded = false;
|
||||
}
|
||||
|
||||
gui_syncsplash(0, ID2P(LANG_WAIT));
|
||||
splash(0, ID2P(LANG_WAIT));
|
||||
strcpy(current_plugin, plugin);
|
||||
|
||||
#ifdef SIMULATOR
|
||||
hdr = sim_plugin_load((char *)plugin, &pd);
|
||||
if (pd == NULL) {
|
||||
gui_syncsplash(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin);
|
||||
splashf(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin);
|
||||
return -1;
|
||||
}
|
||||
if (hdr == NULL
|
||||
|| hdr->magic != PLUGIN_MAGIC
|
||||
|| hdr->target_id != TARGET_ID) {
|
||||
sim_plugin_close(pd);
|
||||
gui_syncsplash(HZ*2, str(LANG_PLUGIN_WRONG_MODEL));
|
||||
splash(HZ*2, str(LANG_PLUGIN_WRONG_MODEL));
|
||||
return -1;
|
||||
}
|
||||
if (hdr->api_version > PLUGIN_API_VERSION
|
||||
|| hdr->api_version < PLUGIN_MIN_API_VERSION) {
|
||||
sim_plugin_close(pd);
|
||||
gui_syncsplash(HZ*2, str(LANG_PLUGIN_WRONG_VERSION));
|
||||
splash(HZ*2, str(LANG_PLUGIN_WRONG_VERSION));
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
fd = open(plugin, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
gui_syncsplash(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin);
|
||||
splashf(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin);
|
||||
return fd;
|
||||
}
|
||||
#if NUM_CORES > 1
|
||||
|
@ -678,7 +679,7 @@ int plugin_load(const char* plugin, const void* parameter)
|
|||
close(fd);
|
||||
|
||||
if (readsize < 0) {
|
||||
gui_syncsplash(HZ*2, str(LANG_READ_FAILED), plugin);
|
||||
splashf(HZ*2, str(LANG_READ_FAILED), plugin);
|
||||
return -1;
|
||||
}
|
||||
hdr = (struct plugin_header *)pluginbuf;
|
||||
|
@ -688,12 +689,12 @@ int plugin_load(const char* plugin, const void* parameter)
|
|||
|| hdr->target_id != TARGET_ID
|
||||
|| hdr->load_addr != pluginbuf
|
||||
|| 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;
|
||||
}
|
||||
if (hdr->api_version > PLUGIN_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;
|
||||
}
|
||||
plugin_size = hdr->end_addr - pluginbuf;
|
||||
|
@ -768,7 +769,7 @@ int plugin_load(const char* plugin, const void* parameter)
|
|||
return PLUGIN_USB_CONNECTED;
|
||||
|
||||
default:
|
||||
gui_syncsplash(HZ*2, str(LANG_PLUGIN_ERROR));
|
||||
splash(HZ*2, str(LANG_PLUGIN_ERROR));
|
||||
break;
|
||||
}
|
||||
return PLUGIN_OK;
|
||||
|
|
|
@ -130,12 +130,12 @@ void* plugin_get_buffer(size_t *buffer_size);
|
|||
#define PLUGIN_MAGIC 0x526F634B /* RocK */
|
||||
|
||||
/* 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
|
||||
backwards compatibility (and please take the opportunity to sort in any
|
||||
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 */
|
||||
enum plugin_status {
|
||||
|
@ -256,7 +256,8 @@ struct plugin_api {
|
|||
void (*backlight_set_timeout_plugged)(int index);
|
||||
#endif
|
||||
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
|
||||
/* remote lcd */
|
||||
|
|
|
@ -2319,7 +2319,7 @@ static int bubbles_handlebuttons(struct game_context* bb, bool animblock,
|
|||
|
||||
case BUBBLES_START: /* pause the game */
|
||||
start = *rb->current_tick;
|
||||
rb->splash(1, "Paused");
|
||||
rb->splash(0, "Paused");
|
||||
while(pluginlib_getaction(rb,TIMEOUT_BLOCK,plugin_contexts,2)
|
||||
!= (BUBBLES_START));
|
||||
bb->startedshot += *rb->current_tick-start;
|
||||
|
|
|
@ -159,13 +159,13 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
|
|||
FOR_NB_SCREENS(i)
|
||||
rb->screens[i]->clear_display();
|
||||
if(rc < 0) {
|
||||
rb->splash(HZ, "Can't write file: %d", rc);
|
||||
rb->splashf(HZ, "Can't write file: %d", rc);
|
||||
} else {
|
||||
rb->splash(HZ, "Done");
|
||||
}
|
||||
} else {
|
||||
if(rc < 0) {
|
||||
rb->splash(HZ, "Can't read file: %d", rc);
|
||||
rb->splashf(HZ, "Can't read file: %d", rc);
|
||||
} else {
|
||||
rb->splash(HZ, "The file is too big");
|
||||
}
|
||||
|
|
|
@ -1261,7 +1261,7 @@ static void jewels_nextlevel(struct game_context* bj) {
|
|||
while(bj->score >= LEVEL_PTS) {
|
||||
bj->score -= LEVEL_PTS;
|
||||
bj->level++;
|
||||
rb->splash(HZ*2, "Level %d", bj->level);
|
||||
rb->splashf(HZ*2, "Level %d", bj->level);
|
||||
jewels_drawboard(bj);
|
||||
}
|
||||
|
||||
|
@ -1283,7 +1283,7 @@ static void jewels_nextlevel(struct game_context* bj) {
|
|||
rb->splash(HZ*2, "You win!");
|
||||
bj->level = 1;
|
||||
} else {
|
||||
rb->splash(HZ*2, "Level %d", bj->level);
|
||||
rb->splashf(HZ*2, "Level %d", bj->level);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -3026,7 +3026,7 @@ struct t_disp* get_image(struct jpeg* p_jpg, int ds)
|
|||
#endif
|
||||
if (status)
|
||||
{
|
||||
rb->splash(HZ, "decode error %d", status);
|
||||
rb->splashf(HZ, "decode error %d", status);
|
||||
file_pt[curfile] = '\0';
|
||||
return NULL;
|
||||
}
|
||||
|
@ -3212,7 +3212,7 @@ int load_and_show(char* filename)
|
|||
|
||||
if (status < 0 || (status & (DQT | SOF0)) != (DQT | SOF0))
|
||||
{ /* bad format or minimum components not contained */
|
||||
rb->splash(HZ, "unsupported %d", status);
|
||||
rb->splashf(HZ, "unsupported %d", status);
|
||||
file_pt[curfile] = '\0';
|
||||
return change_filename(direction);
|
||||
}
|
||||
|
|
|
@ -312,9 +312,9 @@ static void splash_pw(int selected_item)
|
|||
entry = entry->next;
|
||||
}
|
||||
if (entry->name != '\0')
|
||||
rb->splash(0, "%s %s", entry->name, entry->password);
|
||||
rb->splashf(0, "%s %s", entry->name, entry->password);
|
||||
else
|
||||
rb->splash(0, "%s", entry->password);
|
||||
rb->splashf(0, "%s", entry->password);
|
||||
rb->get_action(CONTEXT_STD, TIMEOUT_BLOCK);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ enum plugin_status run_overlay(const struct plugin_api* rb, const void* paramete
|
|||
fd = rb->open(filename, O_RDONLY);
|
||||
if (fd < 0)
|
||||
{
|
||||
rb->splash(2*HZ, "Can't open %s", filename);
|
||||
rb->splashf(2*HZ, "Can't open %s", filename);
|
||||
return PLUGIN_ERROR;
|
||||
}
|
||||
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))
|
||||
{
|
||||
rb->splash(2*HZ, "Reading %s overlay failed.", name);
|
||||
rb->splashf(2*HZ, "Reading %s overlay failed.", name);
|
||||
return PLUGIN_ERROR;
|
||||
}
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -85,14 +85,14 @@ enum plugin_status run_overlay(const struct plugin_api* rb, const void* paramete
|
|||
if (header.load_addr < audiobuf ||
|
||||
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;
|
||||
}
|
||||
|
||||
fd = rb->open(filename, O_RDONLY);
|
||||
if (fd < 0)
|
||||
{
|
||||
rb->splash(2*HZ, "Can't open %s", filename);
|
||||
rb->splashf(2*HZ, "Can't open %s", filename);
|
||||
return PLUGIN_ERROR;
|
||||
}
|
||||
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)
|
||||
{
|
||||
rb->splash(2*HZ, "Reading %s overlay failed.", name);
|
||||
rb->splashf(2*HZ, "Reading %s overlay failed.", name);
|
||||
return PLUGIN_ERROR;
|
||||
}
|
||||
/* Zero out bss area */
|
||||
|
|
|
@ -715,7 +715,7 @@ static void play_level(short level, short lives, bool new_level)
|
|||
*/
|
||||
rb->lcd_remote_clear_display();
|
||||
#endif
|
||||
rb->splash(MAZEZAM_DELAY_LIVES, MAZEZAM_TEXT_LIVES,
|
||||
rb->splashf(MAZEZAM_DELAY_LIVES, MAZEZAM_TEXT_LIVES,
|
||||
level+1, lives);
|
||||
|
||||
/* ensure keys pressed during the splash screen are ignored */
|
||||
|
|
|
@ -58,7 +58,7 @@ static void hash_file( int out, const char *path )
|
|||
{
|
||||
char string[MD5_STRING_LENGTH+1];
|
||||
done++;
|
||||
rb->splash( 0, "%d / %d : %s", done, count, path );
|
||||
rb->splashf( 0, "%d / %d : %s", done, count, path );
|
||||
if( hash( string, path ) )
|
||||
rb->write( out, "error", 5 );
|
||||
else
|
||||
|
@ -140,7 +140,7 @@ static void hash_check( int out, const char *path )
|
|||
{
|
||||
const char *filename = rb->strchr( line, ' ' );
|
||||
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 )
|
||||
{
|
||||
const char error[] = "Malformed input line ... skipping";
|
||||
|
|
|
@ -749,12 +749,12 @@ enum minesweeper_status minesweeper( void )
|
|||
break;
|
||||
flags_used = count_flags();
|
||||
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 );
|
||||
}
|
||||
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 );
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -151,7 +151,7 @@ static inline void disk_buf_buffer(void)
|
|||
wm : AVERAGE(disk_buf.low_wm, wm, 16);
|
||||
|
||||
#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);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1674,7 +1674,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
|
|||
errstring = "Error opening file: %d";
|
||||
}
|
||||
|
||||
rb->splash(HZ*2, errstring, err);
|
||||
rb->splashf(HZ*2, errstring, err);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -421,7 +421,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
|
|||
SETTINGS_VERSION);
|
||||
}
|
||||
} 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
|
||||
|
|
|
@ -36,7 +36,7 @@ PLUGIN_HEADER
|
|||
#define PPM_OVERALLMAXVAL 65535
|
||||
#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 lcd_buf[LCD_WIDTH * LCD_HEIGHT];
|
||||
|
|
|
@ -292,7 +292,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
|
|||
if(!found)
|
||||
{
|
||||
/* 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);
|
||||
return PLUGIN_OK;
|
||||
}
|
||||
|
|
|
@ -219,7 +219,7 @@ void generate(void)
|
|||
rb->write(fd,&dirs_count,sizeof(int));
|
||||
if (fd < 0)
|
||||
{
|
||||
rb->splash(HZ, "Couldnt open %s", RFA_FILE);
|
||||
rb->splashf(HZ, "Couldnt open %s", RFA_FILE);
|
||||
return;
|
||||
}
|
||||
#ifndef HAVE_LCD_CHARCELLS
|
||||
|
@ -295,7 +295,7 @@ int edit_list(void)
|
|||
/* load the dat file if not already done */
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -387,13 +387,13 @@ int export_list_to_file_text(void)
|
|||
/* load the dat file if not already done */
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -401,7 +401,7 @@ int export_list_to_file_text(void)
|
|||
int myfd = rb->creat(RFA_FILE_TEXT);
|
||||
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);
|
||||
return -1;
|
||||
}
|
||||
|
@ -434,7 +434,7 @@ int import_list_from_file_text(void)
|
|||
int myfd = rb->open(RFA_FILE_TEXT, O_RDONLY);
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -2520,12 +2520,12 @@ static void goto_menu(void)
|
|||
{
|
||||
if( load_bitmap( filename ) <= 0 )
|
||||
{
|
||||
rb->splash( 1*HZ, "Error while loading %s",
|
||||
rb->splashf( 1*HZ, "Error while loading %s",
|
||||
filename );
|
||||
}
|
||||
else
|
||||
{
|
||||
rb->splash( 1*HZ, "Image loaded (%s)", filename );
|
||||
rb->splashf( 1*HZ, "Image loaded (%s)", filename );
|
||||
restore_screen();
|
||||
inv_cursor(true);
|
||||
return;
|
||||
|
@ -2542,7 +2542,7 @@ static void goto_menu(void)
|
|||
rb->strcasecmp(&filename[rb->strlen(filename)-4], ".bmp"))
|
||||
rb->strcat(filename, ".bmp");
|
||||
save_bitmap( filename );
|
||||
rb->splash( 1*HZ, "File saved (%s)", filename );
|
||||
rb->splashf( 1*HZ, "File saved (%s)", filename );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -3011,7 +3011,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
|
|||
}
|
||||
else
|
||||
{
|
||||
rb->splash( 1*HZ, "Image loaded (%s)", (char *)parameter );
|
||||
rb->splashf( 1*HZ, "Image loaded (%s)", (char *)parameter );
|
||||
restore_screen();
|
||||
rb->strcpy( filename, parameter );
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* void_p
|
|||
if (!found) {
|
||||
/* Something's gone properly pear shaped -
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ bool load_sc_file(sc_file_t *file, char *filename, bool must_exist,
|
|||
if (fd < 0){
|
||||
/* For some reason we couldn't create the file,
|
||||
* 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);
|
||||
goto end_of_proc;
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ bool load_sc_file(sc_file_t *file, char *filename, bool must_exist,
|
|||
ret_val = true;
|
||||
goto end_of_proc;
|
||||
} else {
|
||||
rb->splash(HZ, "Couldn't open %s", filename);
|
||||
rb->splashf(HZ, "Couldn't open %s", filename);
|
||||
goto end_of_proc;
|
||||
}
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ bool load_sc_file(sc_file_t *file, char *filename, bool must_exist,
|
|||
continue;
|
||||
}
|
||||
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);
|
||||
goto end_of_proc;
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ bool dump_sc_file(sc_file_t *file, char *filename)
|
|||
* thing. */
|
||||
fd = rb->open(filename, O_WRONLY|O_TRUNC);
|
||||
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);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ bool list_sc(bool is_editable)
|
|||
case SCLA_SELECT:
|
||||
return goto_entry(sc_file.entries[selected_item].path);
|
||||
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);
|
||||
dump_sc_file(&sc_file, link_filename);
|
||||
return (sc_file.entry_cnt == 0);
|
||||
|
@ -175,7 +175,7 @@ bool goto_entry(char *file_or_dir)
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
/* Set the browsers dirfilter to the global setting
|
||||
|
|
|
@ -618,7 +618,7 @@ static bool read_levels(bool initialize)
|
|||
buffered_boards.start = 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;
|
||||
}
|
||||
|
||||
|
@ -930,7 +930,7 @@ static bool save(char *filename, bool solution)
|
|||
|
||||
if (filename[0] == '\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;
|
||||
}
|
||||
|
||||
|
@ -965,7 +965,7 @@ static bool load(char *filename, bool silent)
|
|||
|
||||
if (filename[0] == '\0' || (fd = rb->open(filename, O_RDONLY)) < 0) {
|
||||
if (!silent)
|
||||
rb->splash(HZ*2, "Unable to open %s", filename);
|
||||
rb->splashf(HZ*2, "Unable to open %s", filename);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -207,7 +207,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
|
|||
rc = write_file();
|
||||
if(rc < 0) {
|
||||
rb->lcd_clear_display();
|
||||
rb->splash(HZ, "Can't write file: %d", rc);
|
||||
rb->splashf(HZ, "Can't write file: %d", rc);
|
||||
} else {
|
||||
rb->lcd_clear_display();
|
||||
rb->splash(HZ, "Done");
|
||||
|
@ -215,7 +215,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
|
|||
} else {
|
||||
if(rc < 0) {
|
||||
rb->lcd_clear_display();
|
||||
rb->splash(HZ, "Can't read file: %d", rc);
|
||||
rb->splashf(HZ, "Can't read file: %d", rc);
|
||||
} else {
|
||||
rb->lcd_clear_display();
|
||||
rb->splash(HZ, "The file is too big");
|
||||
|
|
|
@ -690,7 +690,7 @@ static int save(
|
|||
|
||||
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);
|
||||
} else {
|
||||
|
@ -702,7 +702,7 @@ static int save(
|
|||
}
|
||||
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);
|
||||
retval = -1;
|
||||
|
@ -713,7 +713,7 @@ static int save(
|
|||
{
|
||||
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);
|
||||
}
|
||||
|
@ -731,7 +731,7 @@ static int save(
|
|||
|
||||
if (close_stat != 0)
|
||||
{
|
||||
rb->splash(0, "failed: closing file2: error %d",
|
||||
rb->splashf(0, "failed: closing file2: error %d",
|
||||
close_stat);
|
||||
rb->button_get(true);
|
||||
rb->button_get(true);
|
||||
|
@ -744,7 +744,7 @@ static int save(
|
|||
}
|
||||
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);
|
||||
retval = -2;
|
||||
|
@ -754,7 +754,7 @@ static int save(
|
|||
close_stat = rb->close(src_file);
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -350,7 +350,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
|
|||
fd = rb->open(filename,O_RDONLY);
|
||||
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;
|
||||
}
|
||||
#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))
|
||||
{
|
||||
rb->splash(HZ*2,"Error reading file: %s",(char*)parameter);
|
||||
rb->splashf(HZ*2,"Error reading file: %s",(char*)parameter);
|
||||
rb->close(fd);
|
||||
return PLUGIN_ERROR;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
rb->splash(HZ*2, "File error: %d", rc);
|
||||
rb->splashf(HZ*2, "File error: %d", rc);
|
||||
}
|
||||
|
||||
static const unsigned char empty_id3_header[] =
|
||||
|
|
|
@ -3500,7 +3500,7 @@ int play_file(char* filename)
|
|||
format = letoh16(*(uint16_t *)(aud_buf + 20));
|
||||
if (format != 1)
|
||||
{
|
||||
rb->splash(2*HZ, "Unsupported format: %d", format);
|
||||
rb->splashf(2*HZ, "Unsupported format: %d", format);
|
||||
rb->close(fd);
|
||||
return PLAY_ERROR;
|
||||
}
|
||||
|
@ -3508,7 +3508,7 @@ int play_file(char* filename)
|
|||
channels = letoh16(*(uint16_t *)(aud_buf + 22));
|
||||
if (channels > 2)
|
||||
{
|
||||
rb->splash(2*HZ, "Too many channels: %d", channels);
|
||||
rb->splashf(2*HZ, "Too many channels: %d", channels);
|
||||
rb->close(fd);
|
||||
return PLAY_ERROR;
|
||||
}
|
||||
|
@ -3516,7 +3516,7 @@ int play_file(char* filename)
|
|||
samplebits = letoh16(*(uint16_t *)(aud_buf + 34));
|
||||
if (samplebits != 16)
|
||||
{
|
||||
rb->splash(2*HZ, "Unsupported sample depth: %dbit", samplebits);
|
||||
rb->splashf(2*HZ, "Unsupported sample depth: %dbit", samplebits);
|
||||
rb->close(fd);
|
||||
return PLAY_ERROR;
|
||||
}
|
||||
|
@ -3534,7 +3534,7 @@ int play_file(char* filename)
|
|||
case 44100: rate = 9; break;
|
||||
case 48000: rate = 10; break;
|
||||
default:
|
||||
rb->splash(2*HZ, "Unsupported samplerate: %dHz", samplerate);
|
||||
rb->splashf(2*HZ, "Unsupported samplerate: %dHz", samplerate);
|
||||
rb->close(fd);
|
||||
return PLAY_ERROR;
|
||||
}
|
||||
|
|
|
@ -3772,7 +3772,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
|
|||
rc = rb->mkdir(recbasedir);
|
||||
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);
|
||||
return PLUGIN_ERROR;
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@ static int readwavpeaks(const char *filename)
|
|||
}
|
||||
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);
|
||||
return -1;
|
||||
}
|
||||
|
@ -438,12 +438,12 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void *parame
|
|||
/* zoom out */
|
||||
if(zoomlevel > 1)
|
||||
zoomlevel /= 2;
|
||||
rb->splash(HZ/2, "ZOOM: %dx",(int)zoomlevel);
|
||||
rb->splashf(HZ/2, "ZOOM: %dx",(int)zoomlevel);
|
||||
break;
|
||||
case ACTION_KBD_DOWN:
|
||||
if(zoomlevel < (mempeakcount / LCD_WIDTH / 2))
|
||||
zoomlevel *= 2;
|
||||
rb->splash(HZ/2, "ZOOM: %dx",(int)zoomlevel);
|
||||
rb->splashf(HZ/2, "ZOOM: %dx",(int)zoomlevel);
|
||||
break;
|
||||
case ACTION_KBD_LEFT:
|
||||
center -= 10 * (mempeakcount / LCD_WIDTH) / zoomlevel;
|
||||
|
|
|
@ -845,7 +845,7 @@ static inline void move_board (void)
|
|||
player.j = newj;
|
||||
}
|
||||
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;
|
||||
if (player.level < MAX_LEVEL)
|
||||
player.level++;
|
||||
|
|
|
@ -651,7 +651,7 @@ void load_snapshot_file_type(char *name, int type)
|
|||
snsh = rb->open(filenamebuf, O_RDONLY);
|
||||
if(snsh < 0) {
|
||||
#ifndef USE_GRAY
|
||||
rb->splash(HZ, "Could not open snapshot file `%s'",filenamebuf);
|
||||
rb->splashf(HZ, "Could not open snapshot file `%s'",filenamebuf);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -532,7 +532,7 @@ static void init_load(const void *parameter)
|
|||
check_params(parameter);
|
||||
if(spcf_init_snapshot != NULL) {
|
||||
#ifndef USE_GREY
|
||||
rb->splash(HZ, "Loading snapshot '%s'", spcf_init_snapshot);
|
||||
rb->splashf(HZ, "Loading snapshot '%s'", spcf_init_snapshot);
|
||||
#endif
|
||||
|
||||
load_snapshot_file_type(spcf_init_snapshot, spcf_init_snapshot_type);
|
||||
|
|
|
@ -742,7 +742,7 @@ int radio_screen(void)
|
|||
case ACTION_FM_PRESET:
|
||||
if(num_presets < 1)
|
||||
{
|
||||
gui_syncsplash(HZ, ID2P(LANG_FM_NO_PRESETS));
|
||||
splash(HZ, ID2P(LANG_FM_NO_PRESETS));
|
||||
update_screen = true;
|
||||
FOR_NB_SCREENS(i)
|
||||
{
|
||||
|
@ -776,7 +776,7 @@ int radio_screen(void)
|
|||
case ACTION_FM_FREEZE:
|
||||
if(!screen_freeze)
|
||||
{
|
||||
gui_syncsplash(HZ, str(LANG_FM_FREEZE));
|
||||
splash(HZ, str(LANG_FM_FREEZE));
|
||||
screen_freeze = true;
|
||||
}
|
||||
else
|
||||
|
@ -917,7 +917,7 @@ int radio_screen(void)
|
|||
FOR_NB_SCREENS(i)
|
||||
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));
|
||||
FOR_NB_SCREENS(i)
|
||||
screens[i].puts_scroll(0, top_of_screen + 2, buf);
|
||||
|
@ -1001,7 +1001,7 @@ int radio_screen(void)
|
|||
#if CONFIG_CODEC != SWCODEC
|
||||
if(audio_status() & AUDIO_STATUS_ERROR)
|
||||
{
|
||||
gui_syncsplash(0, str(LANG_DISK_FULL));
|
||||
splash(0, str(LANG_DISK_FULL));
|
||||
gui_syncstatusbar_draw(&statusbars,true);
|
||||
FOR_NB_SCREENS(i)
|
||||
{
|
||||
|
@ -1083,7 +1083,7 @@ static void radio_save_presets(void)
|
|||
}
|
||||
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
|
||||
{
|
||||
gui_syncsplash(HZ, ID2P(LANG_FM_NO_FREE_PRESETS));
|
||||
splash(HZ, ID2P(LANG_FM_NO_FREE_PRESETS));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -1257,7 +1257,7 @@ static int save_preset_list(void)
|
|||
if((!p1) || (len > MAX_FILENAME) || (len == 0))
|
||||
{
|
||||
/* no slash, too long or too short */
|
||||
gui_syncsplash(HZ, ID2P(LANG_INVALID_FILENAME));
|
||||
splash(HZ, ID2P(LANG_INVALID_FILENAME));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1277,7 +1277,7 @@ static int save_preset_list(void)
|
|||
}
|
||||
}
|
||||
else
|
||||
gui_syncsplash(HZ, ID2P(LANG_FM_NO_PRESETS));
|
||||
splash(HZ, ID2P(LANG_FM_NO_PRESETS));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1456,8 +1456,6 @@ static int scan_presets(void *viewports)
|
|||
const struct fm_region_data * const fmr =
|
||||
&fm_region_data[global_settings.fm_region];
|
||||
|
||||
char buf[MAX_FMPRESET_LEN + 1];
|
||||
|
||||
curr_freq = fmr->freq_min;
|
||||
num_presets = 0;
|
||||
memset(presets, 0, sizeof(presets));
|
||||
|
@ -1473,8 +1471,7 @@ static int scan_presets(void *viewports)
|
|||
frac = freq % 100;
|
||||
freq /= 100;
|
||||
|
||||
snprintf(buf, MAX_FMPRESET_LEN, str(LANG_FM_SCANNING), freq, frac);
|
||||
gui_syncsplash(0, buf);
|
||||
splashf(0, str(LANG_FM_SCANNING), freq, frac);
|
||||
|
||||
if(tuner_set(RADIO_SCAN_FREQUENCY, curr_freq))
|
||||
{
|
||||
|
|
|
@ -606,7 +606,7 @@ int rec_create_directory(void)
|
|||
{
|
||||
while (action_userabort(HZ) == false)
|
||||
{
|
||||
gui_syncsplash(0, "%s %s",
|
||||
splashf(0, "%s %s",
|
||||
str(LANG_REC_DIR_NOT_WRITABLE),
|
||||
str(LANG_OFF_ABORT));
|
||||
}
|
||||
|
@ -1442,7 +1442,6 @@ bool recording_screen(bool no_source)
|
|||
screens[1].puts(0, 0, str(LANG_REMOTE_LCD_OFF));
|
||||
screens[1].puts(0, 1, str(LANG_REMOTE_LCD_ON));
|
||||
screens[1].update_viewport();
|
||||
gui_splash(&screens[0], 0, str(LANG_REMOTE_LCD_OFF));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1789,7 +1788,7 @@ bool recording_screen(bool no_source)
|
|||
audio_stat = audio_status();
|
||||
if (audio_stat & AUDIO_STATUS_ERROR)
|
||||
{
|
||||
gui_syncsplash(0, str(LANG_DISK_FULL));
|
||||
splash(0, str(LANG_DISK_FULL));
|
||||
gui_syncstatusbar_draw(&statusbars, true);
|
||||
|
||||
FOR_NB_SCREENS(i)
|
||||
|
|
|
@ -127,14 +127,14 @@ static int browser(void* param)
|
|||
/* Maybe just needs to reboot due to delayed commit */
|
||||
if (stat->commit_delayed)
|
||||
{
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_PLEASE_REBOOT));
|
||||
splash(HZ*2, ID2P(LANG_PLEASE_REBOOT));
|
||||
break;
|
||||
}
|
||||
|
||||
/* Check if ready status is known */
|
||||
if (!stat->readyvalid)
|
||||
{
|
||||
gui_syncsplash(0, str(LANG_TAGCACHE_BUSY));
|
||||
splash(0, str(LANG_TAGCACHE_BUSY));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -178,13 +178,13 @@ static int browser(void* param)
|
|||
}
|
||||
if (stat->commit_step > 0)
|
||||
{
|
||||
gui_syncsplash(0, "%s [%d/%d]",
|
||||
splashf(0, "%s [%d/%d]",
|
||||
str(LANG_TAGCACHE_INIT), stat->commit_step,
|
||||
tagcache_get_max_commit_step());
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_syncsplash(0, str(LANG_BUILDING_DATABASE),
|
||||
splashf(0, str(LANG_BUILDING_DATABASE),
|
||||
stat->processed_entries);
|
||||
}
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ static int wpsscrn(void* param)
|
|||
}
|
||||
else
|
||||
{
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME));
|
||||
splash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME));
|
||||
}
|
||||
#if LCD_DEPTH > 1
|
||||
show_main_backdrop();
|
||||
|
|
|
@ -168,9 +168,7 @@ int mmc_remove_request(void)
|
|||
int i;
|
||||
FOR_NB_SCREENS(i)
|
||||
screens[i].clear_display();
|
||||
gui_syncsplash(1, str(LANG_REMOVE_MMC));
|
||||
if (global_settings.talk_menu)
|
||||
talk_id(LANG_REMOVE_MMC, false);
|
||||
splash(0, ID2P(LANG_REMOVE_MMC));
|
||||
|
||||
while (1)
|
||||
{
|
||||
|
@ -389,7 +387,7 @@ int charging_screen(void)
|
|||
#if CONFIG_CHARGING
|
||||
void charging_splash(void)
|
||||
{
|
||||
gui_syncsplash(2*HZ, (unsigned char *)str(LANG_BATTERY_CHARGE));
|
||||
splash(2*HZ, str(LANG_BATTERY_CHARGE));
|
||||
button_clear_queue();
|
||||
}
|
||||
#endif
|
||||
|
@ -669,7 +667,7 @@ bool shutdown_screen(void)
|
|||
|
||||
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))
|
||||
{
|
||||
|
|
|
@ -634,15 +634,15 @@ bool settings_save_config(int options)
|
|||
break;
|
||||
}
|
||||
else {
|
||||
gui_syncsplash(HZ, ID2P(LANG_CANCEL));
|
||||
splash(HZ, ID2P(LANG_CANCEL));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (settings_write_config(filename, options))
|
||||
gui_syncsplash(HZ, ID2P(LANG_SETTINGS_SAVED));
|
||||
splash(HZ, ID2P(LANG_SETTINGS_SAVED));
|
||||
else
|
||||
gui_syncsplash(HZ, ID2P(LANG_FAILED));
|
||||
splash(HZ, ID2P(LANG_FAILED));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -187,10 +187,10 @@ extern unsigned char vp_dummy[VIRT_SIZE];
|
|||
#define ID2P(id) (VIRT_PTR + id)
|
||||
|
||||
/* 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 */
|
||||
#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.
|
||||
Explicitly define HAVE_LCD_CONTRAST in config file for newer ports for
|
||||
|
|
|
@ -711,10 +711,10 @@ static void tagtree_track_finish_event(struct mp3entry *id3)
|
|||
|
||||
bool tagtree_export(void)
|
||||
{
|
||||
gui_syncsplash(0, str(LANG_CREATING));
|
||||
splash(0, str(LANG_CREATING));
|
||||
if (!tagcache_create_changelog(&tcs))
|
||||
{
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_FAILED));
|
||||
splash(HZ*2, ID2P(LANG_FAILED));
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -722,10 +722,10 @@ bool tagtree_export(void)
|
|||
|
||||
bool tagtree_import(void)
|
||||
{
|
||||
gui_syncsplash(0, ID2P(LANG_WAIT));
|
||||
splash(0, ID2P(LANG_WAIT));
|
||||
if (!tagcache_import_changelog())
|
||||
{
|
||||
gui_syncsplash(HZ*2, ID2P(LANG_FAILED));
|
||||
splash(HZ*2, ID2P(LANG_FAILED));
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -942,8 +942,7 @@ static bool show_search_progress(bool init, int count)
|
|||
/* Update progress every 1/10 of a second */
|
||||
if (current_tick - last_tick > HZ/10)
|
||||
{
|
||||
gui_syncsplash(0, str(LANG_PLAYLIST_SEARCH_MSG), count,
|
||||
str(LANG_OFF_ABORT));
|
||||
splashf(0, str(LANG_PLAYLIST_SEARCH_MSG), count, str(LANG_OFF_ABORT));
|
||||
if (action_userabort(TIMEOUT_NOBLOCK))
|
||||
return false;
|
||||
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))
|
||||
{
|
||||
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");
|
||||
return 0;
|
||||
}
|
||||
|
@ -1369,7 +1368,7 @@ int tagtree_load(struct tree_context* c)
|
|||
{
|
||||
c->dirlevel = 0;
|
||||
count = load_root(c);
|
||||
gui_syncsplash(HZ, str(LANG_TAGCACHE_BUSY));
|
||||
splash(HZ, str(LANG_TAGCACHE_BUSY));
|
||||
}
|
||||
|
||||
/* 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);
|
||||
if (!tagcache_search(&tcs, tag_filename))
|
||||
{
|
||||
gui_syncsplash(HZ, ID2P(LANG_TAGCACHE_BUSY));
|
||||
splash(HZ, ID2P(LANG_TAGCACHE_BUSY));
|
||||
cpu_boost(false);
|
||||
return false;
|
||||
}
|
||||
|
@ -1674,12 +1673,12 @@ bool tagtree_insert_selection_playlist(int position, bool queue)
|
|||
}
|
||||
|
||||
if (tc->filesindir <= 0)
|
||||
gui_syncsplash(HZ, ID2P(LANG_END_PLAYLIST));
|
||||
splash(HZ, ID2P(LANG_END_PLAYLIST));
|
||||
else
|
||||
{
|
||||
logf("insert_all_playlist");
|
||||
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. */
|
||||
|
|
12
apps/tree.c
12
apps/tree.c
|
@ -276,10 +276,10 @@ bool check_rockboxdir(void)
|
|||
int i;
|
||||
FOR_NB_SCREENS(i)
|
||||
screens[i].clear_display();
|
||||
gui_syncsplash(HZ*2, "No .rockbox directory");
|
||||
splash(HZ*2, "No .rockbox directory");
|
||||
FOR_NB_SCREENS(i)
|
||||
screens[i].clear_display();
|
||||
gui_syncsplash(HZ*2, "Installation incomplete");
|
||||
splash(HZ*2, "Installation incomplete");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -394,7 +394,7 @@ static int update_dir(void)
|
|||
#endif
|
||||
(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
|
||||
|
@ -635,7 +635,7 @@ static int dirbrowse()
|
|||
|
||||
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() */
|
||||
}
|
||||
|
||||
|
@ -889,7 +889,7 @@ bool create_playlist(void)
|
|||
|
||||
snprintf(filename, sizeof filename, "%s.m3u8",
|
||||
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();
|
||||
catalog_add_to_a_playlist(tc.currdir, ATTR_DIRECTORY, true, filename);
|
||||
|
@ -1134,7 +1134,7 @@ void tree_restore(void)
|
|||
if (global_settings.dircache)
|
||||
{
|
||||
/* 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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue