diff options
author | Bertrik Sikken <bertrik@sikken.nl> | 2011-12-28 11:32:13 +0000 |
---|---|---|
committer | Bertrik Sikken <bertrik@sikken.nl> | 2011-12-28 11:32:13 +0000 |
commit | d2cdd80f5cceb38f9add911f289d566f85a4c186 (patch) | |
tree | b125f4b3eb73562668a3299714f20490237d8b4b /apps/plugins/pictureflow/pictureflow.c | |
parent | 7949dd4daebe7f058839ecc22f653ee38064d97f (diff) | |
download | rockbox-d2cdd80f5cceb38f9add911f289d566f85a4c186.tar.gz rockbox-d2cdd80f5cceb38f9add911f289d566f85a4c186.zip |
plugins: another round of making local things static and adding missing #includes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31453 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/pictureflow/pictureflow.c')
-rw-r--r-- | apps/plugins/pictureflow/pictureflow.c | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c index ee92ab8737..1b9683460e 100644 --- a/apps/plugins/pictureflow/pictureflow.c +++ b/apps/plugins/pictureflow/pictureflow.c | |||
@@ -808,7 +808,7 @@ static void update_scroll_lines(void) | |||
808 | } | 808 | } |
809 | 809 | ||
810 | /* Create the lookup table with the scaling values for the reflections */ | 810 | /* Create the lookup table with the scaling values for the reflections */ |
811 | void init_reflect_table(void) | 811 | static void init_reflect_table(void) |
812 | { | 812 | { |
813 | int i; | 813 | int i; |
814 | for (i = 0; i < REFLECT_HEIGHT; i++) | 814 | for (i = 0; i < REFLECT_HEIGHT; i++) |
@@ -821,7 +821,7 @@ void init_reflect_table(void) | |||
821 | Create an index of all albums from the database. | 821 | Create an index of all albums from the database. |
822 | Also store the album names so we can access them later. | 822 | Also store the album names so we can access them later. |
823 | */ | 823 | */ |
824 | int create_album_index(void) | 824 | static int create_album_index(void) |
825 | { | 825 | { |
826 | album = ((struct album_data *)(buf_size + (char *) buf)) - 1; | 826 | album = ((struct album_data *)(buf_size + (char *) buf)) - 1; |
827 | rb->memset(&tcs, 0, sizeof(struct tagcache_search) ); | 827 | rb->memset(&tcs, 0, sizeof(struct tagcache_search) ); |
@@ -860,7 +860,7 @@ int create_album_index(void) | |||
860 | /** | 860 | /** |
861 | Return a pointer to the album name of the given slide_index | 861 | Return a pointer to the album name of the given slide_index |
862 | */ | 862 | */ |
863 | char* get_album_name(const int slide_index) | 863 | static char* get_album_name(const int slide_index) |
864 | { | 864 | { |
865 | return album_names + album[slide_index].name_idx; | 865 | return album_names + album[slide_index].name_idx; |
866 | } | 866 | } |
@@ -869,14 +869,14 @@ char* get_album_name(const int slide_index) | |||
869 | Return a pointer to the track name of the active album | 869 | Return a pointer to the track name of the active album |
870 | create_track_index has to be called first. | 870 | create_track_index has to be called first. |
871 | */ | 871 | */ |
872 | char* get_track_name(const int track_index) | 872 | static char* get_track_name(const int track_index) |
873 | { | 873 | { |
874 | if ( track_index < track_count ) | 874 | if ( track_index < track_count ) |
875 | return track_names + tracks[track_index].name_idx; | 875 | return track_names + tracks[track_index].name_idx; |
876 | return 0; | 876 | return 0; |
877 | } | 877 | } |
878 | #if PF_PLAYBACK_CAPABLE | 878 | #if PF_PLAYBACK_CAPABLE |
879 | char* get_track_filename(const int track_index) | 879 | static char* get_track_filename(const int track_index) |
880 | { | 880 | { |
881 | if ( track_index < track_count ) | 881 | if ( track_index < track_count ) |
882 | return track_names + tracks[track_index].filename_idx; | 882 | return track_names + tracks[track_index].filename_idx; |
@@ -884,7 +884,7 @@ char* get_track_filename(const int track_index) | |||
884 | } | 884 | } |
885 | #endif | 885 | #endif |
886 | 886 | ||
887 | int get_wps_current_index(void) | 887 | static int get_wps_current_index(void) |
888 | { | 888 | { |
889 | struct mp3entry *id3 = rb->audio_current_track(); | 889 | struct mp3entry *id3 = rb->audio_current_track(); |
890 | if(id3 && id3->album) { | 890 | if(id3 && id3->album) { |
@@ -901,7 +901,7 @@ int get_wps_current_index(void) | |||
901 | /** | 901 | /** |
902 | Compare two unsigned ints passed via pointers. | 902 | Compare two unsigned ints passed via pointers. |
903 | */ | 903 | */ |
904 | int compare_tracks (const void *a_v, const void *b_v) | 904 | static int compare_tracks (const void *a_v, const void *b_v) |
905 | { | 905 | { |
906 | uint32_t a = ((struct track_data *)a_v)->sort; | 906 | uint32_t a = ((struct track_data *)a_v)->sort; |
907 | uint32_t b = ((struct track_data *)b_v)->sort; | 907 | uint32_t b = ((struct track_data *)b_v)->sort; |
@@ -911,7 +911,7 @@ int compare_tracks (const void *a_v, const void *b_v) | |||
911 | /** | 911 | /** |
912 | Create the track index of the given slide_index. | 912 | Create the track index of the given slide_index. |
913 | */ | 913 | */ |
914 | void create_track_index(const int slide_index) | 914 | static void create_track_index(const int slide_index) |
915 | { | 915 | { |
916 | if ( slide_index == track_index ) | 916 | if ( slide_index == track_index ) |
917 | return; | 917 | return; |
@@ -1022,7 +1022,7 @@ fail: | |||
1022 | The algorithm looks for the first track of the given album uses | 1022 | The algorithm looks for the first track of the given album uses |
1023 | find_albumart to find the filename. | 1023 | find_albumart to find the filename. |
1024 | */ | 1024 | */ |
1025 | bool get_albumart_for_index_from_db(const int slide_index, char *buf, | 1025 | static bool get_albumart_for_index_from_db(const int slide_index, char *buf, |
1026 | int buflen) | 1026 | int buflen) |
1027 | { | 1027 | { |
1028 | if ( slide_index == -1 ) | 1028 | if ( slide_index == -1 ) |
@@ -1069,7 +1069,7 @@ bool get_albumart_for_index_from_db(const int slide_index, char *buf, | |||
1069 | /** | 1069 | /** |
1070 | Draw the PictureFlow logo | 1070 | Draw the PictureFlow logo |
1071 | */ | 1071 | */ |
1072 | void draw_splashscreen(void) | 1072 | static void draw_splashscreen(void) |
1073 | { | 1073 | { |
1074 | unsigned char * buf_tmp = buf; | 1074 | unsigned char * buf_tmp = buf; |
1075 | size_t buf_tmp_size = buf_size; | 1075 | size_t buf_tmp_size = buf_size; |
@@ -1116,7 +1116,7 @@ void draw_splashscreen(void) | |||
1116 | /** | 1116 | /** |
1117 | Draw a simple progress bar | 1117 | Draw a simple progress bar |
1118 | */ | 1118 | */ |
1119 | void draw_progressbar(int step) | 1119 | static void draw_progressbar(int step) |
1120 | { | 1120 | { |
1121 | int txt_w, txt_h; | 1121 | int txt_w, txt_h; |
1122 | const int bar_height = 22; | 1122 | const int bar_height = 22; |
@@ -1149,7 +1149,7 @@ void draw_progressbar(int step) | |||
1149 | /* Calculate modified FNV hash of string | 1149 | /* Calculate modified FNV hash of string |
1150 | * has good avalanche behaviour and uniform distribution | 1150 | * has good avalanche behaviour and uniform distribution |
1151 | * see http://home.comcast.net/~bretm/hash/ */ | 1151 | * see http://home.comcast.net/~bretm/hash/ */ |
1152 | unsigned int mfnv(char *str) | 1152 | static unsigned int mfnv(char *str) |
1153 | { | 1153 | { |
1154 | const unsigned int p = 16777619; | 1154 | const unsigned int p = 16777619; |
1155 | unsigned int hash = 0x811C9DC5; // 2166136261; | 1155 | unsigned int hash = 0x811C9DC5; // 2166136261; |
@@ -1167,7 +1167,7 @@ unsigned int mfnv(char *str) | |||
1167 | /** | 1167 | /** |
1168 | Save the given bitmap as filename in the pfraw format | 1168 | Save the given bitmap as filename in the pfraw format |
1169 | */ | 1169 | */ |
1170 | bool save_pfraw(char* filename, struct bitmap *bm) | 1170 | static bool save_pfraw(char* filename, struct bitmap *bm) |
1171 | { | 1171 | { |
1172 | struct pfraw_header bmph; | 1172 | struct pfraw_header bmph; |
1173 | bmph.width = bm->width; | 1173 | bmph.width = bm->width; |
@@ -1190,7 +1190,7 @@ bool save_pfraw(char* filename, struct bitmap *bm) | |||
1190 | Precomupte the album art images and store them in CACHE_PREFIX. | 1190 | Precomupte the album art images and store them in CACHE_PREFIX. |
1191 | Use the "?" bitmap if image is not found. | 1191 | Use the "?" bitmap if image is not found. |
1192 | */ | 1192 | */ |
1193 | bool create_albumart_cache(void) | 1193 | static bool create_albumart_cache(void) |
1194 | { | 1194 | { |
1195 | int ret; | 1195 | int ret; |
1196 | 1196 | ||
@@ -1254,7 +1254,7 @@ bool create_albumart_cache(void) | |||
1254 | Create the "?" slide, that is shown while loading | 1254 | Create the "?" slide, that is shown while loading |
1255 | or when no cover was found. | 1255 | or when no cover was found. |
1256 | */ | 1256 | */ |
1257 | int create_empty_slide(bool force) | 1257 | static int create_empty_slide(bool force) |
1258 | { | 1258 | { |
1259 | if ( force || ! rb->file_exists( EMPTY_SLIDE ) ) { | 1259 | if ( force || ! rb->file_exists( EMPTY_SLIDE ) ) { |
1260 | struct bitmap input_bmp; | 1260 | struct bitmap input_bmp; |
@@ -1278,7 +1278,7 @@ int create_empty_slide(bool force) | |||
1278 | /** | 1278 | /** |
1279 | Thread used for loading and preparing bitmaps in the background | 1279 | Thread used for loading and preparing bitmaps in the background |
1280 | */ | 1280 | */ |
1281 | void thread(void) | 1281 | static void thread(void) |
1282 | { | 1282 | { |
1283 | long sleep_time = 5 * HZ; | 1283 | long sleep_time = 5 * HZ; |
1284 | struct queue_event ev; | 1284 | struct queue_event ev; |
@@ -1306,7 +1306,7 @@ void thread(void) | |||
1306 | /** | 1306 | /** |
1307 | End the thread by posting the EV_EXIT event | 1307 | End the thread by posting the EV_EXIT event |
1308 | */ | 1308 | */ |
1309 | void end_pf_thread(void) | 1309 | static void end_pf_thread(void) |
1310 | { | 1310 | { |
1311 | if ( thread_is_running ) { | 1311 | if ( thread_is_running ) { |
1312 | rb->queue_post(&thread_q, EV_EXIT, 0); | 1312 | rb->queue_post(&thread_q, EV_EXIT, 0); |
@@ -1321,7 +1321,7 @@ void end_pf_thread(void) | |||
1321 | /** | 1321 | /** |
1322 | Create the thread an setup the event queue | 1322 | Create the thread an setup the event queue |
1323 | */ | 1323 | */ |
1324 | bool create_pf_thread(void) | 1324 | static bool create_pf_thread(void) |
1325 | { | 1325 | { |
1326 | /* put the thread's queue in the bcast list */ | 1326 | /* put the thread's queue in the bcast list */ |
1327 | rb->queue_init(&thread_q, true); | 1327 | rb->queue_init(&thread_q, true); |
@@ -1507,7 +1507,7 @@ static bool free_slide_prio(int prio) | |||
1507 | /** | 1507 | /** |
1508 | Read the pfraw image given as filename and return the hid of the buffer | 1508 | Read the pfraw image given as filename and return the hid of the buffer |
1509 | */ | 1509 | */ |
1510 | int read_pfraw(char* filename, int prio) | 1510 | static int read_pfraw(char* filename, int prio) |
1511 | { | 1511 | { |
1512 | struct pfraw_header bmph; | 1512 | struct pfraw_header bmph; |
1513 | int fh = rb->open(filename, O_RDONLY); | 1513 | int fh = rb->open(filename, O_RDONLY); |
@@ -1727,7 +1727,7 @@ static inline struct dim *surface(const int slide_index) | |||
1727 | /** | 1727 | /** |
1728 | adjust slides so that they are in "steady state" position | 1728 | adjust slides so that they are in "steady state" position |
1729 | */ | 1729 | */ |
1730 | void reset_slides(void) | 1730 | static void reset_slides(void) |
1731 | { | 1731 | { |
1732 | center_slide.angle = 0; | 1732 | center_slide.angle = 0; |
1733 | center_slide.cx = 0; | 1733 | center_slide.cx = 0; |
@@ -1768,7 +1768,7 @@ void reset_slides(void) | |||
1768 | * z | 1768 | * z |
1769 | * TODO: support moving the side slides toward or away from the camera | 1769 | * TODO: support moving the side slides toward or away from the camera |
1770 | */ | 1770 | */ |
1771 | void recalc_offsets(void) | 1771 | static void recalc_offsets(void) |
1772 | { | 1772 | { |
1773 | PFreal xs = PFREAL_HALF - DISPLAY_WIDTH * PFREAL_HALF; | 1773 | PFreal xs = PFREAL_HALF - DISPLAY_WIDTH * PFREAL_HALF; |
1774 | PFreal zo; | 1774 | PFreal zo; |
@@ -1844,7 +1844,7 @@ static inline unsigned fade_color(pix_t c, unsigned a) | |||
1844 | * optimized by saving the numerator and denominator of the fraction, which can | 1844 | * optimized by saving the numerator and denominator of the fraction, which can |
1845 | * then be incremented by (z + zo) and sin(r) respectively. | 1845 | * then be incremented by (z + zo) and sin(r) respectively. |
1846 | */ | 1846 | */ |
1847 | void render_slide(struct slide_data *slide, const int alpha) | 1847 | static void render_slide(struct slide_data *slide, const int alpha) |
1848 | { | 1848 | { |
1849 | struct dim *bmp = surface(slide->slide_index); | 1849 | struct dim *bmp = surface(slide->slide_index); |
1850 | if (!bmp) { | 1850 | if (!bmp) { |
@@ -1989,7 +1989,7 @@ static inline void set_current_slide(const int slide_index) | |||
1989 | /** | 1989 | /** |
1990 | Start the animation for changing slides | 1990 | Start the animation for changing slides |
1991 | */ | 1991 | */ |
1992 | void start_animation(void) | 1992 | static void start_animation(void) |
1993 | { | 1993 | { |
1994 | step = (target < center_slide.slide_index) ? -1 : 1; | 1994 | step = (target < center_slide.slide_index) ? -1 : 1; |
1995 | pf_state = pf_scrolling; | 1995 | pf_state = pf_scrolling; |
@@ -1998,7 +1998,7 @@ void start_animation(void) | |||
1998 | /** | 1998 | /** |
1999 | Go to the previous slide | 1999 | Go to the previous slide |
2000 | */ | 2000 | */ |
2001 | void show_previous_slide(void) | 2001 | static void show_previous_slide(void) |
2002 | { | 2002 | { |
2003 | if (step == 0) { | 2003 | if (step == 0) { |
2004 | if (center_index > 0) { | 2004 | if (center_index > 0) { |
@@ -2017,7 +2017,7 @@ void show_previous_slide(void) | |||
2017 | /** | 2017 | /** |
2018 | Go to the next slide | 2018 | Go to the next slide |
2019 | */ | 2019 | */ |
2020 | void show_next_slide(void) | 2020 | static void show_next_slide(void) |
2021 | { | 2021 | { |
2022 | if (step == 0) { | 2022 | if (step == 0) { |
2023 | if (center_index < number_of_slides - 1) { | 2023 | if (center_index < number_of_slides - 1) { |
@@ -2036,7 +2036,7 @@ void show_next_slide(void) | |||
2036 | /** | 2036 | /** |
2037 | Render the slides. Updates only the offscreen buffer. | 2037 | Render the slides. Updates only the offscreen buffer. |
2038 | */ | 2038 | */ |
2039 | void render_all_slides(void) | 2039 | static void render_all_slides(void) |
2040 | { | 2040 | { |
2041 | mylcd_set_background(G_BRIGHT(0)); | 2041 | mylcd_set_background(G_BRIGHT(0)); |
2042 | /* TODO: Optimizes this by e.g. invalidating rects */ | 2042 | /* TODO: Optimizes this by e.g. invalidating rects */ |
@@ -2091,7 +2091,7 @@ void render_all_slides(void) | |||
2091 | /** | 2091 | /** |
2092 | Updates the animation effect. Call this periodically from a timer. | 2092 | Updates the animation effect. Call this periodically from a timer. |
2093 | */ | 2093 | */ |
2094 | void update_scroll_animation(void) | 2094 | static void update_scroll_animation(void) |
2095 | { | 2095 | { |
2096 | if (step == 0) | 2096 | if (step == 0) |
2097 | return; | 2097 | return; |
@@ -2193,7 +2193,7 @@ void update_scroll_animation(void) | |||
2193 | /** | 2193 | /** |
2194 | Cleanup the plugin | 2194 | Cleanup the plugin |
2195 | */ | 2195 | */ |
2196 | void cleanup(void) | 2196 | static void cleanup(void) |
2197 | { | 2197 | { |
2198 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 2198 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
2199 | rb->cpu_boost(false); | 2199 | rb->cpu_boost(false); |
@@ -2210,7 +2210,7 @@ void cleanup(void) | |||
2210 | /** | 2210 | /** |
2211 | Shows the settings menu | 2211 | Shows the settings menu |
2212 | */ | 2212 | */ |
2213 | int settings_menu(void) | 2213 | static int settings_menu(void) |
2214 | { | 2214 | { |
2215 | int selection = 0; | 2215 | int selection = 0; |
2216 | bool old_val; | 2216 | bool old_val; |
@@ -2320,7 +2320,7 @@ enum { | |||
2320 | PF_MENU_QUIT, | 2320 | PF_MENU_QUIT, |
2321 | }; | 2321 | }; |
2322 | 2322 | ||
2323 | int main_menu(void) | 2323 | static int main_menu(void) |
2324 | { | 2324 | { |
2325 | int selection = 0; | 2325 | int selection = 0; |
2326 | int result; | 2326 | int result; |
@@ -2371,7 +2371,7 @@ int main_menu(void) | |||
2371 | /** | 2371 | /** |
2372 | Animation step for zooming into the current cover | 2372 | Animation step for zooming into the current cover |
2373 | */ | 2373 | */ |
2374 | void update_cover_in_animation(void) | 2374 | static void update_cover_in_animation(void) |
2375 | { | 2375 | { |
2376 | cover_animation_keyframe++; | 2376 | cover_animation_keyframe++; |
2377 | if( cover_animation_keyframe < 20 ) { | 2377 | if( cover_animation_keyframe < 20 ) { |
@@ -2391,7 +2391,7 @@ void update_cover_in_animation(void) | |||
2391 | /** | 2391 | /** |
2392 | Animation step for zooming out the current cover | 2392 | Animation step for zooming out the current cover |
2393 | */ | 2393 | */ |
2394 | void update_cover_out_animation(void) | 2394 | static void update_cover_out_animation(void) |
2395 | { | 2395 | { |
2396 | cover_animation_keyframe++; | 2396 | cover_animation_keyframe++; |
2397 | if( cover_animation_keyframe <= 15 ) { | 2397 | if( cover_animation_keyframe <= 15 ) { |
@@ -2481,7 +2481,7 @@ void reset_track_list(void) | |||
2481 | /** | 2481 | /** |
2482 | Display the list of tracks | 2482 | Display the list of tracks |
2483 | */ | 2483 | */ |
2484 | void show_track_list(void) | 2484 | static void show_track_list(void) |
2485 | { | 2485 | { |
2486 | mylcd_clear_display(); | 2486 | mylcd_clear_display(); |
2487 | if ( center_slide.slide_index != track_index ) { | 2487 | if ( center_slide.slide_index != track_index ) { |
@@ -2518,7 +2518,7 @@ void show_track_list(void) | |||
2518 | } | 2518 | } |
2519 | } | 2519 | } |
2520 | 2520 | ||
2521 | void select_next_track(void) | 2521 | static void select_next_track(void) |
2522 | { | 2522 | { |
2523 | if ( selected_track < track_count - 1 ) { | 2523 | if ( selected_track < track_count - 1 ) { |
2524 | selected_track++; | 2524 | selected_track++; |
@@ -2527,7 +2527,7 @@ void select_next_track(void) | |||
2527 | } | 2527 | } |
2528 | } | 2528 | } |
2529 | 2529 | ||
2530 | void select_prev_track(void) | 2530 | static void select_prev_track(void) |
2531 | { | 2531 | { |
2532 | if (selected_track > 0 ) { | 2532 | if (selected_track > 0 ) { |
2533 | if (selected_track==start_index_track_list) start_index_track_list--; | 2533 | if (selected_track==start_index_track_list) start_index_track_list--; |
@@ -2539,7 +2539,7 @@ void select_prev_track(void) | |||
2539 | /* | 2539 | /* |
2540 | * Puts the current tracklist into a newly created playlist and starts playling | 2540 | * Puts the current tracklist into a newly created playlist and starts playling |
2541 | */ | 2541 | */ |
2542 | void start_playback(bool append) | 2542 | static void start_playback(bool append) |
2543 | { | 2543 | { |
2544 | static int old_playlist = -1, old_shuffle = 0; | 2544 | static int old_playlist = -1, old_shuffle = 0; |
2545 | int count = 0; | 2545 | int count = 0; |
@@ -2584,7 +2584,7 @@ play: | |||
2584 | /** | 2584 | /** |
2585 | Draw the current album name | 2585 | Draw the current album name |
2586 | */ | 2586 | */ |
2587 | void draw_album_text(void) | 2587 | static void draw_album_text(void) |
2588 | { | 2588 | { |
2589 | if (show_album_name == ALBUM_NAME_HIDE) | 2589 | if (show_album_name == ALBUM_NAME_HIDE) |
2590 | return; | 2590 | return; |
@@ -2633,7 +2633,7 @@ void draw_album_text(void) | |||
2633 | /** | 2633 | /** |
2634 | Display an error message and wait for input. | 2634 | Display an error message and wait for input. |
2635 | */ | 2635 | */ |
2636 | void error_wait(const char *message) | 2636 | static void error_wait(const char *message) |
2637 | { | 2637 | { |
2638 | rb->splashf(0, "%s. Press any button to continue.", message); | 2638 | rb->splashf(0, "%s. Press any button to continue.", message); |
2639 | while (rb->get_action(CONTEXT_STD, 1) == ACTION_NONE) | 2639 | while (rb->get_action(CONTEXT_STD, 1) == ACTION_NONE) |
@@ -2645,7 +2645,7 @@ void error_wait(const char *message) | |||
2645 | Main function that also contain the main plasma | 2645 | Main function that also contain the main plasma |
2646 | algorithm. | 2646 | algorithm. |
2647 | */ | 2647 | */ |
2648 | int main(void) | 2648 | static int main(void) |
2649 | { | 2649 | { |
2650 | int ret; | 2650 | int ret; |
2651 | 2651 | ||