From 1afa395c2fe08ed937dbb0624ade48e46be87efe Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 8 Jan 2004 09:58:58 +0000 Subject: The splash() function's second argument (keymask) is now removed, as it was not used by any code. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4201 a1c6a512-1295-4272-9138-f99709370657 --- apps/onplay.c | 6 +++--- apps/playlist.c | 50 ++++++++++++++++++++++--------------------- apps/playlist_viewer.c | 6 +++--- apps/plugin.c | 16 +++++++------- apps/plugin.h | 2 +- apps/plugins/clock.c | 10 ++++----- apps/plugins/favorites.c | 4 ++-- apps/plugins/firmware_flash.c | 14 ++++++------ apps/plugins/helloworld.c | 2 +- apps/plugins/rockbox_flash.c | 12 +++++------ apps/plugins/sokoban.c | 4 ++-- apps/plugins/video.c | 2 +- apps/plugins/viewer.c | 36 ++++++++++++++++++------------- apps/recorder/recording.c | 2 +- apps/screens.c | 22 +++++-------------- apps/screens.h | 1 - apps/tree.c | 4 ++-- apps/wps.c | 2 +- 18 files changed, 95 insertions(+), 100 deletions(-) diff --git a/apps/onplay.c b/apps/onplay.c index 7598aa3125..3e085cea59 100644 --- a/apps/onplay.c +++ b/apps/onplay.c @@ -330,7 +330,7 @@ static int insert_data_in_file(char *fname, int fpos, char *buf, int num_bytes) static void fileerror(int rc) { - splash(HZ*2, 0, true, "File error: %d", rc); + splash(HZ*2, true, "File error: %d", rc); } static const unsigned char empty_id3_header[] = @@ -352,7 +352,7 @@ static bool vbr_fix(void) int unused_space; if(mpeg_status()) { - splash(HZ*2, 0, true, str(LANG_VBRFIX_STOP_PLAY)); + splash(HZ*2, true, str(LANG_VBRFIX_STOP_PLAY)); return onplay_result; } @@ -473,7 +473,7 @@ static bool vbr_fix(void) { /* Not a VBR file */ DEBUGF("Not a VBR file\n"); - splash(HZ*2, 0, true, str(LANG_VBRFIX_NOT_VBR)); + splash(HZ*2, true, str(LANG_VBRFIX_NOT_VBR)); } return false; diff --git a/apps/playlist.c b/apps/playlist.c index 31e3040b60..1b6c65245d 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -238,7 +238,7 @@ static int add_indices_to_playlist(void) lcd_setmargins(0, 0); #endif - splash(0, 0, true, str(LANG_PLAYLIST_LOAD)); + splash(0, true, str(LANG_PLAYLIST_LOAD)); /* use mp3 buffer for maximum load speed */ buflen = (mp3end - mp3buf); @@ -404,7 +404,7 @@ static int add_track_to_playlist(char *filename, int position, bool queue, if (result < 0) { - splash(HZ*2, 0, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR)); + splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR)); return result; } } @@ -437,7 +437,7 @@ static int add_directory_to_playlist(char *dirname, int *position, bool queue, if(!files) { - splash(HZ*2, 0, true, str(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR)); + splash(HZ*2, true, str(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR)); return 0; } @@ -578,7 +578,7 @@ static int remove_track_from_playlist(int position, bool write) if (result < 0) { - splash(HZ*2, 0, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR)); + splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR)); return result; } } @@ -824,10 +824,10 @@ static int get_filename(int seek, bool control_file, char *buf, if (max < 0) { if (control_file) - splash(HZ*2, 0, true, + splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); else - splash(HZ*2, 0, true, str(LANG_PLAYLIST_ACCESS_ERROR)); + splash(HZ*2, true, str(LANG_PLAYLIST_ACCESS_ERROR)); return max; } @@ -919,11 +919,13 @@ static void display_playlist_count(int count, char *fmt) lcd_setmargins(0, 0); #endif + splash(0, true, fmt, count, #ifdef HAVE_PLAYER_KEYPAD - splash(0, 0, true, fmt, count, str(LANG_STOP_ABORT)); + str(LANG_STOP_ABORT) #else - splash(0, 0, true, fmt, count, str(LANG_OFF_ABORT)); + str(LANG_OFF_ABORT) #endif + ); } /* @@ -981,7 +983,7 @@ static int flush_pending_control(void) if (result < 0) { - splash(HZ*2, 0, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR)); + splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR)); return result; } } @@ -1026,7 +1028,7 @@ int playlist_create(char *dir, char *file) playlist.control_fd = open(PLAYLIST_CONTROL_FILE, O_RDWR); if (playlist.control_fd < 0) - splash(HZ*2, 0, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); + splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); if (!file) { @@ -1046,7 +1048,7 @@ int playlist_create(char *dir, char *file) PLAYLIST_CONTROL_FILE_VERSION, dir, file) > 0) fsync(playlist.control_fd); else - splash(HZ*2, 0, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR)); + splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_UPDATE_ERROR)); } /* load the playlist file */ @@ -1091,7 +1093,7 @@ int playlist_resume(void) playlist.control_fd = open(PLAYLIST_CONTROL_FILE, O_RDWR); if (playlist.control_fd < 0) { - splash(HZ*2, 0, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); + splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); return -1; } @@ -1100,7 +1102,7 @@ int playlist_resume(void) PLAYLIST_COMMAND_SIZEsplash(HZ, 0, true, "Setting save failed"); + rb->splash(HZ, true, "Setting save failed"); } } @@ -83,7 +83,7 @@ void load_settings(void) /* Else, loading failed */ else { - rb->splash(HZ, 0, true, "Setting load failed, using default settings."); + rb->splash(HZ, true, "Setting load failed, using default settings."); } } @@ -121,7 +121,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) load_settings(); rb->lcd_clear_display(); - rb->splash(HZ, 0, true, "F1 for INFO"); + rb->splash(HZ, true, "F1 for INFO"); while (!PLUGIN_OK) { @@ -324,11 +324,11 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) /* Tell the user what's going on */ rb->lcd_clear_display(); - rb->splash(HZ/2, 0, true, "Saving settings..."); + rb->splash(HZ/2, true, "Saving settings..."); /* Save to disk */ save_settings(); rb->lcd_clear_display(); - rb->splash(HZ, 0, true, "Saved!"); + rb->splash(HZ, true, "Saved!"); /* ...and exit. */ return PLUGIN_OK; break; diff --git a/apps/plugins/favorites.c b/apps/plugins/favorites.c index 3ee597e3ef..949eeeae31 100644 --- a/apps/plugins/favorites.c +++ b/apps/plugins/favorites.c @@ -22,7 +22,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) id3 = rb->mpeg_current_track(); if (!id3) { - rb->splash(HZ*2, 0, true, "Nothing To Save"); + rb->splash(HZ*2, true, "Nothing To Save"); return PLUGIN_OK; } @@ -45,7 +45,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) rb->close(fd); } - rb->splash(HZ*2, 0, true, "Saved Favorite"); + rb->splash(HZ*2, true, "Saved Favorite"); return PLUGIN_OK; } diff --git a/apps/plugins/firmware_flash.c b/apps/plugins/firmware_flash.c index c609f5ddad..c146b34544 100644 --- a/apps/plugins/firmware_flash.c +++ b/apps/plugins/firmware_flash.c @@ -611,7 +611,7 @@ void DoUserDialog(char* filename) /* test if the user is running the correct plugin for this box */ if (!CheckPlatform(PLATFORM_ID, *(UINT16*)(FB + VERSION_ADR))) { - rb->splash(HZ*3, 0, true, "Wrong plugin"); + rb->splash(HZ*3, true, "Wrong plugin"); return; /* exit */ } @@ -619,7 +619,7 @@ void DoUserDialog(char* filename) result = CheckBootROM(); if (result == eUnknown) { /* no support for any other yet */ - rb->splash(HZ*3, 0, true, "Wrong boot ROM"); + rb->splash(HZ*3, true, "Wrong boot ROM"); return; /* exit */ } is_romless = (result == eROMless); @@ -640,7 +640,7 @@ void DoUserDialog(char* filename) sector = rb->plugin_get_buffer(&memleft); if (memleft < SEC_SIZE) /* need buffer for a flash sector */ { - rb->splash(HZ*3, 0, true, "Out of memory"); + rb->splash(HZ*3, true, "Out of memory"); return; /* exit */ } @@ -648,7 +648,7 @@ void DoUserDialog(char* filename) ShowFlashInfo(&FlashInfo); if (FlashInfo.size == 0) /* no valid chip */ { - rb->splash(HZ*3, 0, true, "Sorry!"); + rb->splash(HZ*3, true, "Sorry!"); return; /* exit */ } @@ -832,7 +832,7 @@ void DoUserDialog(char* filename) /* test if the user is running the correct plugin for this box */ if (!CheckPlatform(PLATFORM_ID, *(UINT16*)(FB + VERSION_ADR))) { - rb->splash(HZ*3, 0, true, "Wrong version"); + rb->splash(HZ*3, true, "Wrong version"); return; /* exit */ } @@ -840,7 +840,7 @@ void DoUserDialog(char* filename) result = CheckBootROM(); if (result == eUnknown) { /* no support for any other yet */ - rb->splash(HZ*3, 0, true, "Wrong boot ROM"); + rb->splash(HZ*3, true, "Wrong boot ROM"); return; /* exit */ } is_romless = (result == eROMless); @@ -861,7 +861,7 @@ void DoUserDialog(char* filename) sector = rb->plugin_get_buffer(&memleft); if (memleft < SEC_SIZE) /* need buffer for a flash sector */ { - rb->splash(HZ*3, 0, true, "Out of memory"); + rb->splash(HZ*3, true, "Out of memory"); return; /* exit */ } diff --git a/apps/plugins/helloworld.c b/apps/plugins/helloworld.c index ea347fbf79..d0fecba169 100644 --- a/apps/plugins/helloworld.c +++ b/apps/plugins/helloworld.c @@ -42,7 +42,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) rb = api; /* now go ahead and have fun! */ - rb->splash(HZ*2, 0, true, "Hello world!"); + rb->splash(HZ*2, true, "Hello world!"); return PLUGIN_OK; } diff --git a/apps/plugins/rockbox_flash.c b/apps/plugins/rockbox_flash.c index 9dc4b3a663..661203b8b8 100644 --- a/apps/plugins/rockbox_flash.c +++ b/apps/plugins/rockbox_flash.c @@ -525,7 +525,7 @@ void DoUserDialog(char* filename, bool show_greet) sector = rb->plugin_get_buffer(&memleft); if (memleft < SECTORSIZE) /* need buffer for a flash sector */ { - rb->splash(HZ*3, 0, true, "Out of memory"); + rb->splash(HZ*3, true, "Out of memory"); return; /* exit */ } @@ -537,12 +537,12 @@ void DoUserDialog(char* filename, bool show_greet) if (FlashInfo.size == 0) /* no valid chip */ { - rb->splash(HZ*3, 0, true, "Not flashable"); + rb->splash(HZ*3, true, "Not flashable"); return; /* exit */ } else if (pos == 0) { - rb->splash(HZ*3, 0, true, "No image"); + rb->splash(HZ*3, true, "No image"); return; /* exit */ } @@ -701,7 +701,7 @@ void DoUserDialog(char* filename, bool show_greet) sector = rb->plugin_get_buffer(&memleft); if (memleft < SECTORSIZE) /* need buffer for a flash sector */ { - rb->splash(HZ*3, 0, true, "Out of memory"); + rb->splash(HZ*3, true, "Out of memory"); return; /* exit */ } @@ -716,12 +716,12 @@ void DoUserDialog(char* filename, bool show_greet) if (FlashInfo.size == 0) /* no valid chip */ { - rb->splash(HZ*3, 0, true, "Not flashable"); + rb->splash(HZ*3, true, "Not flashable"); return; /* exit */ } else if (pos == 0) { - rb->splash(HZ*3, 0, true, "No image"); + rb->splash(HZ*3, true, "No image"); return; /* exit */ } diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c index 2387fa9517..47ae64c18f 100644 --- a/apps/plugins/sokoban.c +++ b/apps/plugins/sokoban.c @@ -241,7 +241,7 @@ static int get_level_count(void) char buffer[COLS + 3]; /* COLS plus CR/LF and \0 */ if ((fd = rb->open(LEVELS_FILE, O_RDONLY)) < 0) { - rb->splash(0, 0, true, "Unable to open %s", LEVELS_FILE); + rb->splash(0, true, "Unable to open %s", LEVELS_FILE); return -1; } @@ -858,7 +858,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) init_boards(); if (get_level_count() != 0) { - rb->splash(HZ*2,0,true,"Failed loading levels!"); + rb->splash(HZ*2, true, "Failed loading levels!"); return PLUGIN_OK; } diff --git a/apps/plugins/video.c b/apps/plugins/video.c index 5620253d59..c07519ed3d 100644 --- a/apps/plugins/video.c +++ b/apps/plugins/video.c @@ -340,7 +340,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) if (parameter == NULL) { - rb->splash(HZ*2, 0, true, "Play .rvf file!"); + rb->splash(HZ*2, true, "Play .rvf file!"); return PLUGIN_ERROR; } diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c index 6f2c5840fd..d8d6b516bd 100644 --- a/apps/plugins/viewer.c +++ b/apps/plugins/viewer.c @@ -662,8 +662,9 @@ static int viewer_recorder_on_button(int col) if (++page_mode == PAGE_MODES) page_mode = 0; - rb->splash(HZ, 0, true, "%s %s", - page_mode_str[page_mode], page_mode_str[PAGE_MODES]); + rb->splash(HZ, true, "%s %s", + page_mode_str[page_mode], + page_mode_str[PAGE_MODES]); viewer_draw(col); break; @@ -677,10 +678,11 @@ static int viewer_recorder_on_button(int col) init_need_scrollbar(); viewer_draw(col); - rb->splash(HZ, 0, true, "%s %s (%s %s)", - scrollbar_mode_str[SCROLLBAR_MODES], - scrollbar_mode_str[scrollbar_mode[view_mode]], - view_mode_str[view_mode], view_mode_str[VIEW_MODES]); + rb->splash(HZ, true, "%s %s (%s %s)", + scrollbar_mode_str[SCROLLBAR_MODES], + scrollbar_mode_str[scrollbar_mode[view_mode]], + view_mode_str[view_mode], + view_mode_str[VIEW_MODES]); } viewer_draw(col); break; @@ -744,7 +746,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file) ok = viewer_init(file); if (!ok) { - rb->splash(HZ, 0, false, "Error"); + rb->splash(HZ, false, "Error"); viewer_exit(); return PLUGIN_OK; } @@ -776,8 +778,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file) #endif viewer_draw(col); - rb->splash(HZ, 0, true, "%s %s", - word_mode_str[word_mode], word_mode_str[WORD_MODES]); + rb->splash(HZ, true, "%s %s", + word_mode_str[word_mode], + word_mode_str[WORD_MODES]); viewer_draw(col); break; @@ -801,8 +804,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file) #endif viewer_draw(col); - rb->splash(HZ, 0, true, "%s %s", - line_mode_str[line_mode], line_mode_str[LINE_MODES]); + rb->splash(HZ, true, "%s %s", + line_mode_str[line_mode], + line_mode_str[LINE_MODES]); viewer_draw(col); break; @@ -814,8 +818,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file) #endif /* View-width mode: NARROW or WIDE */ if (line_mode == JOIN) - rb->splash(HZ, 0, true, "(no %s %s)", - view_mode_str[WIDE], line_mode_str[JOIN]); + rb->splash(HZ, true, "(no %s %s)", + view_mode_str[WIDE], + line_mode_str[JOIN]); else if (++view_mode == VIEW_MODES) view_mode = 0; @@ -840,8 +845,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file) #endif viewer_draw(col); - rb->splash(HZ, 0, true, "%s %s", - view_mode_str[view_mode], view_mode_str[VIEW_MODES]); + rb->splash(HZ, true, "%s %s", + view_mode_str[view_mode], + view_mode_str[VIEW_MODES]); viewer_draw(col); break; diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index c1a5f96ab6..b98a4579f7 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -504,7 +504,7 @@ bool recording_screen(void) if(mpeg_status() & MPEG_STATUS_ERROR) { status_set_playmode(STATUS_STOP); - splash(0, 0, true, str(LANG_DISK_FULL)); + splash(0, true, str(LANG_DISK_FULL)); status_draw(true); lcd_update(); mpeg_error_clear(); diff --git a/apps/screens.c b/apps/screens.c index 1b269d93bc..c2ffb44f3c 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -673,8 +673,7 @@ bool f3_screen(void) #define MAXLINES 2 #endif -void splash(int ticks, /* how long */ - int keymask, /* what keymask aborts the waiting (if any) */ +void splash(int ticks, /* how long the splash is displayed */ bool center, /* FALSE means left-justified, TRUE means horizontal and vertical center */ char *fmt, /* what to say *printf style */ @@ -813,24 +812,13 @@ void splash(int ticks, /* how long */ } lcd_update(); - if(ticks) { - if(keymask) { - int start = current_tick; - int done = ticks + current_tick + 1; - while (TIME_BEFORE( current_tick, done)) { - int button = button_get_w_tmo(ticks - (current_tick-start)); - if((button & keymask) == keymask) - break; - } - } - else - /* unbreakable! */ - sleep(ticks); - } + if(ticks) + /* unbreakable! */ + sleep(ticks); } void charging_splash(void) { - splash(2*HZ, 0, true, str(LANG_BATTERY_CHARGE)); + splash(2*HZ, true, str(LANG_BATTERY_CHARGE)); while (button_get(false)); } diff --git a/apps/screens.h b/apps/screens.h index 89bd3c39d8..fdd5df1c68 100644 --- a/apps/screens.h +++ b/apps/screens.h @@ -31,7 +31,6 @@ bool f3_screen(void); #endif void splash(int ticks, /* how long */ - int keymask,/* what keymask aborts the waiting (if any) */ bool center, /* FALSE means left-justified, TRUE means horizontal and vertical center */ char *fmt, /* what to say *printf style */ diff --git a/apps/tree.c b/apps/tree.c index a016aff05a..3c9827d685 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -861,7 +861,7 @@ static bool dirbrowse(char *root, int *dirfilter) if (*dirfilter > NUM_FILTER_MODES && numentries==0) { - splash(HZ*2, 0, true, str(LANG_NO_FILES)); + splash(HZ*2, true, str(LANG_NO_FILES)); return false; /* No files found for rockbox_browser() */ } @@ -1060,7 +1060,7 @@ static bool dirbrowse(char *root, int *dirfilter) if(!lang_load(buf)) { set_file(buf, global_settings.lang_file, MAX_FILENAME); - splash(HZ, 0, true, str(LANG_LANGUAGE_LOADED)); + splash(HZ, true, str(LANG_LANGUAGE_LOADED)); restore = true; } break; diff --git a/apps/wps.c b/apps/wps.c index 9e988d3721..777894d535 100644 --- a/apps/wps.c +++ b/apps/wps.c @@ -125,7 +125,7 @@ void display_keylock_text(bool locked) else s = str(LANG_KEYLOCK_OFF_RECORDER); #endif - splash(HZ, 0, true, s); + splash(HZ, true, s); } void display_mute_text(bool muted) -- cgit v1.2.3