summaryrefslogtreecommitdiff
path: root/apps/plugins/pictureflow
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/pictureflow')
-rw-r--r--apps/plugins/pictureflow/pictureflow.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index eae7a061fd..db4621eb24 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -410,7 +410,7 @@ static int extra_fade;
410 410
411static int albumtxt_x = 0; 411static int albumtxt_x = 0;
412static int albumtxt_dir = -1; 412static int albumtxt_dir = -1;
413static int prev_center_index = -1; 413static int prev_albumtxt_index = -1;
414 414
415static int start_index_track_list = 0; 415static int start_index_track_list = 0;
416static int track_list_visible_entries = 0; 416static int track_list_visible_entries = 0;
@@ -418,6 +418,7 @@ static int track_list_y;
418static int track_list_h; 418static int track_list_h;
419static int track_scroll_x = 0; 419static int track_scroll_x = 0;
420static int track_scroll_dir = 1; 420static int track_scroll_dir = 1;
421static int last_selected_track;
421 422
422/* 423/*
423 Proposals for transitions: 424 Proposals for transitions:
@@ -1119,6 +1120,8 @@ bool create_albumart_cache(void)
1119 format |= FORMAT_RESIZE|FORMAT_KEEP_ASPECT; 1120 format |= FORMAT_RESIZE|FORMAT_KEEP_ASPECT;
1120 for (i=0; i < album_count; i++) 1121 for (i=0; i < album_count; i++)
1121 { 1122 {
1123 draw_progressbar(i);
1124
1122 rb->snprintf(pfraw_file, sizeof(pfraw_file), CACHE_PREFIX "/%x.pfraw", 1125 rb->snprintf(pfraw_file, sizeof(pfraw_file), CACHE_PREFIX "/%x.pfraw",
1123 mfnv(get_album_name(i))); 1126 mfnv(get_album_name(i)));
1124 /* delete existing cache, so it's a true rebuild */ 1127 /* delete existing cache, so it's a true rebuild */
@@ -1127,7 +1130,6 @@ bool create_albumart_cache(void)
1127 continue; 1130 continue;
1128 rb->remove(pfraw_file); 1131 rb->remove(pfraw_file);
1129 } 1132 }
1130 draw_progressbar(i);
1131 if (!get_albumart_for_index_from_db(i, albumart_file, MAX_PATH)) 1133 if (!get_albumart_for_index_from_db(i, albumart_file, MAX_PATH))
1132 rb->strcpy(albumart_file, EMPTY_SLIDE_BMP); 1134 rb->strcpy(albumart_file, EMPTY_SLIDE_BMP);
1133 1135
@@ -2105,7 +2107,6 @@ void update_scroll_animation(void)
2105*/ 2107*/
2106void cleanup(void) 2108void cleanup(void)
2107{ 2109{
2108 int i;
2109#ifdef HAVE_ADJUSTABLE_CPU_FREQ 2110#ifdef HAVE_ADJUSTABLE_CPU_FREQ
2110 rb->cpu_boost(false); 2111 rb->cpu_boost(false);
2111#endif 2112#endif
@@ -2116,8 +2117,6 @@ void cleanup(void)
2116#ifdef USEGSLIB 2117#ifdef USEGSLIB
2117 grey_release(); 2118 grey_release();
2118#endif 2119#endif
2119 FOR_NB_SCREENS(i)
2120 rb->viewportmanager_theme_undo(i, false);
2121} 2120}
2122 2121
2123/** 2122/**
@@ -2149,7 +2148,7 @@ int settings_menu(void)
2149 }; 2148 };
2150 2149
2151 do { 2150 do {
2152 selection=rb->do_menu(&settings_menu,&selection, NULL, true); 2151 selection=rb->do_menu(&settings_menu,&selection, NULL, false);
2153 switch(selection) { 2152 switch(selection) {
2154 case 0: 2153 case 0:
2155 rb->set_bool("Show FPS", &show_fps); 2154 rb->set_bool("Show FPS", &show_fps);
@@ -2248,7 +2247,7 @@ int main_menu(void)
2248#endif 2247#endif
2249 "Settings", "Return", "Quit"); 2248 "Settings", "Return", "Quit");
2250 while (1) { 2249 while (1) {
2251 switch (rb->do_menu(&main_menu,&selection, NULL, true)) { 2250 switch (rb->do_menu(&main_menu,&selection, NULL, false)) {
2252 case PF_GOTO_WPS: /* WPS */ 2251 case PF_GOTO_WPS: /* WPS */
2253 return -2; 2252 return -2;
2254#if PF_PLAYBACK_CAPABLE 2253#if PF_PLAYBACK_CAPABLE
@@ -2373,19 +2372,20 @@ static void track_list_yh(int char_height)
2373void reset_track_list(void) 2372void reset_track_list(void)
2374{ 2373{
2375 int char_height = rb->screens[SCREEN_MAIN]->getcharheight(); 2374 int char_height = rb->screens[SCREEN_MAIN]->getcharheight();
2375 int total_height;
2376 track_list_yh(char_height); 2376 track_list_yh(char_height);
2377 track_list_visible_entries = fmin( track_list_h/char_height , track_count ); 2377 track_list_visible_entries = fmin( track_list_h/char_height , track_count );
2378 start_index_track_list = 0; 2378 start_index_track_list = 0;
2379 track_scroll_x = 0;
2380 track_scroll_dir = 1;
2381 selected_track = 0; 2379 selected_track = 0;
2380 last_selected_track = -1;
2382 2381
2383 /* let the tracklist start more centered 2382 /* let the tracklist start more centered
2384 * if the screen isn't filled with tracks */ 2383 * if the screen isn't filled with tracks */
2385 if (track_count*char_height < track_list_h) 2384 total_height = track_count*char_height;
2385 if (total_height < track_list_h)
2386 { 2386 {
2387 track_list_h = track_count * char_height; 2387 track_list_y += (track_list_h - total_height) / 2;
2388 track_list_y = LCD_HEIGHT / 2 - (track_list_h / 2); 2388 track_list_h = total_height;
2389 } 2389 }
2390} 2390}
2391 2391
@@ -2411,8 +2411,12 @@ void show_track_list(void)
2411 mylcd_getstringsize(get_track_name(track_i), &titletxt_w, NULL); 2411 mylcd_getstringsize(get_track_name(track_i), &titletxt_w, NULL);
2412 titletxt_x = (LCD_WIDTH-titletxt_w)/2; 2412 titletxt_x = (LCD_WIDTH-titletxt_w)/2;
2413 if ( track_i == selected_track ) { 2413 if ( track_i == selected_track ) {
2414 if (selected_track != last_selected_track) {
2415 last_selected_track = selected_track;
2416 track_scroll_x = 0;
2417 track_scroll_dir = -1;
2418 }
2414 draw_gradient(titletxt_y, titletxt_h); 2419 draw_gradient(titletxt_y, titletxt_h);
2415 mylcd_set_foreground(G_BRIGHT(255));
2416 if (titletxt_w > LCD_WIDTH ) { 2420 if (titletxt_w > LCD_WIDTH ) {
2417 if ( titletxt_w + track_scroll_x <= LCD_WIDTH ) 2421 if ( titletxt_w + track_scroll_x <= LCD_WIDTH )
2418 track_scroll_dir = 1; 2422 track_scroll_dir = 1;
@@ -2420,13 +2424,13 @@ void show_track_list(void)
2420 track_scroll_x += track_scroll_dir*2; 2424 track_scroll_x += track_scroll_dir*2;
2421 titletxt_x = track_scroll_x; 2425 titletxt_x = track_scroll_x;
2422 } 2426 }
2423 mylcd_putsxy(titletxt_x,titletxt_y,get_track_name(track_i)); 2427 color = 255;
2424 } 2428 }
2425 else { 2429 else {
2426 color = 250 - (abs(selected_track - track_i) * 200 / track_count); 2430 color = 250 - (abs(selected_track - track_i) * 200 / track_count);
2427 mylcd_set_foreground(G_BRIGHT(color));
2428 mylcd_putsxy(titletxt_x,titletxt_y,get_track_name(track_i));
2429 } 2431 }
2432 mylcd_set_foreground(G_BRIGHT(color));
2433 mylcd_putsxy(titletxt_x,titletxt_y,get_track_name(track_i));
2430 titletxt_y += titletxt_h; 2434 titletxt_y += titletxt_h;
2431 } 2435 }
2432} 2436}
@@ -2435,8 +2439,6 @@ void select_next_track(void)
2435{ 2439{
2436 if ( selected_track < track_count - 1 ) { 2440 if ( selected_track < track_count - 1 ) {
2437 selected_track++; 2441 selected_track++;
2438 track_scroll_x = 0;
2439 track_scroll_dir = 1;
2440 if (selected_track==(track_list_visible_entries+start_index_track_list)) 2442 if (selected_track==(track_list_visible_entries+start_index_track_list))
2441 start_index_track_list++; 2443 start_index_track_list++;
2442 } 2444 }
@@ -2446,8 +2448,6 @@ void select_prev_track(void)
2446{ 2448{
2447 if (selected_track > 0 ) { 2449 if (selected_track > 0 ) {
2448 if (selected_track==start_index_track_list) start_index_track_list--; 2450 if (selected_track==start_index_track_list) start_index_track_list--;
2449 track_scroll_x = 0;
2450 track_scroll_dir = 1;
2451 selected_track--; 2451 selected_track--;
2452 } 2452 }
2453} 2453}
@@ -2506,6 +2506,7 @@ void draw_album_text(void)
2506 if (show_album_name == ALBUM_NAME_HIDE) 2506 if (show_album_name == ALBUM_NAME_HIDE)
2507 return; 2507 return;
2508 2508
2509 int albumtxt_index;
2509 int albumtxt_w, albumtxt_h; 2510 int albumtxt_w, albumtxt_h;
2510 int albumtxt_y = 0; 2511 int albumtxt_y = 0;
2511 2512
@@ -2516,25 +2517,26 @@ void draw_album_text(void)
2516 c = ((slide_frame & 0xffff )/ 255); 2517 c = ((slide_frame & 0xffff )/ 255);
2517 if (step < 0) c = 255-c; 2518 if (step < 0) c = 255-c;
2518 if (c > 128 ) { /* half way to next slide .. still not perfect! */ 2519 if (c > 128 ) { /* half way to next slide .. still not perfect! */
2519 albumtxt = get_album_name(center_index+step); 2520 albumtxt_index = center_index+step;
2520 c = (c-128)*2; 2521 c = (c-128)*2;
2521 } 2522 }
2522 else { 2523 else {
2523 albumtxt = get_album_name(center_index); 2524 albumtxt_index = center_index;
2524 c = (128-c)*2; 2525 c = (128-c)*2;
2525 } 2526 }
2526 } 2527 }
2527 else { 2528 else {
2529 albumtxt_index = center_index;
2528 c= 255; 2530 c= 255;
2529 albumtxt = get_album_name(center_index);
2530 } 2531 }
2532 albumtxt = get_album_name(albumtxt_index);
2531 2533
2532 mylcd_set_foreground(G_BRIGHT(c)); 2534 mylcd_set_foreground(G_BRIGHT(c));
2533 mylcd_getstringsize(albumtxt, &albumtxt_w, &albumtxt_h); 2535 mylcd_getstringsize(albumtxt, &albumtxt_w, &albumtxt_h);
2534 if (center_index != prev_center_index) { 2536 if (albumtxt_index != prev_albumtxt_index) {
2535 albumtxt_x = 0; 2537 albumtxt_x = 0;
2536 albumtxt_dir = -1; 2538 albumtxt_dir = -1;
2537 prev_center_index = center_index; 2539 prev_albumtxt_index = albumtxt_index;
2538 } 2540 }
2539 2541
2540 if (show_album_name == ALBUM_NAME_TOP) 2542 if (show_album_name == ALBUM_NAME_TOP)
@@ -2845,12 +2847,10 @@ int main(void)
2845 2847
2846enum plugin_status plugin_start(const void *parameter) 2848enum plugin_status plugin_start(const void *parameter)
2847{ 2849{
2848 int ret, i; 2850 int ret;
2849 (void) parameter; 2851 (void) parameter;
2850 atexit(cleanup); 2852 atexit(cleanup);
2851 2853
2852 FOR_NB_SCREENS(i)
2853 rb->viewportmanager_theme_enable(i, false, NULL);
2854#ifdef HAVE_ADJUSTABLE_CPU_FREQ 2854#ifdef HAVE_ADJUSTABLE_CPU_FREQ
2855 rb->cpu_boost(true); 2855 rb->cpu_boost(true);
2856#endif 2856#endif