replaced all the splash calls by gui_sync_splash, added some missing remote key in the playlist viewer

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7909 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Kevin Ferrare 2005-11-16 15:12:15 +00:00
parent 76b75efa06
commit e991beed6d
21 changed files with 102 additions and 236 deletions

View file

@ -43,6 +43,7 @@
#include "alarm_menu.h"
#include "backlight.h"
#include "splash.h"
#define MARGIN_Y (global_settings.statusbar ? STATUSBAR_HEIGHT : 0)
bool alarm_screen(void)
@ -92,11 +93,11 @@ bool alarm_screen(void)
rtc_init();
rtc_set_alarm(h,m);
rtc_enable_alarm(true);
splash(HZ*2, true, str(LANG_ALARM_MOD_TIME_TO_GO),
gui_syncsplash(HZ*2, true, str(LANG_ALARM_MOD_TIME_TO_GO),
togo / 60, togo % 60);
done = true;
} else {
splash(HZ, true, str(LANG_ALARM_MOD_ERROR));
gui_syncsplash(HZ, true, str(LANG_ALARM_MOD_ERROR));
update = true;
}
break;
@ -146,7 +147,7 @@ bool alarm_screen(void)
case BUTTON_MENU:
#endif
rtc_enable_alarm(false);
splash(HZ*2, true, str(LANG_ALARM_MOD_DISABLE));
gui_syncsplash(HZ*2, true, str(LANG_ALARM_MOD_DISABLE));
done = true;
break;

View file

@ -48,7 +48,7 @@
#include "talk.h"
#include "misc.h"
#include "abrepeat.h"
#include "splash.h"
#define MAX_BOOKMARKS 10
#define MAX_BOOKMARK_SIZE 350
#define RECENT_BOOKMARK_FILE ROCKBOX_DIR "/most-recent.bmark"
@ -283,9 +283,9 @@ static bool write_bookmark(bool create_bookmark_file)
}
if (success)
splash(HZ, true, str(LANG_BOOKMARK_CREATE_SUCCESS));
gui_syncsplash(HZ, true, str(LANG_BOOKMARK_CREATE_SUCCESS));
else
splash(HZ, true, str(LANG_BOOKMARK_CREATE_FAILURE));
gui_syncsplash(HZ, true, str(LANG_BOOKMARK_CREATE_FAILURE));
return true;
}
@ -621,7 +621,7 @@ static char* select_bookmark(const char* bookmark_file_name)
/* if there were no bookmarks in the file, delete the file and exit. */
if(bookmark_id <= 0)
{
splash(HZ, true, str(LANG_BOOKMARK_LOAD_EMPTY));
gui_syncsplash(HZ, true, str(LANG_BOOKMARK_LOAD_EMPTY));
remove(bookmark_file_name);
return NULL;
}

View file

@ -48,6 +48,8 @@
#include "system.h"
#include "sound.h"
#include "database.h"
#include "splash.h"
#if (CONFIG_CODEC == SWCODEC)
#include "pcm_playback.h"
#endif
@ -94,7 +96,7 @@ struct codec_api ci = {
NULL,
NULL,
splash,
gui_syncsplash,
/* file */
(open_func)PREFIX(open),
@ -304,7 +306,7 @@ int codec_load_file(const char *plugin, struct codec_api *api)
if (fd < 0) {
snprintf(msgbuf, sizeof(msgbuf)-1, "Couldn't load codec: %s", plugin);
logf("Codec load error:%d", fd);
splash(HZ*2, true, msgbuf);
gui_syncsplash(HZ*2, true, msgbuf);
return fd;
}

View file

@ -43,6 +43,7 @@
#include "keyboard.h"
#include "database.h"
#include "autoconf.h"
#include "splash.h"
#if CONFIG_CODEC == SWCODEC
#include "playback.h"
@ -94,7 +95,7 @@ int tagdb_init(void)
ptr[1] != 'D' ||
ptr[2] != 'B')
{
splash(HZ,true,"Not a rockbox ID3 database!");
gui_syncsplash(HZ,true,"Not a rockbox ID3 database!");
return -1;
}
#ifdef ROCKBOX_LITTLE_ENDIAN
@ -106,7 +107,7 @@ int tagdb_init(void)
#endif
if ( (tagdbheader.version&0xFF) != TAGDB_VERSION)
{
splash(HZ,true,"Unsupported database version %d!",
gui_syncsplash(HZ,true,"Unsupported database version %d!",
tagdbheader.version&0xFF);
return -1;
}
@ -115,7 +116,7 @@ int tagdb_init(void)
tagdbheader.albumstart > tagdbheader.songstart ||
tagdbheader.artiststart > tagdbheader.albumstart)
{
splash(HZ,true,"Corrupt ID3 database!");
gui_syncsplash(HZ,true,"Corrupt ID3 database!");
return -1;
}
@ -232,7 +233,7 @@ void update_fentryoffsets(int start, int end)
}
}
if(fe.rundbentry!=-1) {
splash(HZ*2,true, "o.o.. found a rundbentry? o.o; didn't update "
gui_syncsplash(HZ*2,true, "o.o.. found a rundbentry? o.o; didn't update "
"it, update the code o.o;");
}
}
@ -242,7 +243,7 @@ int tagdb_shiftdown(int targetoffset, int startingoffset, int bytes)
{
int amount;
if(targetoffset>=startingoffset) {
splash(HZ*2,true,"Woah. no beeping way. (tagdb_shiftdown)");
gui_syncsplash(HZ*2,true,"Woah. no beeping way. (tagdb_shiftdown)");
return 0;
}
lseek(tagdb_fd,startingoffset,SEEK_SET);
@ -253,7 +254,7 @@ int tagdb_shiftdown(int targetoffset, int startingoffset, int bytes)
written=write(tagdb_fd,sbuf,amount);
targetoffset+=written;
if(amount!=written) {
splash(HZ*2,true,"Something went very wrong. expect database "
gui_syncsplash(HZ*2,true,"Something went very wrong. expect database "
"corruption. (tagdb_shiftdown)");
return 0;
}
@ -268,7 +269,7 @@ int tagdb_shiftup(int targetoffset, int startingoffset, int bytes)
int amount,amount2;
int readpos,writepos,filelen;
if(targetoffset<=startingoffset) {
splash(HZ*2,true,"Um. no. (tagdb_shiftup)");
gui_syncsplash(HZ*2,true,"Um. no. (tagdb_shiftup)");
return 0;
}
filelen=lseek(tagdb_fd,0,SEEK_END);
@ -280,14 +281,14 @@ int tagdb_shiftup(int targetoffset, int startingoffset, int bytes)
lseek(tagdb_fd,readpos,SEEK_SET);
amount2=read(tagdb_fd,sbuf,amount);
if(amount2!=amount) {
splash(HZ*2,true,"Something went very wrong. expect database "
gui_syncsplash(HZ*2,true,"Something went very wrong. expect database "
"corruption. (tagdb_shiftup)");
return 0;
}
lseek(tagdb_fd,writepos,SEEK_SET);
amount=write(tagdb_fd,sbuf,amount2);
if(amount2!=amount) {
splash(HZ*2,true,"Something went very wrong. expect database "
gui_syncsplash(HZ*2,true,"Something went very wrong. expect database "
"corruption. (tagdb_shiftup)");
return 0;
}
@ -296,7 +297,7 @@ int tagdb_shiftup(int targetoffset, int startingoffset, int bytes)
if(bytes==0)
return 1;
else {
splash(HZ*2,true,"Something went wrong, >.>;; (tagdb_shiftup)");
gui_syncsplash(HZ*2,true,"Something went wrong, >.>;; (tagdb_shiftup)");
return 0;
}
}
@ -361,7 +362,7 @@ int rundb_init(void)
ptr[1] != 'R' ||
ptr[2] != 'D')
{
splash(HZ,true,"Not a rockbox runtime database!");
gui_syncsplash(HZ,true,"Not a rockbox runtime database!");
return -1;
}
#ifdef ROCKBOX_LITTLE_ENDIAN
@ -373,7 +374,7 @@ int rundb_init(void)
#endif
if ( (rundbheader.version&0xFF) != RUNDB_VERSION)
{
splash(HZ,true,"Unsupported runtime database version %d!",
gui_syncsplash(HZ,true,"Unsupported runtime database version %d!",
rundbheader.version&0xFF);
return -1;
}

View file

@ -44,6 +44,7 @@
#include "keyboard.h"
#include "autoconf.h"
#include "list.h"
#include "splash.h"
static int db_play_folder(struct tree_context* c);
static int db_search(struct tree_context* c, char* string);
@ -130,13 +131,13 @@ int db_load(struct tree_context* c)
i = db_search(c, searchstring);
c->dirlength = c->filesindir = i;
if (c->dirfull) {
splash(HZ, true, "%s %s",
gui_syncsplash(HZ, true, "%s %s",
str(LANG_SHOWDIR_ERROR_BUFFER),
str(LANG_SHOWDIR_ERROR_FULL));
c->dirfull = false;
}
else
splash(HZ, true, str(LANG_ID3DB_MATCHES), i);
gui_syncsplash(HZ, true, str(LANG_ID3DB_MATCHES), i);
return i;
case allsongs:

View file

@ -47,6 +47,8 @@
#include "panic.h"
#include "screens.h"
#include "misc.h"
#include "splash.h"
#ifdef HAVE_LCD_BITMAP
#include "widgets.h"
#include "peakmeter.h"
@ -1748,7 +1750,7 @@ extern bool do_screendump_instead_of_usb;
bool dbg_screendump(void)
{
do_screendump_instead_of_usb = !do_screendump_instead_of_usb;
splash(HZ, true, "Screendump %s",
gui_syncsplash(HZ, true, "Screendump %s",
do_screendump_instead_of_usb?"enabled":"disabled");
return false;
}

View file

@ -39,6 +39,7 @@
#include "rolo.h"
#include "sprintf.h"
#include "dircache.h"
#include "splash.h"
#ifndef SIMULATOR
static int boot_size = 0;
@ -406,7 +407,7 @@ int ft_enter(struct tree_context* c)
set_file(buf, global_settings.lang_file,
MAX_FILENAME);
talk_init(); /* use voice of same language */
splash(HZ, true, str(LANG_LANGUAGE_LOADED));
gui_syncsplash(HZ, true, str(LANG_LANGUAGE_LOADED));
}
break;

View file

@ -35,6 +35,7 @@
#include "dir.h"
#include "file.h"
#include "icons.h"
#include "splash.h"
/* max plugin name size without extensions and path */
#define MAX_PLUGIN_LENGTH 32
@ -316,14 +317,14 @@ static void scan_plugins(void)
/* exttypes[] full, bail out */
if (cnt_exttypes >= MAX_EXTTYPES)
{
splash(HZ,true,str(LANG_FILETYPES_EXTENSION_FULL));
gui_syncsplash(HZ,true,str(LANG_FILETYPES_EXTENSION_FULL));
break;
}
/* filetypes[] full, bail out */
if (cnt_filetypes >= MAX_FILETYPES)
{
splash(HZ,true,str(LANG_FILETYPES_FULL));
gui_syncsplash(HZ,true,str(LANG_FILETYPES_FULL));
break;
}
@ -356,7 +357,7 @@ static void scan_plugins(void)
/* filter out to long filenames */
if (strlen(entry->d_name) > MAX_PLUGIN_LENGTH + 5)
{
splash(HZ,true,str(LANG_FILETYPES_PLUGIN_NAME_LONG));
gui_syncsplash(HZ,true,str(LANG_FILETYPES_PLUGIN_NAME_LONG));
continue;
}
@ -537,13 +538,13 @@ bool read_config(const char* file)
{
if (cnt_exttypes >= MAX_EXTTYPES)
{
splash(HZ,true,str(LANG_FILETYPES_EXTENSION_FULL));
gui_syncsplash(HZ,true,str(LANG_FILETYPES_EXTENSION_FULL));
break;
}
if (cnt_filetypes >= MAX_FILETYPES)
{
splash(HZ,true,str(LANG_FILETYPES_FULL));
gui_syncsplash(HZ,true,str(LANG_FILETYPES_FULL));
break;
}
@ -612,7 +613,7 @@ bool read_config(const char* file)
{
if (strlen(str[plugin]) > MAX_PLUGIN_LENGTH)
{
splash(HZ, true, str(LANG_FILETYPES_PLUGIN_NAME_LONG));
gui_syncsplash(HZ, true, str(LANG_FILETYPES_PLUGIN_NAME_LONG));
str[plugin] = NULL;
continue;
}
@ -712,7 +713,7 @@ static char* string2icon(const char* str)
(unsigned long) string_buffer -
(unsigned long) next_free_string) < ICON_LENGTH)
{
splash(HZ,true,str(LANG_FILETYPES_STRING_BUFFER_EMPTY));
gui_syncsplash(HZ,true,str(LANG_FILETYPES_STRING_BUFFER_EMPTY));
return NULL;
}
@ -768,7 +769,7 @@ static char* get_string(const char* str)
}
else
{
splash(HZ,true,str(LANG_FILETYPES_STRING_BUFFER_EMPTY));
gui_syncsplash(HZ,true,str(LANG_FILETYPES_STRING_BUFFER_EMPTY));
return NULL;
}
}

View file

@ -43,6 +43,7 @@
#include "atoi.h"
#include "version.h"
#include "font.h"
#include "splash.h"
#ifdef HAVE_MMC
#include "ata_mmc.h"
#endif
@ -442,7 +443,7 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
#endif
{
lcd_clear_display();
splash(0, true, str(LANG_SHUTTINGDOWN));
gui_syncsplash(0, true, str(LANG_SHUTTINGDOWN));
if (callback != NULL)
callback(parameter);

View file

@ -48,6 +48,7 @@
#include "bookmark.h"
#include "wps.h"
#include "action.h"
#include "splash.h"
#ifdef HAVE_LCD_BITMAP
#include "icons.h"
#endif
@ -125,7 +126,7 @@ static bool list_viewers(void)
}
else
{
splash(HZ*2, true, "No viewers found");
gui_syncsplash(HZ*2, true, "No viewers found");
}
if (ret == PLUGIN_USB_CONNECTED)
@ -495,7 +496,7 @@ bool create_dir(void)
rc = mkdir(dirname, 0);
if (rc < 0) {
splash(HZ, true, "%s %s", str(LANG_CREATE_DIR), str(LANG_FAILED));
gui_syncsplash(HZ, true, "%s %s", str(LANG_CREATE_DIR), str(LANG_FAILED));
} else {
onplay_result = ONPLAY_RELOAD_DIR;
}

View file

@ -65,6 +65,7 @@
#include "radio.h"
#include "power.h"
#endif
#include "splash.h"
static volatile bool audio_codec_loaded;
static volatile bool voice_codec_loaded;
@ -918,7 +919,7 @@ bool loadcodec(const char *trackname, bool start_play)
default:
logf("Codec: Unsupported");
snprintf(msgbuf, sizeof(msgbuf)-1, "No codec for: %s", trackname);
splash(HZ*2, true, msgbuf);
gui_syncsplash(HZ*2, true, msgbuf);
codec_path = NULL;
}
@ -952,7 +953,7 @@ bool loadcodec(const char *trackname, bool start_play)
if (fd < 0) {
logf("Codec doesn't exist!");
snprintf(msgbuf, sizeof(msgbuf)-1, "Couldn't load codec: %s", codec_path);
splash(HZ*2, true, msgbuf);
gui_syncsplash(HZ*2, true, msgbuf);
return false;
}
@ -1872,7 +1873,7 @@ void codec_thread(void)
if (status != CODEC_OK) {
logf("Codec failure");
audio_stop_playback();
splash(HZ*2, true, "Codec failure");
gui_syncsplash(HZ*2, true, "Codec failure");
} else {
logf("Codec finished");
}
@ -2266,7 +2267,7 @@ void audio_set_crossfade(int enable)
/* Re-initialize audio system. */
if (was_playing)
splash(0, true, str(LANG_RESTARTING_PLAYBACK));
gui_syncsplash(0, true, str(LANG_RESTARTING_PLAYBACK));
pcmbuf_init(size);
pcmbuf_crossfade_enable(enable);
reset_buffer();

View file

@ -673,15 +673,30 @@ bool playlist_viewer_ex(char* filename)
switch (button)
{
case TREE_EXIT:
#ifdef TREE_RC_EXIT
case TREE_RC_EXIT:
#endif
#ifdef TREE_OFF
case TREE_OFF:
case TREE_OFF:
#endif
exit = true;
break;
#ifdef TREE_ENTER
case TREE_ENTER:
case TREE_ENTER | BUTTON_REPEAT:
#endif
#ifdef TREE_RC_RUN
case TREE_RC_RUN:
#endif
case TREE_RUN:
#ifdef TREE_RUN_PRE
if (lastbutton != TREE_RUN_PRE)
if (((button == TREE_RUN)
#ifdef TREE_RC_RUN_PRE
|| (button == TREE_RC_RUN))
&& ((lastbutton != TREE_RC_RUN_PRE)
#endif
&& (lastbutton != TREE_RUN_PRE)))
break;
#endif
struct playlist_entry * current_track=playlist_buffer_get_track(&viewer.buffer, viewer.selected_track);
@ -722,6 +737,9 @@ bool playlist_viewer_ex(char* filename)
case TREE_CONTEXT:
#ifdef TREE_CONTEXT2
case TREE_CONTEXT2:
#endif
#ifdef TREE_RC_CONTEXT
case TREE_RC_CONTEXT:
#endif
{
/* ON+PLAY menu */
@ -747,6 +765,9 @@ bool playlist_viewer_ex(char* filename)
}
case TREE_MENU:
#ifdef TREE_RC_MENU
case TREE_RC_MENU:
#endif
if (viewer_menu())
{
ret = true;

View file

@ -48,6 +48,7 @@
#include "timer.h"
#include "sound.h"
#include "database.h"
#include "splash.h"
#if (CONFIG_CODEC == SWCODEC)
#include "pcm_playback.h"
#endif
@ -138,7 +139,7 @@ static const struct plugin_api rockbox_api = {
backlight_on,
backlight_off,
backlight_set_timeout,
splash,
gui_syncsplash,
#ifdef HAVE_REMOTE_LCD
/* remote lcd */
lcd_remote_set_contrast,
@ -400,7 +401,7 @@ int plugin_load(const char* plugin, void* parameter)
fd = open(plugin, O_RDONLY);
if (fd < 0) {
snprintf(buf, sizeof buf, str(LANG_PLUGIN_CANT_OPEN), plugin);
splash(HZ*2, true, buf);
gui_syncsplash(HZ*2, true, buf);
return fd;
}
@ -413,12 +414,12 @@ int plugin_load(const char* plugin, void* parameter)
if (plugin_size < 0) {
/* read error */
snprintf(buf, sizeof buf, str(LANG_READ_FAILED), plugin);
splash(HZ*2, true, buf);
gui_syncsplash(HZ*2, true, buf);
return -1;
}
if (plugin_size == 0) {
/* loaded a 0-byte plugin, implying it's not for this model */
splash(HZ*2, true, str(LANG_PLUGIN_WRONG_MODEL));
gui_syncsplash(HZ*2, true, str(LANG_PLUGIN_WRONG_MODEL));
return -1;
}
#endif
@ -450,15 +451,15 @@ int plugin_load(const char* plugin, void* parameter)
return PLUGIN_USB_CONNECTED;
case PLUGIN_WRONG_API_VERSION:
splash(HZ*2, true, str(LANG_PLUGIN_WRONG_VERSION));
gui_syncsplash(HZ*2, true, str(LANG_PLUGIN_WRONG_VERSION));
break;
case PLUGIN_WRONG_MODEL:
splash(HZ*2, true, str(LANG_PLUGIN_WRONG_MODEL));
gui_syncsplash(HZ*2, true, str(LANG_PLUGIN_WRONG_MODEL));
break;
default:
splash(HZ*2, true, str(LANG_PLUGIN_ERROR));
gui_syncsplash(HZ*2, true, str(LANG_PLUGIN_ERROR));
break;
}

View file

@ -814,7 +814,7 @@ bool radio_screen(void)
#ifndef SIMULATOR
if(audio_status() & AUDIO_STATUS_ERROR)
{
splash(0, true, str(LANG_DISK_FULL));
gui_syncsplash(0, true, str(LANG_DISK_FULL));
gui_syncstatusbar_draw(&statusbars,true);
FOR_NB_SCREENS(i)
gui_textarea_update(&screens[i]);
@ -878,7 +878,7 @@ void radio_save_presets(void)
}
else
{
splash(HZ*2, true, str(LANG_FM_PRESET_SAVE_FAILED));
gui_syncsplash(HZ*2, true, str(LANG_FM_PRESET_SAVE_FAILED));
}
}
@ -959,7 +959,7 @@ bool radio_add_preset(void)
}
else
{
splash(HZ*2, true, str(LANG_FM_NO_FREE_PRESETS));
gui_syncsplash(HZ*2, true, str(LANG_FM_NO_FREE_PRESETS));
}
return true;
}

View file

@ -59,7 +59,7 @@
#include "atoi.h"
#include "sound.h"
#include "ata.h"
#include "splash.h"
#ifdef HAVE_RECORDING
@ -228,7 +228,7 @@ int rec_create_directory(void)
rc = mkdir(rec_base_directory, 0);
if(rc < 0 && errno != EEXIST)
{
splash(HZ * 2, true,
gui_syncsplash(HZ * 2, true,
"Can't create the %s directory. Error code %d.",
rec_base_directory, rc);
return -1;
@ -859,7 +859,7 @@ bool recording_screen(void)
#endif
if (audio_stat & AUDIO_STATUS_ERROR)
{
splash(0, true, str(LANG_DISK_FULL));
gui_syncsplash(0, true, str(LANG_DISK_FULL));
status_draw(true);
lcd_update();
audio_error_clear();

View file

@ -47,6 +47,7 @@
#include "sound.h"
#include "abrepeat.h"
#include "wps-display.h"
#include "splash.h"
#if defined(HAVE_LCD_BITMAP)
#include "widgets.h"
#endif
@ -155,7 +156,7 @@ int mmc_remove_request(void)
struct event ev;
lcd_clear_display();
splash(1, true, str(LANG_REMOVE_MMC));
gui_syncsplash(1, true, str(LANG_REMOVE_MMC));
if (global_settings.talk_menu)
talk_id(LANG_REMOVE_MMC, false);
@ -771,175 +772,10 @@ bool quick_screen(int context, int button)
}
#endif
#ifdef HAVE_LCD_BITMAP
#define SPACE 3 /* pixels between words */
#define MAXLETTERS 128 /* 16*8 */
#define MAXLINES 10
#else
#define SPACE 1 /* one letter space */
#undef LCD_WIDTH
#define LCD_WIDTH 11
#undef LCD_HEIGHT
#define LCD_HEIGHT 2
#define MAXLETTERS 22 /* 11 * 2 */
#define MAXLINES 2
#endif
void splash(int ticks, /* how long the splash is displayed */
bool center, /* FALSE means left-justified, TRUE means
horizontal and vertical center */
const char *fmt, /* what to say *printf style */
...)
{
char *next;
char *store=NULL;
int x=0;
int y=0;
int w, h;
unsigned char splash_buf[MAXLETTERS];
va_list ap;
unsigned char widths[MAXLINES];
int line=0;
bool first=true;
#ifdef HAVE_LCD_BITMAP
int maxw=0;
#endif
#ifdef HAVE_LCD_CHARCELLS
lcd_double_height (false);
#endif
va_start( ap, fmt );
vsnprintf( splash_buf, sizeof(splash_buf), fmt, ap );
if(center) {
/* first a pass to measure sizes */
next = strtok_r(splash_buf, " ", &store);
while (next) {
#ifdef HAVE_LCD_BITMAP
lcd_getstringsize(next, &w, &h);
#else
w = strlen(next);
h = 1; /* store height in characters */
#endif
if(!first) {
if(x+w> LCD_WIDTH) {
/* Too wide, wrap */
y+=h;
line++;
if((y > (LCD_HEIGHT-h)) || (line > MAXLINES))
/* STOP */
break;
x=0;
first=true;
}
}
else
first = false;
/* think of it as if the text was written here at position x,y
being w pixels/chars wide and h high */
x += w+SPACE;
widths[line]=x-SPACE; /* don't count the trailing space */
#ifdef HAVE_LCD_BITMAP
/* store the widest line */
if(widths[line]>maxw)
maxw = widths[line];
#endif
next = strtok_r(NULL, " ", &store);
}
#ifdef HAVE_LCD_BITMAP
/* Start displaying the message at position y. The reason for the
added h here is that it isn't added until the end of lines in the
loop above and we always break the loop in the middle of a line. */
y = (LCD_HEIGHT - (y+h) )/2;
#else
y = 0; /* vertical center on 2 lines would be silly */
#endif
first=true;
/* Now recreate the string again since the strtok_r() above has ruined
the one we already have! Here's room for improvements! */
vsnprintf( splash_buf, sizeof(splash_buf), fmt, ap );
}
va_end( ap );
if(center)
{
x = (LCD_WIDTH-widths[0])/2;
if(x < 0)
x = 0;
}
#ifdef HAVE_LCD_BITMAP
/* If we center the display, then just clear the box we need and put
a nice little frame and put the text in there! */
if(center && (y > 2)) {
int xx = (LCD_WIDTH-maxw)/2 - 2;
/* The new graphics routines handle clipping, so no need to check */
#if LCD_DEPTH > 1
lcd_set_background(LCD_LIGHTGRAY);
#endif
lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
lcd_fillrect(xx, y-2, maxw+4, LCD_HEIGHT-y*2+4);
lcd_set_drawmode(DRMODE_SOLID);
lcd_drawrect(xx, y-2, maxw+4, LCD_HEIGHT-y*2+4);
}
else
#endif
lcd_clear_display();
line=0;
next = strtok_r(splash_buf, " ", &store);
while (next) {
#ifdef HAVE_LCD_BITMAP
lcd_getstringsize(next, &w, &h);
#else
w = strlen(next);
h = 1;
#endif
if(!first) {
if(x+w> LCD_WIDTH) {
/* too wide */
y+=h;
line++; /* goto next line */
first=true;
if(y > (LCD_HEIGHT-h))
/* STOP */
break;
if(center) {
x = (LCD_WIDTH-widths[line])/2;
if(x < 0)
x = 0;
}
else
x=0;
}
}
else
first=false;
#ifdef HAVE_LCD_BITMAP
lcd_putsxy(x, y, next);
#else
lcd_puts(x, y, next);
#endif
x += w+SPACE; /* pixels space! */
next = strtok_r(NULL, " ", &store);
}
#if LCD_DEPTH > 1
lcd_set_background(LCD_WHITE);
#endif
lcd_update();
if(ticks)
/* unbreakable! */
sleep(ticks);
}
#if defined(HAVE_CHARGING) || defined(SIMULATOR)
void charging_splash(void)
{
splash(2*HZ, true, str(LANG_BATTERY_CHARGE));
gui_syncsplash(2*HZ, true, str(LANG_BATTERY_CHARGE));
button_clear_queue();
}
#endif
@ -1254,7 +1090,7 @@ bool shutdown_screen(void)
lcd_stop_scroll();
splash(0, true, str(LANG_CONFIRM_SHUTDOWN));
gui_syncsplash(0, true, str(LANG_CONFIRM_SHUTDOWN));
while(!done)
{

View file

@ -43,12 +43,6 @@ bool quick_screen(const int, const int);
/* Long press already detected so not needed here */
#endif
void splash(int ticks, /* how long */
bool center, /* FALSE means left-justified, TRUE means
horizontal and vertical center */
const char *fmt, /* what to say *printf style */
...);
#ifdef HAVE_RTC
bool set_time_screen(const char* string, struct tm *tm);
#endif

View file

@ -51,6 +51,7 @@
#include "database.h"
#include "dir.h"
#include "dircache.h"
#include "splash.h"
#ifdef HAVE_LCD_BITMAP
#include "peakmeter.h"
@ -1337,7 +1338,7 @@ static bool dircache(void)
NULL);
if (!dircache_is_enabled() && global_settings.dircache)
splash(HZ*2, true, str(LANG_DIRCACHE_REBOOT));
gui_syncsplash(HZ*2, true, str(LANG_DIRCACHE_REBOOT));
if (!result)
dircache_disable();

View file

@ -42,6 +42,7 @@
#include "peakmeter.h"
#include "mas.h"
#endif
#include "splash.h"
int selected_setting; /* Used by the callback */
void dec_sound_formatter(char *buffer, int buffer_size, int val, const char * unit)
@ -610,7 +611,7 @@ bool rectrigger(void)
switch (button) {
case TRIG_CANCEL:
splash(50, true, str(LANG_RESET_DONE_CANCEL));
gui_syncsplash(50, true, str(LANG_RESET_DONE_CANCEL));
global_settings.rec_start_thres = old_start_thres;
global_settings.rec_start_duration = old_start_duration;
global_settings.rec_prerecord_time = old_prerecord_time;

View file

@ -47,7 +47,7 @@
#include "button.h"
#include "abrepeat.h"
#include "screens.h"
#include "splash.h"
#ifdef HAVE_LCD_BITMAP
#include <ctype.h>
#include "icons.h"
@ -1622,10 +1622,10 @@ bool wps_display(struct mp3entry* id3,
{
global_settings.resume_index = -1;
#ifdef HAVE_LCD_CHARCELLS
splash(HZ, true, str(LANG_END_PLAYLIST_PLAYER));
gui_syncsplash(HZ, true, str(LANG_END_PLAYLIST_PLAYER));
#else
status_draw(true);
splash(HZ, true, str(LANG_END_PLAYLIST_RECORDER));
gui_syncsplash(HZ, true, str(LANG_END_PLAYLIST_RECORDER));
#endif
return true;
}

View file

@ -80,7 +80,7 @@ static bool setvol(void)
wps_refresh(id3, nid3, 0, WPS_REFRESH_NON_STATIC);
settings_save();
#ifdef HAVE_LCD_CHARCELLS
splash(0, false, "Vol: %d %% ",
gui_syncsplash(0, false, "Vol: %d %% ",
sound_val2phys(SOUND_VOLUME, global_settings.volume));
return true;
#endif
@ -315,7 +315,7 @@ static void display_keylock_text(bool locked)
else
s = str(LANG_KEYLOCK_OFF_RECORDER);
#endif
splash(HZ, true, s);
gui_syncsplash(HZ, true, s);
}
static void waitfor_nokey(void)